ONNX Model Zoo

inference4j/smollm2-1.7b-instruct

By inference4j · ↓ 9 · ♥ 0 · Updated 2026-02-21

What's in this repo

This page lists the files in inference4j/smollm2-1.7b-instruct, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 10 files, including 4 .json, 1 .md, 1 .jinja, 1 .txt, 1 .onnx, 1 .onnx_data
  • Last updated 2026-02-21

ONNX files

File Size Download
model.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

SmolLM2-1.7B-Instruct — ONNX (FP16)

ONNX export of SmolLM2-1.7B-Instruct (1.7B parameters, FP16 weights) with KV cache support for efficient autoregressive generation.

Converted for use with inference4j, an inference-only AI library for Java.

Original Source

Usage with inference4j

try (var gen = OnnxTextGenerator.smolLM2_1_7B().build()) {
    GenerationResult result = gen.generate("What is Java?");
    System.out.println(result.text());
}

Model Details

Property Value
Architecture LlamaForCausalLM (1.7B parameters, 24 layers, 2048 hidden, 32 heads, 32 KV heads)
Task Text generation (instruction-tuned)
Precision FP16
Context length 8192 tokens
Vocabulary 49,152 tokens (BPE)
Chat template ChatML (`<
Original framework PyTorch (transformers)
Export method Hugging Face Optimum (with KV cache, FP16)

License

This model is licensed under the Apache License 2.0. Original model by HuggingFace.

Model info

onnx llama text-generation smollm2 inference4j conversational license:apache-2.0 region:us
↓ 9 ♥ 0

Created: 2026-02-21

Updated: 2026-02-21

View on Hugging Face

Files (10)

.gitattributes
README.md
chat_template.jinja
config.json
merges.txt
model.onnx ONNX
model.onnx_data
special_tokens_map.json
tokenizer_config.json
vocab.json

Related models