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:9931/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:9931/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:9931/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: Q4_1 build, MNN sources, corrected parameter count
Browse files
README.md
CHANGED
|
@@ -23,7 +23,7 @@ tags:
|
|
| 23 |
|
| 24 |

|
| 25 |
|
| 26 |
-

|
| 28 |
-6FA8FF?style=flat-square)
|
| 29 |

|
|
@@ -61,7 +61,7 @@ it should continue, and continues when it should answer.
|
|
| 61 |
|
| 62 |
| | |
|
| 63 |
|---|---|
|
| 64 |
-
| Base | `taobao-mnn/MNN-Pocket-0.3B-Base` (Qwen3 architecture
|
| 65 |
| Tokenizer | 65,536 tokens, byte-level BPE, `<|endoftext|>` = 65510 |
|
| 66 |
| Training tokens | 1.2 B — 0.9 B ru + 0.204 B en + 0.096 B zh |
|
| 67 |
| Method | full fine-tune, 1 epoch, no LoRA |
|
|
@@ -91,6 +91,10 @@ was started, got through ~50 M of a planned 200 M tokens, and changed nothing me
|
|
| 91 |
(1.337 → 1.337 on the same eval), so it is **not** published. Treat v1 as Russian-first, with working but
|
| 92 |
measurably weaker English and Chinese.
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
## Why the tokenizer shapes the recipe
|
| 95 |
|
| 96 |

|
|
@@ -160,6 +164,7 @@ used, so the resulting weights stay publishable.
|
|
| 160 |
|---|---|---|---|
|
| 161 |
| 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 |
|
| 162 |
| 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 |
|
|
|
|
| 163 |
| 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 |
|
| 164 |
|
| 165 |
Both files sit under `gguf/` with the quant tag in the name, which is what llama.cpp matches on:
|
|
@@ -176,9 +181,10 @@ Converted with llama.cpp `convert_hf_to_gguf.py` (f16) and quantised with `llama
|
|
| 176 |
| Q4_K_M | ~410 tok/s | **~130 tok/s** |
|
| 177 |
| Q8_0 | ~525 tok/s | ~99 tok/s |
|
| 178 |
|
| 179 |
-
Phone figures will be several times lower; these are desktop-CPU numbers.
|
|
|
|
| 180 |
|
| 181 |
-
The MNN build runs through MNN's own runtime. Build `llm_demo` from the MNN repository with
|
| 182 |
`-DMNN_BUILD_LLM=ON`, then point it at the folder:
|
| 183 |
|
| 184 |
```bash
|
|
|
|
| 23 |
|
| 24 |

|
| 25 |
|
| 26 |
+

|
| 27 |

|
| 28 |
-6FA8FF?style=flat-square)
|
| 29 |

|
|
|
|
| 61 |
|
| 62 |
| | |
|
| 63 |
|---|---|
|
| 64 |
+
| Base | `taobao-mnn/MNN-Pocket-0.3B-Base` (Qwen3 architecture). 302.8 M unique parameters here: 58.7 M embeddings + 244.1 M others. The base file lists 361.5 M because it stores `lm_head` as a separate copy of the tied matrix |
|
| 65 |
| Tokenizer | 65,536 tokens, byte-level BPE, `<|endoftext|>` = 65510 |
|
| 66 |
| Training tokens | 1.2 B — 0.9 B ru + 0.204 B en + 0.096 B zh |
|
| 67 |
| Method | full fine-tune, 1 epoch, no LoRA |
|
|
|
|
| 91 |
(1.337 → 1.337 on the same eval), so it is **not** published. Treat v1 as Russian-first, with working but
|
| 92 |
measurably weaker English and Chinese.
|
| 93 |
|
| 94 |
+
The base vocabulary is itself a pruned set: the [technical report](https://arxiv.org/abs/2611.12311) describes cutting
|
| 95 |
+
Qwen3's ~151 k tokens down to ~64 k by frequency while keeping BPE dependencies and byte fallback. Poor Cyrillic
|
| 96 |
+
coverage is what that pruning cost.
|
| 97 |
+
|
| 98 |
## Why the tokenizer shapes the recipe
|
| 99 |
|
| 100 |

|
|
|
|
| 164 |
|---|---|---|---|
|
| 165 |
| 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 |
|
| 166 |
| 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 |
|
| 167 |
+
| Q4_1 | 208 MB | [`MNN-Pocket-0.3B-RU-Q4_1.gguf`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU-GGUF/blob/main/MNN-Pocket-0.3B-RU-Q4_1.gguf) | fastest generation on CPU |
|
| 168 |
| 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 |
|
| 169 |
|
| 170 |
Both files sit under `gguf/` with the quant tag in the name, which is what llama.cpp matches on:
|
|
|
|
| 181 |
| Q4_K_M | ~410 tok/s | **~130 tok/s** |
|
| 182 |
| Q8_0 | ~525 tok/s | ~99 tok/s |
|
| 183 |
|
| 184 |
+
Phone figures will be several times lower; these are desktop-CPU numbers. Measured back to back on the same
|
| 185 |
+
machine, Q4_1 generates 62.6 tok/s against 54.3 for Q4_K_M, but processes prompts slower (199 vs 251 tok/s).
|
| 186 |
|
| 187 |
+
The MNN build runs through MNN's own runtime. Runtime sources: [alibaba/MNN](https://github.com/alibaba/MNN), the [LLM export and inference guide](https://github.com/alibaba/MNN/blob/master/transformers/README.md), and the official Android app [`apps/Android/MnnLlmChat`](https://github.com/alibaba/MNN/tree/master/apps/Android/MnnLlmChat). Build `llm_demo` from the MNN repository with
|
| 188 |
`-DMNN_BUILD_LLM=ON`, then point it at the folder:
|
| 189 |
|
| 190 |
```bash
|