Instructions to use ifx-pse-sys-ml/spark-13m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ifx-pse-sys-ml/spark-13m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ifx-pse-sys-ml/spark-13m-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ifx-pse-sys-ml/spark-13m-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ifx-pse-sys-ml/spark-13m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ifx-pse-sys-ml/spark-13m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ifx-pse-sys-ml/spark-13m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ifx-pse-sys-ml/spark-13m-instruct
- SGLang
How to use ifx-pse-sys-ml/spark-13m-instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ifx-pse-sys-ml/spark-13m-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ifx-pse-sys-ml/spark-13m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ifx-pse-sys-ml/spark-13m-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ifx-pse-sys-ml/spark-13m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ifx-pse-sys-ml/spark-13m-instruct with Docker Model Runner:
docker model run hf.co/ifx-pse-sys-ml/spark-13m-instruct
spark-13m-instruct
A 13.2M-parameter English instruction-tuned language model โ a deliberately tiny model in the spirit of SmolLM, for research on small-model capability, fast experimentation, and as a lightweight decoder backbone (e.g. for a small VLM). It is ~10ร smaller than SmolLM-135M.
- Architecture: Llama-style decoder, hidden 384, 6 layers, 6 heads / 2 KV heads (GQA), intermediate 1216, RoPE, context 1024, vocab 6400 (English BPE).
- Base: pretrained on ~17B tokens (TinyStories + FineWeb-Edu + ClimbMix), wiki perplexity 21.98.
- Instruct: SFT on SmolTalk (200k conversations), 5 epochs.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("ifx-pse-sys-ml/spark-13m-instruct", trust_remote_code=True)
tok = AutoTokenizer.from_pretrained("ifx-pse-sys-ml/spark-13m-instruct")
msgs = [{"role": "user", "content": "Tell me about the moon."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=128)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
The decoder also accepts inputs_embeds (exactly one of input_ids / inputs_embeds), so a
vision projector can splice visual tokens in โ it can serve as a small VLM text backbone.
Benchmarks
Accuracy (%) via lm-evaluation-harness
0.4, the same harness and shots for every model, so the columns are directly comparable.
(SmolLM's blog used lighteval; those numbers use a different harness and are not comparable,
so they are not quoted here.)
| Benchmark | chance | spark-13m-base | spark-13m-instruct | SmolLM-135M | SmolLM-135M-Instruct |
|---|---|---|---|---|---|
| hellaswag | 25 | 28.0 | 28.3 | 42.6 | 41.9 |
| arc_easy | 25 | 38.3 | 34.2 | 56.1 | 43.9 |
| arc_challenge | 25 | 21.4 | 24.7 | 28.9 | 27.4 |
| piqa | 50 | 60.4 | 56.7 | 68.4 | 67.0 |
| winogrande | 50 | 50.1 | 50.6 | 53.2 | 51.3 |
| openbookqa | 25 | 25.4 | 26.0 | 34.0 | 33.6 |
| commonsense_qa | 20 | 21.5 | 22.4 | 19.8 | 20.3 |
| mmlu | 25 | 24.2 | 25.3 | 25.2 | 24.4 |
| average | โ | 33.7 | 33.5 | 41.0 | 38.7 |
Honest limitations
At 13M parameters this model is near random chance on knowledge- and harder-reasoning benchmarks (MMLU, OpenBookQA, ARC-Challenge, Winogrande). It retains real signal only where commonsense/pattern beats stored knowledge (PIQA 60, ARC-Easy 38). It is a research and prototyping model โ a capable small decoder for its size, not a knowledge model. Instruction-tuning adds response format, not facts, so instruct โ base on these academic benchmarks.
Trained with the Nexus codebase. English only.
- Downloads last month
- -