An int4 ONNX export of HuggingFaceTB/SmolLM2-1.7B-Instruct for ONNX Runtime GenAI on the CPU execution provider. ONNX is a portable model format. Those weights are stored as four-bit integers, a form of quantization that makes the file smaller. ONNX Runtime GenAI is the library used to generate text from that file. The CPU execution provider means the model runs on a regular processor. Which Hugging Face revision was used as the conversion input is not recorded (same wording as the ship NOTICE).
All model weights and training are by the Hugging Face SmolLM team. This repo contains only a converted, quantized copy. It is not a new model and it was not fine-tuned.
Developers who want to try a 1.7B instruct model (trained to follow instructions) with ONNX Runtime
GenAI on a plain CPU, without running the conversion themselves. It is a test artifact from the
xllama catalogue entry smollm2-1.7b-cpu-int4 (GitHub release models-v1).
genai_config.json is 8192 (the maximum number of tokens, or pieces of text, the configured model can consider at once).HuggingFaceTB/SmolLM2-1.7B-Instruct with the upstream revision not recorded. A Hugging Face
revision used only as a model-card licence check is not the conversion input and is not named here
as one.smollm2-1.7b-cpu-int4 (same base model, int4,
ONNX Runtime on CPU, and a single merged model.onnx file). The throughput figures below are the
published xllama summary row for SmolLM2-1.7B int4 ORT-GenAI CPU in docs/benchmarks.md. See the
hash caveat in Measured throughput.The weights are in a single file (no separate .onnx.data file), together with the GenAI and
tokenizer companion files, LICENSE and NOTICE. Asset names on GitHub release models-v1 use the
smollm2-1.7b-cpu-int4_ prefix. On the Hugging Face Hub, those assets would typically be renamed
to the local names in the first column.
| Local name | Release asset | Size (bytes) | sha256 |
|---|---|---|---|
LICENSE |
smollm2-1.7b-cpu-int4_LICENSE |
11357 | c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 |
NOTICE |
smollm2-1.7b-cpu-int4_NOTICE |
170 | ce00add4201f10fb0db32193fc183fb5082ff96e2800319d51fbd6ba18388691 |
genai_config.json |
smollm2-1.7b-cpu-int4_genai_config.json |
1458 | c76e19ce57f3463f19588142c8266f805d18cb93a38288d8c5b9d35dae030753 |
tokenizer.json |
smollm2-1.7b-cpu-int4_tokenizer.json |
3522871 | bf346d64f6f0fbcefb4c1b6928a98241467dff36c6fbae5fe1785c4ff90667f4 |
tokenizer_config.json |
smollm2-1.7b-cpu-int4_tokenizer_config.json |
452 | 47b4a92de79d133d06b4cec56e9b8226d2be0b62936209577181d5a76444a08a |
model.onnx |
smollm2-1.7b-cpu-int4_model.onnx |
1474861442 | 8b46fe437133f584ddab2443f92cf60e531d17318a81a3c99e5e0993f6e7020e |
These six sha256 values are the pins (the expected checksums) in xllama uwp/models/manifest.json for smollm2-1.7b-cpu-int4.
All six match the GitHub models-v1 release digests (checked on 9 November 2026).
The recipe below is inferred from the repository; the exact command was not recorded.
python3 -m onnxruntime_genai.models.builder -m HuggingFaceTB/SmolLM2-1.7B-Instruct -o <OUT> -p int4 -e cpumodel.onnx with scripts/merge_onnx_external_data.py
(commit f051587 records cpu-int4 OK (1.4GB merged); the shipped file is the single
1 474 861 442-byte model.onnx above).The ONNX Runtime GenAI version pinned in the shipped xllama build is 0.14.1 (a30f479af016cb098688726831a9acbb8d19f0b2).
The versions of the builder CLI, torch, transformers, and onnx used for this conversion run are not recorded.
From xllama docs/benchmarks.md @8a3f2ddb (summary row for SmolLM2-1.7B, int4, ORT-GenAI CPU), campaign
2026-11-15-remeasure-1533, source CSV 2026-11-15-remeasure-1533/smollm2-1.7b-cpu-int4:
| Prefill tok/s | Decode tok/s | Decode min–max | Peak RAM MiB |
|---|---|---|---|
| 61.1 | 21.0 | 20.8–21.7 (n=3) | 2324 |
In the table, tok/s means tokens per second. Prefill is the rate at which the prompt was processed. Decode is the rate at which new tokens were generated.
Raw CSV (bench/results/2026-11-15-remeasure-1533/smollm2-1.7b-cpu-int4.csv): host tag xbox-series-s-declared, backend ort-genai-cpu, n_ctx=2048, n_threads=8,
median of 3 runs (range 20.8–21.7 decode): prompt_tok_s=61.14, decode_tok_s=21.02, peak_ws_mb=2324, package 1.7.0.1533.
The CSV records no model-file hash. Console measurement was on Xbox Series S in Developer Mode.
n_ctx is the context length used in that measurement. n_threads is the number of CPU threads used.
Example (not run against these exact files):
pip install onnxruntime-genai huggingface_hub
hf download gianlucamazza/SmolLM2-1.7B-Instruct-ort-genai-int4-cpu --local-dir smollm2-1.7b-int4
import onnxruntime_genai as og
model = og.Model("smollm2-1.7b-int4")
tokenizer = og.Tokenizer(model)
prompt = "<|im_start|>user\nWhat is the capital of Italy?<|im_end|>\n<|im_start|>assistant\n"
params = og.GeneratorParams(model)
params.set_search_options(max_length=256)
generator = og.Generator(model, params)
generator.append_tokens(tokenizer.encode(prompt))
stream = tokenizer.create_stream()
while not generator.is_done():
generator.generate_next_token()
print(stream.decode(generator.get_next_tokens()[0]), end="", flush=True)
Apache-2.0, the same as the base model. Keep the base model's attribution and the ship NOTICE when you redistribute. Upstream: HuggingFaceTB / SmolLM2-1.7B-Instruct.
Ship NOTICE (byte-exact from smollm2-1.7b-cpu-int4_NOTICE / LICENSES/HuggingFaceTB-SmolLM2-1.7B-cpu-int4-NOTICE):
Modified by xllama: converted to ONNX int4 from HuggingFaceTB/SmolLM2-1.7B-Instruct (upstream revision not recorded). Licensed under the Apache License 2.0; see LICENSE.
Running xllama on an Xbox Series S in Developer Mode showed problems in the open-source ONNX Runtime projects. Status as of 9 November 2026:
Issues reported against onnxruntime:
This work came from xllama on the Xbox. The onnxruntime.dll and onnxruntime-genai.dll that
xllama ships are patched by xllama and are not Microsoft release builds.