Instructions to use RusMiniLM/RusNanoMath-800M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RusMiniLM/RusNanoMath-800M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RusMiniLM/RusNanoMath-800M") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("RusMiniLM/RusNanoMath-800M") model = AutoModelForMultimodalLM.from_pretrained("RusMiniLM/RusNanoMath-800M", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use RusMiniLM/RusNanoMath-800M with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf RusMiniLM/RusNanoMath-800M:F16 # Run inference directly in the terminal: llama cli -hf RusMiniLM/RusNanoMath-800M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf RusMiniLM/RusNanoMath-800M:F16 # Run inference directly in the terminal: llama cli -hf RusMiniLM/RusNanoMath-800M:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf RusMiniLM/RusNanoMath-800M:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf RusMiniLM/RusNanoMath-800M:F16
Use Docker
docker model run hf.co/RusMiniLM/RusNanoMath-800M:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use RusMiniLM/RusNanoMath-800M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RusMiniLM/RusNanoMath-800M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RusMiniLM/RusNanoMath-800M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RusMiniLM/RusNanoMath-800M:F16
- SGLang
How to use RusMiniLM/RusNanoMath-800M 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 "RusMiniLM/RusNanoMath-800M" \ --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": "RusMiniLM/RusNanoMath-800M", "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 "RusMiniLM/RusNanoMath-800M" \ --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": "RusMiniLM/RusNanoMath-800M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use RusMiniLM/RusNanoMath-800M with Ollama:
ollama run hf.co/RusMiniLM/RusNanoMath-800M:F16
- Unsloth Desktop
- Docker Model Runner
How to use RusMiniLM/RusNanoMath-800M with Docker Model Runner:
docker model run hf.co/RusMiniLM/RusNanoMath-800M:F16
- Lemonade
How to use RusMiniLM/RusNanoMath-800M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RusMiniLM/RusNanoMath-800M:F16
Run and chat with the model
lemonade run user.RusNanoMath-800M-F16
List all available models
lemonade list
- Atomic Chat
RusNanoMath-800M
English Overview
RusNanoMath-800M is an open-weights 800M parameter bilingual (Russian / English) mathematical reasoning model. Built on a hybrid Linear Attention architecture (Qwen3.5 with Gated Delta Rule layers) and aligned via targeted multi-stage SFT and SimPO (Simple Preference Optimization), it demonstrates very strong reasoning performance across competitive mathematics benchmarks, particularly in symbolic algebra.
Benchmark Visual Leaderboards
1. MATH-500 Overall Leaderboard
2. Dedicated Algebra Breakdown (MATH-500: Algebra)
3. GSM8K Leaderboard
Highlights
- Symbolic Algebra (MATH-500 Algebra): In the 124 algebra competition problems, RusNanoMath-800M achieves 52.4%, closely approaching Llama-3.1-8B (53.8%) and surpassing models with 1.5Bโ3B parameters (Qwen2.5-1.5B at 49.5%, Llama-3.2-3B at 48.0%, Gemma-2-2B at 41.2%).
- General Competition Math (MATH-500 Overall): Across all 500 problems, RusNanoMath-800M reaches 36.2%, outperforming sub-1B to 2B models (Gemma-2-2B at 35.0%, SmolLM2-1.7B at 21.5%, Llama-3.2-1B at 14.0%).
- Grade School Arithmetic (GSM8K): Achieves 52.0%, handling multi-step reasoning chains and arithmetic problems.
Quickstart & Inference
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
MODEL_ID = "itismax0/RusNanoML-800M"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForImageTextToText.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model.eval()
messages = [
{
"role": "user",
"content": "ะะฐะนะดะธัะต ะฒัะต ะดะตะนััะฒะธัะตะปัะฝัะต ะบะพัะฝะธ ััะฐะฒะฝะตะฝะธั x^4 - 5x^2 + 4 = 0. ะัะฒะตั ะทะฐะฟะธัะธัะต ะฒ \\boxed{}."
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=1024,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Run with llama.cpp / Ollama (GGUF, full precision)
A full-precision F16 GGUF (RusNanoML-800M-F16.gguf) is included in this repo โ no quantization loss.
# llama.cpp
llama-cli -hf itismax0/RusNanoML-800M:RusNanoML-800M-F16.gguf --temp 0 -p "ะะฐะนะดะธัะต ะฒัะต ะดะตะนััะฒะธัะตะปัะฝัะต ะบะพัะฝะธ ััะฐะฒะฝะตะฝะธั x^4 - 5x^2 + 4 = 0."
Ollama (import the GGUF locally):
echo "FROM RusNanoML-800M-F16.gguf
PARAMETER temperature 0
TEMPLATE \"{{ .Prompt }}\"" > Modelfile
ollama create rusnanoml-800m -f Modelfile
ollama run rusnanoml-800m "ะะฐะนะดะธัะต ะฒัะต ะดะตะนััะฒะธัะตะปัะฝัะต ะบะพัะฝะธ ััะฐะฒะฝะตะฝะธั x^4 - 5x^2 + 4 = 0."
Note: the model uses the Qwen3.5 hybrid linear-attention architecture. llama.cpp builds from
master(>= b12413) support it; older builds will refuse to load the file.
ะะฑะทะพั ะฝะฐ ััััะบะพะผ
RusNanoMath-800M โ ะพัะบัััะฐั ะดะฒััะทััะฝะฐั (ััััะบะธะน ะธ ะฐะฝะณะปะธะนัะบะธะน) ะผะพะดะตะปั ะฝะฐ 800 ะผะปะฝ ะฟะฐัะฐะผะตััะพะฒ ะดะปั ัะตัะตะฝะธั ะผะฐัะตะผะฐัะธัะตัะบะธั ะธ ะปะพะณะธัะตัะบะธั ะทะฐะดะฐั. ะัั ะธัะตะบัััะฐ ะฟะพัััะพะตะฝะฐ ะฝะฐ ะฑะฐะทะต Qwen3.5 ั ะณะธะฑัะธะดะฝัะผ ะปะธะฝะตะนะฝัะผ ะฒะฝะธะผะฐะฝะธะตะผ (Gated Delta Rule), ััะพ ะพะฑะตัะฟะตัะธะฒะฐะตั ะบะพะฝััะฐะฝัะฝัั ัะปะพะถะฝะพััั ะฟะฐะผััะธ ัะพััะพัะฝะธั O(1) ะฟัะธ ะณะตะฝะตัะฐัะธะธ. ะะฑััะตะฝะธะต ะฒะบะปััะฐะตั ััะฐะฟั ัะตะปะตะฒะพะณะพ SFT ะฝะฐ ัะตะฟะพัะบะฐั ัะฐัััะถะดะตะฝะธะน (CoT) ะธ ะฒััะฐะฒะฝะธะฒะฐะฝะธะต ะผะตัะพะดะพะผ ะฟัะตะดะฟะพััะตะฝะธะน SimPO (Simple Preference Optimization).
ะัะฐัะธะบะธ ััะฐะฒะฝะตะฝะธั ั ะพัะบััััะผะธ ะผะพะดะตะปัะผะธ
1. ะะฑัะธะน ะทะฐััั: MATH-500
2. ะ ะฐะทะดะตะป ะฐะปะณะตะฑัั: MATH-500 (Algebra)
3. ะัะธัะผะตัะธะบะฐ ะธ ัะตะบััะพะฒัะต ะทะฐะดะฐัะธ: GSM8K
ะัะฝะพะฒะฝัะต ะฟะพะบะฐะทะฐัะตะปะธ
- ะะปะณะตะฑัะฐ (MATH-500 Algebra): ะ ะฑะปะพะบะต ะธะท 124 ะทะฐะดะฐั ะฟะพ ะฐะปะณะตะฑัะต RusNanoMath-800M ะฟะพะบะฐะทัะฒะฐะตั 52.4% (65 ัะตััะฝะฝัั ะทะฐะดะฐั ะธะท 124). ะะพะดะตะปั ะฒะฟะปะพัะฝัั ะฟัะธะฑะปะธะถะฐะตััั ะบ ะฟะพะบะฐะทะฐัะตะปัะผ Llama-3.1-8B (53.8%) ะธ ะฟัะตะฒะพัั ะพะดะธั ะผะพะดะตะปะธ ะฑะพะปััะตะณะพ ัะฐะทะผะตัะฐ: Qwen2.5-1.5B (49.5%), Llama-3.2-3B (48.0%) ะธ Gemma-2-2B (41.2%).
- ะะฑัะธะน ะทะฐััั MATH-500: ะะพ ะฒัะตะผั ะฝะฐะฑะพัั ะธะท 500 ะพะปะธะผะฟะธะฐะดะฝัั ะทะฐะดะฐั ะผะพะดะตะปั ะฝะฐะฑะธัะฐะตั 36.2% (181 ัะตััะฝะฝะฐั ะทะฐะดะฐัะฐ), ะพะฟะตัะตะถะฐั Gemma-2-2B (35.0%), Mistral-7B-Instruct (28.4%), SmolLM2-1.7B (21.5%) ะธ Llama-3.2-1B (14.0%).
- GSM8K: ะะฐ ัะตััะต ะผะฝะพะณะพัะฐะณะพะฒะพะน ะฐัะธัะผะตัะธะบะธ ะผะพะดะตะปั ะฟะพะบะฐะทัะฒะฐะตั 52.0% (260 ัะตััะฝะฝัั ะทะฐะดะฐั ะธะท 500).
ะัั ะธัะตะบัััะฐ ะธ ะฟะฐัะฐะผะตััั
- ะะฐัะฐะผะตััั: 800 ะผะปะฝ (0.8B)
- ะะฝะธะผะฐะฝะธะต: ะะธะฑัะธะดะฝะพะต ะปะธะฝะตะนะฝะพะต ะฒะฝะธะผะฐะฝะธะต (Gated Delta Rule) ัะพ ัะปะพะถะฝะพัััั ะฟะฐะผััะธ ัะพััะพัะฝะธั O(1)
- ะขัะตะฑะพะฒะฐะฝะธั ะบ ะฒะธะดะตะพะฟะฐะผััะธ: ะพะบะพะปะพ 1.6 ะะ ะฒ ัะพัะผะฐัะต BF16 (ัะฐะฑะพัะฐะตั ะฝะฐ ะฟะพััะตะฑะธัะตะปััะบะธั GPU ั 4 ะะ VRAM)
- ะะพะฝัะตะบัั: ะดะพ 32 768 ัะพะบะตะฝะพะฒ
- ะะธัะตะฝะทะธั: Apache 2.0
- Downloads last month
- 178
Model tree for RusMiniLM/RusNanoMath-800M
Evaluation results
- MATH-500 Accuracy on MATH-500self-reported36.200
- MATH-500 Algebra Accuracy on MATH-500self-reported52.420
- GSM8K Accuracy on GSM8Kself-reported52.000


