ONNX Model Zoo

shreyask/Maincoder-1B-ONNX-web

By shreyask · ↓ 13 · ♥ 0 · Updated 2026-02-13

What's in this repo

This page lists the files in shreyask/Maincoder-1B-ONNX-web, including model_q4.onnx.

  • 1 ONNX models (.onnx files)
  • 11 files, including 7 .json, 1 .md, 1 .txt, 1 .onnx
  • Last updated 2026-02-13

ONNX files

File Size Download
onnx/model_q4.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Maincoder 1B — ONNX (Quantized, WebGPU)

This is a quantized ONNX version of Maincode/Maincoder-1B, optimized for in-browser inference with Transformers.js and WebGPU.

Quantization

  • Format: ONNX with int4 (MatMulNBits) quantization
  • Original model size: ~5 GB (fp32)
  • Quantized model size: ~1.5 GB (q4)
  • Quantization method: MatMulNBitsQuantizer from onnxruntime with block_size=32, symmetric quantization

All tensor data is embedded in a single .onnx file (no external data files) for browser compatibility.

Usage with Transformers.js

import { AutoModelForCausalLM, AutoTokenizer } from "@huggingface/transformers";

const model = await AutoModelForCausalLM.from_pretrained(
  "shreyask/Maincoder-1B-ONNX-web",
  { dtype: "q4", device: "webgpu" }
);

const tokenizer = await AutoTokenizer.from_pretrained(
  "shreyask/Maincoder-1B-ONNX-web"
);

const messages = [
  { role: "system", content: "You are Maincoder, an expert code generation assistant." },
  { role: "user", content: "Write a binary search function in Python" },
];

const input = tokenizer.apply_chat_template(messages, {
  add_generation_prompt: true,
  return_dict: true,
});

const output = await model.generate({
  ...input,
  max_new_tokens: 1024,
  eos_token_id: [151643, 151645],
});

Base Model

This is a quantized conversion of Maincode/Maincoder-1B. See the base model card for training details, benchmarks, and intended use.

Model info

text-generation transformers.js
transformers.js onnx llama text-generation code python maincoder code-generation reinforcement-learning mcpo conversational en
↓ 13 ♥ 0

Created: 2026-02-12

Updated: 2026-02-13

View on Hugging Face

Files (11)

.gitattributes
README.md
added_tokens.json
config.json
generation_config.json
merges.txt
onnx/model_q4.onnx ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.json

Related models