Text Generation
Transformers
Safetensors
GGUF
Russian
English
qwen3
russian
chat
assistant
on-device
mnn
conversational
text-generation-inference
Instructions to use Rahspide/MNN-Pocket-0.3B-RU-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rahspide/MNN-Pocket-0.3B-RU-Chat") 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("Rahspide/MNN-Pocket-0.3B-RU-Chat") model = AutoModelForCausalLM.from_pretrained("Rahspide/MNN-Pocket-0.3B-RU-Chat", 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 Rahspide/MNN-Pocket-0.3B-RU-Chat 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 Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
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 Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rahspide/MNN-Pocket-0.3B-RU-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- SGLang
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat 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 "Rahspide/MNN-Pocket-0.3B-RU-Chat" \ --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": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "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 "Rahspide/MNN-Pocket-0.3B-RU-Chat" \ --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": "Rahspide/MNN-Pocket-0.3B-RU-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Ollama:
ollama run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Unsloth Desktop
- Pi
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Docker Model Runner:
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
- Lemonade
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Run and chat with the model
lemonade run user.MNN-Pocket-0.3B-RU-Chat-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Rahspide/MNN-Pocket-0.3B-RU-Chat with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "Rahspide/MNN-Pocket-0.3B-RU-Chat:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
docs: released v1, recipe as run, GGUF, spot-check
Browse files
README.md
CHANGED
|
@@ -22,8 +22,8 @@ tags:
|
|
| 22 |
|
| 23 |
# MNN-Pocket-0.3B-RU-Chat (planned)
|
| 24 |
|
| 25 |
-
> **Status:
|
| 26 |
-
>
|
| 27 |
|
| 28 |
Russian instruction-following assistant, built by SFT on top of
|
| 29 |
[`Rahspide/MNN-Pocket-0.3B-RU`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU).
|
|
@@ -54,33 +54,52 @@ model means Russian is already paid for, and SFT only has to teach the dialogue
|
|
| 54 |
A control run on the official `taobao-mnn/MNN-Pocket-0.3B` with the same SFT data is planned, so that
|
| 55 |
"we lost the assistant in pretraining" can be told apart from "there was no assistant to lose".
|
| 56 |
|
| 57 |
-
##
|
| 58 |
|
| 59 |
-
- Start point: `Rahspide/MNN-Pocket-0.3B-RU` (
|
| 60 |
- Chat template: the model's own ChatML (`<|im_start|>` / `<|im_end|>`), untouched.
|
| 61 |
- Loss only on assistant tokens; system and user turns are masked context.
|
| 62 |
- Multi-turn dialogue kept as one example; packing with explicit boundaries.
|
| 63 |
-
-
|
| 64 |
-
one epoch per checkpoint kept, best picked on the held-out split rather than on the training loss.
|
| 65 |
- 10–20% English instruction replay from `HuggingFaceH4/ultrachat_200k` to keep bilingual instruction
|
| 66 |
following; the exact share is tuned on an English sanity set.
|
| 67 |
-
-
|
| 68 |
|
| 69 |
-
##
|
| 70 |
|
| 71 |
| Dataset | Role | Licence |
|
| 72 |
|---|---|---|
|
| 73 |
| `IlyaGusev/saiga_scored` | core Russian instructions with quality scores | see dataset card |
|
| 74 |
| `IlyaGusev/ru_turbo_alpaca` | volume filler | CC-BY-4.0 |
|
| 75 |
-
| `HuggingFaceH4/ultrachat_200k` | English replay,
|
| 76 |
|
| 77 |
Rules: deduplicate by normalised text, drop examples shorter than ~16 tokens, exclude any dataset whose
|
| 78 |
licence forbids redistribution of derivatives, and check for leakage into MERA test sets.
|
| 79 |
|
| 80 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
- Blind manual review of 50–100 Russian dialogues: instruction following, naturalness, correct refusal,
|
| 83 |
-
2–3 turn coherence.
|
| 84 |
- Selective MERA tasks that fit a 0.3B model's format and context — not the aggregate score.
|
| 85 |
- No regression against the continuation sister on Russian bits/char, and no collapse of English answers.
|
| 86 |
|
|
|
|
| 22 |
|
| 23 |
# MNN-Pocket-0.3B-RU-Chat (planned)
|
| 24 |
|
| 25 |
+
> **Status: v1 released.** Instruction-tuned on 50M tokens (18.8M Russian + 6M English replay) on one
|
| 26 |
+
> Kaggle T4 in ~6.5 h. Weights and GGUF builds are in this repository.
|
| 27 |
|
| 28 |
Russian instruction-following assistant, built by SFT on top of
|
| 29 |
[`Rahspide/MNN-Pocket-0.3B-RU`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU).
|
|
|
|
| 54 |
A control run on the official `taobao-mnn/MNN-Pocket-0.3B` with the same SFT data is planned, so that
|
| 55 |
"we lost the assistant in pretraining" can be told apart from "there was no assistant to lose".
|
| 56 |
|
| 57 |
+
## Recipe (as run)
|
| 58 |
|
| 59 |
+
- Start point: `Rahspide/MNN-Pocket-0.3B-RU` (step 36,621).
|
| 60 |
- Chat template: the model's own ChatML (`<|im_start|>` / `<|im_end|>`), untouched.
|
| 61 |
- Loss only on assistant tokens; system and user turns are masked context.
|
| 62 |
- Multi-turn dialogue kept as one example; packing with explicit boundaries.
|
| 63 |
+
- One run at 50M tokens (1,525 optimizer steps, 32k tokens each), checkpoints every 300 steps.
|
|
|
|
| 64 |
- 10–20% English instruction replay from `HuggingFaceH4/ultrachat_200k` to keep bilingual instruction
|
| 65 |
following; the exact share is tuned on an English sanity set.
|
| 66 |
+
- lr 1e-4, cosine, 5% warmup, full fine-tuning, fp16 autocast on T4 with fp32 master weights.
|
| 67 |
|
| 68 |
+
## Data (as used)
|
| 69 |
|
| 70 |
| Dataset | Role | Licence |
|
| 71 |
|---|---|---|
|
| 72 |
| `IlyaGusev/saiga_scored` | core Russian instructions with quality scores | see dataset card |
|
| 73 |
| `IlyaGusev/ru_turbo_alpaca` | volume filler | CC-BY-4.0 |
|
| 74 |
+
| `HuggingFaceH4/ultrachat_200k` | English replay, 15% of tokens (6M) | MIT |
|
| 75 |
|
| 76 |
Rules: deduplicate by normalised text, drop examples shorter than ~16 tokens, exclude any dataset whose
|
| 77 |
licence forbids redistribution of derivatives, and check for leakage into MERA test sets.
|
| 78 |
|
| 79 |
+
## Quality spot-check
|
| 80 |
+
|
| 81 |
+
Greedy generation, Q4_K_M, CPU:
|
| 82 |
+
|
| 83 |
+
| Prompt | Answer |
|
| 84 |
+
|---|---|
|
| 85 |
+
| «Объясни в двух предложениях, что такое инфляция.» | «Инфляция — это процесс роста цен на товары и услуги в стране или за ее пределами. Этот процесс может привести к у…» |
|
| 86 |
+
| «Напиши короткое поздравление с днём рождения коллеге.» | «Дорогой [Имя], С днём рождения! Желаю, чтобы ваша работа была не только эффективной, но и приятной для глаз…» |
|
| 87 |
+
| «Привет! Как дела?» | повторяет вопрос — ожидаемое слабое место 0.3B на коротких репликах |
|
| 88 |
+
|
| 89 |
+
## GGUF builds
|
| 90 |
+
|
| 91 |
+
| File | Size | Note |
|
| 92 |
+
|---|---|---|
|
| 93 |
+
| `gguf/MNN-Pocket-0.3B-RU-Chat-Q8_0.gguf` | 310 MB | near-lossless |
|
| 94 |
+
| `gguf/MNN-Pocket-0.3B-RU-Chat-Q4_K_M.gguf` | 223 MB | phone size |
|
| 95 |
+
|
| 96 |
+
~63 tok/s generation on a 16-thread CPU, no GPU. Use the model's own ChatML template (`--jinja` in
|
| 97 |
+
llama.cpp); without it the model continues text instead of answering.
|
| 98 |
+
|
| 99 |
+
## Evaluation (to do)
|
| 100 |
|
| 101 |
- Blind manual review of 50–100 Russian dialogues: instruction following, naturalness, correct refusal,
|
| 102 |
+
2–3 turn coherence. **Not run yet** — the spot-check above is qualitative only.
|
| 103 |
- Selective MERA tasks that fit a 0.3B model's format and context — not the aggregate score.
|
| 104 |
- No regression against the continuation sister on Russian bits/char, and no collapse of English answers.
|
| 105 |
|