Downloads · 30 days
6
3% of all-time downloads
Sharjeelbaig/ShaziLLM-1B-ONNX
ShaziLLM-1B-ONNX is a text generation model from Sharjeelbaig. Use it when you need the model to write or continue text. It is set up for transformers.js. The card lists the license as apache-2.0.
Low-memory ONNX release of ShaziLLM-1B. The decoder includes KV-cache inputs and outputs for efficient autoregressive generation and follows the Hugging Face onnx/ repository layout.
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
205
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.onnx3.4 GB · 100%
From the Hugging Face model README
Low-memory ONNX release of ShaziLLM-1B. The decoder includes KV-cache inputs and outputs for efficient autoregressive generation and follows the Hugging Face onnx/ repository layout.
npm install @huggingface/transformers
import { pipeline } from "@huggingface/transformers";
const generator = await pipeline(
"text-generation",
"Sharjeelbaig/ShaziLLM-1B-ONNX",
{ dtype: "int8" },
);
const messages = [
{ role: "user", content: "Explain recursion in one short paragraph." },
];
const prompt = generator.tokenizer.apply_chat_template(messages, {
tokenize: false,
add_generation_prompt: true,
enable_thinking: false,
});
const output = await generator(prompt, {
max_new_tokens: 128,
do_sample: false,
return_full_text: false,
});
console.log(output[0].generated_text);
Node.js is the most predictable low-memory JavaScript target. Browser use requires enough memory for the 1.6 GB graph plus runtime buffers; use the WASM backend and limit context length.
pip install "optimum-onnx[onnxruntime]" transformers
from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForCausalLM
model_id = "Sharjeelbaig/ShaziLLM-1B-ONNX"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForCausalLM.from_pretrained(
model_id,
subfolder="onnx",
file_name="model_int8.onnx",
use_cache=True,
)
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [{"role": "user", "content": "What is 7 times 8?"}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
result = generator(
prompt,
max_new_tokens=64,
do_sample=False,
return_full_text=False,
)
print(result[0]["generated_text"])
The model has an explicit attention head_dim of 128 even though its internal residual hidden size is 1536. Some current ONNX generation wrappers initialize cache tensors using hidden_size / num_attention_heads and ignore the explicit head_dim. This ONNX-only repository reports a runtime projection width of 2048 so those wrappers allocate the correct 128-wide cache. The exported graph and normal BF16 checkpoint retain the actual 1536 residual width. This compatibility value must not be used to reconstruct or train the architecture.
0.00119 against PyTorch.Quantization can change token choices, especially when logits are close. The configured 128K context is not realistic on low-memory systems because KV-cache memory grows with sequence length. Start with short contexts and conservative generation limits. Validate generated code and never grant model-produced tool calls authority without deterministic checks.
Released under Apache License 2.0; see LICENSE. ShaziLLM-1B is a fine-tuned derivative of OpenBMB/MiniCPM5-1B. The ShaziLLM name identifies this release and does not imply authorship of the upstream base architecture.