Text Generation
Transformers
Safetensors
GGUF
Russian
English
Chinese
qwen3
russian
on-device
edge
mnn
keyboard
work-in-progress
conversational
text-generation-inference
Instructions to use Rahspide/MNN-Pocket-0.3B-RU 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 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") 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") model = AutoModelForCausalLM.from_pretrained("Rahspide/MNN-Pocket-0.3B-RU", 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 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:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU: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:Q4_K_M # Run inference directly in the terminal: llama cli -hf Rahspide/MNN-Pocket-0.3B-RU: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:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Rahspide/MNN-Pocket-0.3B-RU 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
- SGLang
How to use Rahspide/MNN-Pocket-0.3B-RU 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Rahspide/MNN-Pocket-0.3B-RU with Ollama:
ollama run hf.co/Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
- Unsloth Desktop
- Pi
How to use Rahspide/MNN-Pocket-0.3B-RU 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: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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Rahspide/MNN-Pocket-0.3B-RU with Docker Model Runner:
docker model run hf.co/Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
- Lemonade
How to use Rahspide/MNN-Pocket-0.3B-RU with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
Run and chat with the model
lemonade run user.MNN-Pocket-0.3B-RU-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Rahspide/MNN-Pocket-0.3B-RU 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: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:8080/v1 hermes config set model.default Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Rahspide/MNN-Pocket-0.3B-RU 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: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:8080/v1 \ --custom-model-id "Rahspide/MNN-Pocket-0.3B-RU: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: MNN INT4 build, run instructions, release v1.1
Browse files
README.md
CHANGED
|
@@ -161,6 +161,7 @@ used, so the resulting weights stay publishable.
|
|
| 161 |
|---|---|---|---|
|
| 162 |
| Q8_0 | 310 MB | [`MNN-Pocket-0.3B-RU-Q8_0.gguf`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU/blob/main/gguf/MNN-Pocket-0.3B-RU-Q8_0.gguf) | near-lossless, for desktop |
|
| 163 |
| Q4_K_M | 223 MB | [`MNN-Pocket-0.3B-RU-Q4_K_M.gguf`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU/blob/main/gguf/MNN-Pocket-0.3B-RU-Q4_K_M.gguf) | the size to ship on a phone |
|
|
|
|
| 164 |
|
| 165 |
Both files sit under `gguf/` with the quant tag in the name, which is what llama.cpp matches on:
|
| 166 |
|
|
@@ -178,6 +179,17 @@ Converted with llama.cpp `convert_hf_to_gguf.py` (f16) and quantised with `llama
|
|
| 178 |
|
| 179 |
Phone figures will be several times lower; these are desktop-CPU numbers.
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
Two conversion quirks, both already fixed in this repository's `tokenizer_config.json`.
|
| 182 |
|
| 183 |
- the base pre-tokenizer does not hash-match in current llama.cpp, so the Qwen pre-tokenizer has to be pinned
|
|
@@ -235,13 +247,14 @@ deliberate trade: Russian is the target, English and Chinese are kept from degra
|
|
| 235 |
| **v1** | Russian continuation model — this run | **released** |
|
| 236 |
| **v2** | Russian assistant: SFT on ChatML on top of v1 — [released](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU-Chat) | **released** |
|
| 237 |
| **v3** | Tokenizer extension measured: +8,192 Cyrillic merges give ×1.49 more Russian characters per token, +16,384 give ×1.63. `model_ext` (73,728 rows, child-mean init) is built; needs a 100–200 M token CPT to pay for itself | measured, CPT pending |
|
| 238 |
-
| **v4** | Quantised builds for devices: GGUF Q8_0 / Q4_K_M
|
| 239 |
|
| 240 |
## Releases
|
| 241 |
|
| 242 |
| Date | Version | What changed |
|
| 243 |
|---|---|---|
|
| 244 |
| 2026-11-10 | **v1.0** | 1.2 B-token continued pretraining released: bf16 weights, GGUF Q8_0 and Q4_K_M, measured ru/en/zh bits-per-char |
|
|
|
|
| 245 |
| 2026-11-10 | v2.0 (sister) | Assistant checkpoint released: 50 M-token SFT on top of v1, weights and GGUF |
|
| 246 |
|
| 247 |
## Licence and attribution
|
|
|
|
| 161 |
|---|---|---|---|
|
| 162 |
| Q8_0 | 310 MB | [`MNN-Pocket-0.3B-RU-Q8_0.gguf`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU/blob/main/gguf/MNN-Pocket-0.3B-RU-Q8_0.gguf) | near-lossless, for desktop |
|
| 163 |
| Q4_K_M | 223 MB | [`MNN-Pocket-0.3B-RU-Q4_K_M.gguf`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU/blob/main/gguf/MNN-Pocket-0.3B-RU-Q4_K_M.gguf) | the size to ship on a phone |
|
| 164 |
+
| MNN INT4 | 165 MB | [mnn/MNN-Pocket-0.3B-RU-INT4](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU/tree/main/mnn/MNN-Pocket-0.3B-RU-INT4) | MNN runtime, Android |
|
| 165 |
|
| 166 |
Both files sit under `gguf/` with the quant tag in the name, which is what llama.cpp matches on:
|
| 167 |
|
|
|
|
| 179 |
|
| 180 |
Phone figures will be several times lower; these are desktop-CPU numbers.
|
| 181 |
|
| 182 |
+
The MNN build runs through MNN's own runtime. Build `llm_demo` from the MNN repository with
|
| 183 |
+
`-DMNN_BUILD_LLM=ON`, then point it at the folder:
|
| 184 |
+
|
| 185 |
+
```bash
|
| 186 |
+
cd mnn/MNN-Pocket-0.3B-RU-INT4 && llm_demo config.json prompt.txt
|
| 187 |
+
```
|
| 188 |
+
|
| 189 |
+
165 MB on disk, ~354 tok/s prefill and ~77 tok/s decode on 12 CPU threads here. `llm_config.json` carries no
|
| 190 |
+
chat template on purpose: this checkpoint continues the prompt, so the runtime should not wrap it in a dialogue
|
| 191 |
+
format.
|
| 192 |
+
|
| 193 |
Two conversion quirks, both already fixed in this repository's `tokenizer_config.json`.
|
| 194 |
|
| 195 |
- the base pre-tokenizer does not hash-match in current llama.cpp, so the Qwen pre-tokenizer has to be pinned
|
|
|
|
| 247 |
| **v1** | Russian continuation model — this run | **released** |
|
| 248 |
| **v2** | Russian assistant: SFT on ChatML on top of v1 — [released](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU-Chat) | **released** |
|
| 249 |
| **v3** | Tokenizer extension measured: +8,192 Cyrillic merges give ×1.49 more Russian characters per token, +16,384 give ×1.63. `model_ext` (73,728 rows, child-mean init) is built; needs a 100–200 M token CPT to pay for itself | measured, CPT pending |
|
| 250 |
+
| **v4** | Quantised builds for devices: GGUF Q8_0 / Q4_K_M and MNN INT4 shipped; phone-side tok/s still open | desktop done, phone pending |
|
| 251 |
|
| 252 |
## Releases
|
| 253 |
|
| 254 |
| Date | Version | What changed |
|
| 255 |
|---|---|---|
|
| 256 |
| 2026-11-10 | **v1.0** | 1.2 B-token continued pretraining released: bf16 weights, GGUF Q8_0 and Q4_K_M, measured ru/en/zh bits-per-char |
|
| 257 |
+
| 2026-11-11 | v1.1 | MNN INT4 build for the MNN runtime: 165 MB, ~77 tok/s decode on 12 CPU threads |
|
| 258 |
| 2026-11-10 | v2.0 (sister) | Assistant checkpoint released: 50 M-token SFT on top of v1, weights and GGUF |
|
| 259 |
|
| 260 |
## Licence and attribution
|