Instructions to use salgr/SalgrAI_2_Pro_Full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use salgr/SalgrAI_2_Pro_Full with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="salgr/SalgrAI_2_Pro_Full") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("salgr/SalgrAI_2_Pro_Full") model = AutoModelForCausalLM.from_pretrained("salgr/SalgrAI_2_Pro_Full", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use salgr/SalgrAI_2_Pro_Full 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 salgr/SalgrAI_2_Pro_Full:F16 # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_2_Pro_Full:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf salgr/SalgrAI_2_Pro_Full:F16 # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_2_Pro_Full: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 salgr/SalgrAI_2_Pro_Full:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf salgr/SalgrAI_2_Pro_Full:F16
Use Docker
docker model run hf.co/salgr/SalgrAI_2_Pro_Full:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use salgr/SalgrAI_2_Pro_Full with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "salgr/SalgrAI_2_Pro_Full" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "salgr/SalgrAI_2_Pro_Full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/salgr/SalgrAI_2_Pro_Full:F16
- SGLang
How to use salgr/SalgrAI_2_Pro_Full 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 "salgr/SalgrAI_2_Pro_Full" \ --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": "salgr/SalgrAI_2_Pro_Full", "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 "salgr/SalgrAI_2_Pro_Full" \ --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": "salgr/SalgrAI_2_Pro_Full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use salgr/SalgrAI_2_Pro_Full with Ollama:
ollama run hf.co/salgr/SalgrAI_2_Pro_Full:F16
- Unsloth Desktop
- Docker Model Runner
How to use salgr/SalgrAI_2_Pro_Full with Docker Model Runner:
docker model run hf.co/salgr/SalgrAI_2_Pro_Full:F16
- Lemonade
How to use salgr/SalgrAI_2_Pro_Full with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull salgr/SalgrAI_2_Pro_Full:F16
Run and chat with the model
lemonade run user.SalgrAI_2_Pro_Full-F16
List all available models
lemonade list
- Atomic Chat
SalgrAI-v2-Pro-Full
Qwen2.5-Coder-0.5B-Instruct fine-tuned on the SalgrAI dialog dataset by one person on a single RTX 3060. It keeps the base model's Python skills and answers in a short, casual, friend-like Russian ("lowercase Telegram Russian"). It is the largest model of the SalgrAI family (494M parameters) and is meant for experiments, demos and learning, not for serious use.
Please read the Limitations section. Almost all of the code and knowledge ability comes from the base model; fine-tuning added the conversational style, Russian replies and knowledge of who it is. Facts outside the training data are mostly wrong, arithmetic is unreliable, and there is no safety tuning of our own.
Model summary
| Base model | Qwen/Qwen2.5-Coder-0.5B-Instruct (Apache-2.0) |
| Architecture | unchanged: Qwen2 decoder-only, 24 layers, hidden 896, 14 heads (2 KV heads), FFN 4864, vocabulary 151,936, tied embeddings |
| Parameters | 494M (358M of them were fine-tuned, the embedding table was frozen) |
| Language | Russian and English (the base model also knows other languages and programming languages) |
| Format | ChatML without a system message: `< |
| Developed by | Salgr |
| License | Apache-2.0, as the base model (see LICENSE and NOTICE) |
Files
| File | Size | What it is |
|---|---|---|
model.safetensors |
988 MB | weights, bfloat16 (loads with transformers) |
pytorch_model.bin |
988 MB | the same weights as a PyTorch state dict |
SalgrAI-v2-Pro-Full-F16.gguf |
994 MB | GGUF, float16, for llama.cpp |
SalgrAI-v2-Pro-Full-Q8_0.gguf |
531 MB | GGUF, 8-bit: about half the size, the same quality in our tests |
config.json, generation_config.json |
config (unchanged from the base) and the recommended sampling settings | |
tokenizer.json, vocab.json, merges.txt, tokenizer_config.json |
the unchanged Qwen tokenizer; tokenizer_config.json carries our chat template |
|
chat_example.py |
a minimal chat script | |
LICENSE, NOTICE |
Apache-2.0 license text of the base model and the modification notice |
The weight formats were checked against each other: model.safetensors and pytorch_model.bin give exactly the same logits as the trained model cast to bf16; the F16 GGUF run in llama.cpp reproduces the greedy replies of the fp32 model on 10 of 10 test prompts, Q8_0 on 8 of 10. The prompt tokens are identical in transformers and llama.cpp.
Quick start
Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "YOUR-USERNAME/SalgrAI-v2-Pro-Full"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16)
messages = [{"role": "user", "content": "ะฟัะธะฒะตั"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True)
out = model.generate(**inputs) # sampling settings come from generation_config.json
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
llama.cpp (GGUF)
llama-server -m SalgrAI-v2-Pro-Full-Q8_0.gguf -c 2048 --port 8080
curl http://127.0.0.1:8080/v1/chat/completions -d '{"messages": [{"role": "user", "content": "ะฟัะธะฒะตั"}], "max_tokens": 200, "temperature": 0.5, "top_k": 40, "top_p": 0.9, "repeat_penalty": 1.1}'
The chat template is embedded in the file. Generation stops by itself at <|im_end|>.
Training
Base. Qwen/Qwen2.5-Coder-0.5B-Instruct. Full fine-tuning in bf16 autocast with the embedding table frozen (it doubles as the output layer): AdamW, learning rate 2e-5 decayed to 10% (cosine, 50 warm-up steps), weight decay 0.01, batch 16, up to 3 epochs, loss on assistant tokens only (about 0.46M tokens of 0.99M per epoch). The checkpoint with the best validation loss, epoch 2 (loss 1.756, perplexity 5.8; the base model scored 3.220 on the same set), is published; epoch 3 overfit (1.938). Training took about 24 minutes.
Data: 18,950 short dialogs (305 more held out for validation):
- ~9,800 casual conversation dialogs, synthetic, written by Claude Haiku (Anthropic) from a written specification (short replies, a consistent persona, no advice and no excuses);
- ~3,400 short knowledge dialogs (geography, history, science, mathematics, Russian language and literature, culture, technology), written by Claude Haiku, and ~1,000 examples from small hand-made tables (capitals, authors, dates) and simple arithmetic;
- ~900 dialogs about programming concepts (Python, HTML, SQL, Git), written by Claude Haiku;
- ~2,400 "what does this Python code print" examples, generated by a script and answered by actually running the code, and ~570 "write a function" examples (shown twice per epoch) in which every solution was checked by tests;
- 90 dialogs about the model itself (name, version, creator, size, and that it is based on Qwen2.5-Coder), shown 4 times per epoch. The dialogs are not released with the model.
Benchmark leakage control. Dialogs whose first message matched a question of our benchmarks (SBB, SBKCB) word for word were removed. For knowledge data, dialogs sharing two or more content words with a knowledge question of the benchmarks, or containing its expected answer, were also removed (about a quarter of the knowledge dialogs). The code-task data are of the same types as the coding questions of SBKCB ("write a function", "what does this code print"), only not the same wording.
Evaluation
Our own small benchmarks, one reply per prompt, no history, temperature 0, rule-based checks (keywords, not meaning), local runs.
SBKCB V1.0 (SalgrAI Basic Knowledge and Coding Bench, 150 questions: 90 knowledge, 20 coding, 40 conversation):
| Model | Total (of 150) | Knowledge (of 90) | Coding (of 20) | Conversation (of 40) |
|---|---|---|---|---|
| SalgrAI-v2-Pro-Full (bf16) | 63 | 18 | 18 | 27 |
| SalgrAI-v2-Pro-Full (Q8_0 GGUF) | 62 | 17 | 18 | 27 |
| Qwen2.5-Coder-0.5B-Instruct (the base, unmodified) | 59 | 18 | 19 | 22 |
| SalgrAI-v2 (Gemma 3 270M based, 131M) | 53 | 18 | 5 | 30 |
| SalgrAI-v2.1-Lite (25M, from scratch) | 35 | 3 | 5 | 27 |
SBB V1.0 (the author's older conversation benchmark, 100 short messages, now archived): Pro-Full 69 (Q8_0: 70), the unmodified Qwen2.5-Coder 47, SalgrAI-v2 82 (Q8_0: 79). On this benchmark the Gemma-based SalgrAI-v2 is clearly better in casual Russian.
How to read it, honestly.
- Pro-Full is the best of our models on SBKCB, but almost entirely because of the base model: coding (18 of 20) and knowledge (18 of 90) are the same as the unmodified Qwen2.5-Coder. The fine-tuning added conversation (27 against 22 of 40), short Russian replies and knowing who it is.
- Against SalgrAI-v2 (Q8_0 at 56) Pro-Full scores +6 on SBKCB: coding +12, knowledge -2, conversation -4. In casual Russian conversation (SBB) it is behind SalgrAI-v2.
- Both benchmarks are in-distribution for the fine-tuning data (written around their categories; the benchmark prompts themselves were removed). The rules of SBKCB were refined after looking at model answers, so the benchmark is somewhat tuned to the models tested. Differences of 2-3 points are within noise; Q8_0 against bf16 (62 against 63) is noise.
Examples (temperature 0, bf16, unedited).
| Prompt | Reply |
|---|---|
| ะบัะพ ัั? | ั SalgrAI v2 Pro Full, ะฝะตะนัะพัะตัั ะดะปั ะพะฑัะตะฝะธั ะธ ะฟะพะผะพัะธ ั ะบะพะดะพะผ. |
| ะฝะฐ ะบะฐะบะพะน ะผะพะดะตะปะธ ัั ะพัะฝะพะฒะฐะฝะฐ? | ะผะพั ะพัะฝะพะฒะฐ ััะพ Qwen2.5 Coder 0.5B Instruct, ะฐ ะดะพะพะฑััะธะป ะผะตะฝั Salgr, ัะฐะบ ััะพ ั SalgrAI v2 Pro Full. |
| ะฝะฐะฟะธัะธ ััะฝะบัะธั ัะปะพะถะตะฝะธั ะดะฒัั ัะธัะตะป ะฝะฐ Python | def add(a, b): newline, four spaces, return a + b |
| ะงัะพ ะฒัะฒะตะดะตั ะบะพะด ะฝะฐ Python: print(6 * 7) | 42 |
| ะงัะพ ะฒัะฒะตะดะตั ะบะพะด: print(len('ะผะธั')) | ะฒัะฒะตะดะตั 4 (wrong, the answer is 3) |
| ะบะฐะบะฐั ััะพะปะธัะฐ ั ะัะฐะปะธะธ? | ะ ะธะผ, ะบะพะฝะตัะฝะพ |
| ััะพะปะธัะฐ ะะฐะผะธะฑะธะธ? | ะัะฒะตะนั, ะบะพะฝะตัะฝะพ (wrong, Windhoek) |
| ัะบะพะปัะบะพ ะฑัะดะตั 17 ัะผะฝะพะถะธัั ะฝะฐ 23? | ะฑัะดะตั 301 (wrong, 391) |
| ะบัะพ ะฝะฐะฟะธัะฐะป ะะฒะณะตะฝะธะน ะะฝะตะณะธะฝ? | ะััั ะะตัะฒัะน, ะฒ 1706 ะณะพะดั (wrong, Pushkin) |
Intended use, limitations and risks
- Intended use: hobby experiments, demos, studying how small models behave, a small Russian-speaking chat and simple-code assistant baseline.
- Not for: facts, calculations, advice, writing or checking real code, moderation, anything where a wrong or rude answer matters.
- Factual knowledge is poor: only about 20% of our knowledge questions are answered correctly (the same as the unmodified base), and on hard questions almost none. Arithmetic with larger numbers is unreliable. The model sounds confident while being wrong.
- Replies are deliberately short and casual (the style of the fine-tuning data); long explanations and long code are not what it was tuned for, and quality in Russian is below the Gemma-based SalgrAI-v2.
- No safety tuning of our own. The base model's alignment may have been weakened by fine-tuning on casual dialogs, and there is no profanity filter. If you expose it publicly, add your own filtering.
- The fine-tuning dialogs are LLM-generated, so the style is narrow and carries the habits of the generator. The model names itself in places where it does not fit.
- The chat template differs from the original Qwen one (no system message): use the template shipped here.
- Sampled replies differ from run to run and slightly between runtimes; Q8_0 differs from bf16 in some wordings.
SalgrAI family
| Model | Parameters | Notes |
|---|---|---|
| SalgrAI-v1 / v1.1 / v1.2 | 15M / 15M / 25M | from scratch |
| SalgrAI-v2-Lite, SalgrAI-v2.1-Lite | 24.9M | from scratch |
| SalgrAI-v2 / SalgrAI-v2-Full | 130.8M / 268.1M | Gemma 3 270M-it fine-tuned (v2 with the vocabulary pruned to Russian) |
| SalgrAI-v2-Pro-Full | 494M | Qwen2.5-Coder-0.5B-Instruct fine-tuned; the largest, strongest in code (from the base) |
| SalgrAI-Decider | 25M | not a chat model: picks one of 2-8 options |
Live demo: https://salgr.top/freeopus/ - benchmarks: https://salgr.top/freeopus/benchmarks
License
Apache-2.0, the license of the base model Qwen2.5-Coder-0.5B-Instruct (full text in LICENSE). The weights were modified by fine-tuning; see NOTICE. The fine-tuning dialogs were largely generated with Claude Haiku (Anthropic); if you reuse the model, please also check the terms of that service for your use case.
- Downloads last month
- 186
Model tree for salgr/SalgrAI_2_Pro_Full
Base model
Qwen/Qwen2.5-0.5B