Instructions to use salgr/SalgrAI_1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use salgr/SalgrAI_1.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="salgr/SalgrAI_1.1") 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_1.1") model = AutoModelForCausalLM.from_pretrained("salgr/SalgrAI_1.1", 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_1.1 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_1.1:F16 # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_1.1:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf salgr/SalgrAI_1.1:F16 # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_1.1: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_1.1:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf salgr/SalgrAI_1.1:F16
Use Docker
docker model run hf.co/salgr/SalgrAI_1.1:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use salgr/SalgrAI_1.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "salgr/SalgrAI_1.1" # 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_1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/salgr/SalgrAI_1.1:F16
- SGLang
How to use salgr/SalgrAI_1.1 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_1.1" \ --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_1.1", "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_1.1" \ --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_1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use salgr/SalgrAI_1.1 with Ollama:
ollama run hf.co/salgr/SalgrAI_1.1:F16
- Unsloth Desktop
- Docker Model Runner
How to use salgr/SalgrAI_1.1 with Docker Model Runner:
docker model run hf.co/salgr/SalgrAI_1.1:F16
- Lemonade
How to use salgr/SalgrAI_1.1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull salgr/SalgrAI_1.1:F16
Run and chat with the model
lemonade run user.SalgrAI_1.1-F16
List all available models
lemonade list
- Atomic Chat
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("salgr/SalgrAI_1.1")
model = AutoModelForCausalLM.from_pretrained("salgr/SalgrAI_1.1", 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]:]))SalgrAI-v1.1
A tiny Russian-language chat model (14,997,888 parameters, 6 layers) trained from scratch by one person on a single RTX 3060. It chats in a casual, friend-like style ("lowercase Telegram Russian") and is meant for experiments, demos and learning, not for serious use: it is far too small to be reliably correct.
Please read the Limitations section. The model often replies off-topic, gets facts and arithmetic wrong, and has no profanity or safety filter.
Model summary
| Architecture | decoder-only Transformer, Llama-style: RMSNorm, RoPE (theta 10000), SwiGLU, no biases, tied input/output embeddings |
| Size | 6 layers, hidden 384, 6 attention heads (head dim 64), FFN 1202, 14,997,888 parameters |
| Context | 1024 tokens |
| Vocabulary | 8192 (byte-level BPE trained on the pretraining text and the dialogs) |
| Language | Russian (some English, digits and symbols) |
| Format | chat: <|user|>...<|assistant|>...<|eos|> |
| Developed by | Salgr |
Files
| File | What it is |
|---|---|
model.safetensors |
weights, float32, Llama layout (loads with transformers, no custom code) |
pytorch_model.bin |
the same weights as a PyTorch state dict |
SalgrAI-v1.1-F16.gguf |
GGUF, float16, for llama.cpp (quantized variants are not provided) |
config.json, generation_config.json |
Llama config and the recommended sampling settings |
tokenizer.json, tokenizer_config.json, special_tokens_map.json |
tokenizer and chat template |
original/ |
the original code (model.py, common.py), the native checkpoint salgrai_original.pt and chat_example.py |
The three weight formats were checked against each other: transformers logits match the original model (max difference ~1e-5), greedy generation is identical, and the GGUF file run in llama.cpp gives the same top token and log-probabilities within 0.002 on the test prompts.
Quick start
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "YOUR-USERNAME/SalgrAI-v1.1"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
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-v1.1-F16.gguf -c 1024 --port 8080
# then, for example:
curl http://127.0.0.1:8080/completion -d '{"prompt": "<|user|>привет<|assistant|>", "n_predict": 120, "temperature": 0.8, "top_k": 40, "top_p": 0.9, "repeat_penalty": 1.1}'
# or the OpenAI-compatible endpoint (the chat template is embedded in the file):
curl http://127.0.0.1:8080/v1/chat/completions -d '{"messages": [{"role": "user", "content": "привет"}], "max_tokens": 120}'
Generation stops by itself at the end-of-turn token <|eos|>.
Native PyTorch
cd original
python chat_example.py # needs torch and tokenizers; commands: /reset, /exit
Prompt format
<|user|>message<|assistant|>reply<|eos|><|user|>next message<|assistant|>
The model was trained with the loss on assistant tokens only. The reference code (original/common.py) additionally collapses whitespace, replaces <| in user text with < | (so users cannot inject service tokens) and drops the oldest turns when the context is full; the Hugging Face chat template does none of that. Recommended sampling: temperature 0.8 (0.5-0.6 gives steadier but duller replies), top-k 40, top-p 0.9, repetition penalty 1.1. Note that transformers applies the repetition penalty to the prompt tokens as well, the reference code only to generated tokens.
Training
Everything was trained from random initialization on one RTX 3060 (12 GB) in bf16. No third-party model weights were used.
Tokenizer. Byte-level BPE, 8192 tokens, trained on the pretraining text plus the dialogs.
Pretraining. Same pretraining checkpoint as v1 (6 layers, about 500M tokens of Russian Wikipedia and OpenSubtitles; final validation loss 2.926 on Wikipedia and 3.016 on subtitles).
Fine-tuning. SFT directly from the pretraining checkpoint (the subtitle pseudo-dialog stage used by v1 was dropped: it gave a worse validation loss, 3.287 vs 3.076) on 4,317 dialogs: 2,754 from wave 2 plus 1,563 wave-1 dialogs without the "ну" / "вот и" / "ахах" habits. lr 2e-4, best epoch 4; 200 wave-2 dialogs held out. Loss only on assistant tokens.
Synthetic dialogs. The fine-tuning dialogs are synthetic: they were generated by Claude Haiku (Anthropic) from written specifications (informal friend-like Russian chat, user/assistant turns, honest "I don't know", short refusals of unsafe requests, the assistant introduces itself as SalgrAI made by Salgr). They were generated in three waves: wave 1 (3,000 dialogs, short, many replies began with "ну"), wave 2 (about 3,000, longer, answers that actually answer, fewer verbal tics) and wave 3 (about 3,000, richer answers, more questions back). The dialogs are not released with the model. If you reuse the model, please also check the terms of the sources below.
Pretraining text sources. Russian Wikipedia (wikimedia/wikipedia, 20231101.ru; CC BY-SA) and Russian OpenSubtitles from OPUS (subtitle copyright belongs to the respective rights holders; check the OPUS terms before any reuse).
Evaluation (informal)
Each model has its own validation set, so the validation losses below are not comparable between versions.
| Version | Parameters | Validation loss on its own held-out dialogs |
|---|---|---|
| v1 | 14,997,888 | 3.580 (perplexity 35.9), 150 dialogs of wave 1 |
| v1.1 | 14,997,888 | 3.076 (perplexity 21.7), 200 dialogs of wave 2 |
| v1.2 | 24,874,368 | 2.903 (perplexity 18.2), 250 dialogs of wave 3 |
A tiny side-by-side probe on the final weights (same sampling settings for all versions): 20 simple factual questions (capital of France, 7 x 8, "what is Python?", ...), 4 samples each = 80 answers; an answer counts as a hit if it contains an expected keyword or number. And 3 greetings ("привет", "здарова", "добрый вечер") x 6 samples = 18 answers; a hit if the reply starts with a greeting.
| Version | Facts (hits of 80) | Greetings (hits of 18) |
|---|---|---|
| v1 | 1 | 14 |
| v1.1 | 14 | 17 |
| v1.2 | 11 | 18 |
With 80 samples the standard error is about 4 percentage points, so the difference between v1.1 and v1.2 on facts is within noise. The probe shows that v1 is far behind on facts and that v1.2 answers greetings most reliably; it does not show that the bigger model knows more.
Intended use, limitations and risks
- Intended use: hobby experiments, demos, studying how small language models behave, a baseline for tiny Russian chat models.
- Not for: advice, facts, calculations, moderation, anything where a wrong or rude answer matters.
- Factual knowledge is unreliable and arithmetic almost never works: with 15-25M parameters and a small amount of Wikipedia text the model mostly learned the style of conversation, not facts. It often sounds fluent while being wrong or meaningless.
- No safety tuning and no profanity filter. Part of the pretraining text is movie subtitles, so the model can occasionally produce rude language or profanity. If you expose it publicly, add your own filtering.
- The fine-tuning dialogs are LLM-generated, so the style is narrow (casual, short, lowercase) and carries the biases and habits of the generator; the replies are short (typically around 10 words).
- Mainly Russian; English is weak. Context is 1024 tokens.
- Sampled replies differ from run to run (sampling) and slightly between runtimes (the repetition-penalty difference noted above); the weights themselves are numerically equivalent in all formats.
SalgrAI family
| Model | Parameters | Notes |
|---|---|---|
| SalgrAI-v1 | 14,997,888 | first release; extra subtitle pseudo-dialog stage, 2,850 SFT dialogs |
| SalgrAI-v1.1 | 14,997,888 | second wave of dialogs, cleaner style (fewer "ну вот" tics), 4,317 SFT dialogs |
| SalgrAI-v1.2 | 24,874,368 | grown to 11 layers, more subtitles, third wave of dialogs, 5,878 SFT dialogs |
| SalgrAI-Decider | 25,024,129 | not a chat model: picks one of 2-8 options and returns probabilities |
Live demo of v1, v1.1, v1.2 (switch at the top): https://salgr.top/freeopus/ - and of the Decider: https://salgr.top/freeopus/decider/
License
Not specified yet (see the note at the top of this file). Also consider the licenses and terms of the training sources listed above.
- Downloads last month
- 63
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="salgr/SalgrAI_1.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)