How to use from
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:
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:
Run Hermes
hermes
Quick Links

MNN-Pocket-0.3B-RU — a Russian continuation model on a 0.3B base

params tokens context gguf license status

Status: v1.2 in this repository since 2026-11-29. The weights are the v1 ones — the refresh covered the publication, not the model: both RoPE fields in config.json, a complete MNN INT4 folder, Q4_1 in gguf/, and the measurements behind the tables below under review/.

A continued-pretraining run of taobao-mnn/MNN-Pocket-0.3B-Base that teaches it Russian while keeping English and Chinese readable. The keyboard is the use case that set the size and latency budget.

It is trained as a plain causal LM on raw text, so it continues a typed prefix instead of answering it. For dialogue there is a separate checkpoint — Rahspide/MNN-Pocket-0.3B-RU-Chat.

  • 303 M parameters, Qwen3 architecture, 40 960 positions of context.
  • 1.2 B tokens of training text: 0.9 B Russian, 0.204 B English, 0.096 B Chinese.
  • 208–309 MB quantised builds, plus a 167 MB INT4 build for the MNN runtime.
  • 88 tok/s generation for Q4_K_M on a 16-thread x86 CPU, 47 tok/s on a 4-vCPU server.

Two models, two jobs

One base, two jobs

This model — MNN-Pocket-0.3B-RU v1.2 Sister — MNN-Pocket-0.3B-RU-Chat v2.0
Job continue text follow instructions
Input a prefix, often mid-sentence a system + user message
Output the plausible continuation an answer
Trained with continued pretraining, 1.2 B tokens of raw text instruction tuning on top of this model, 12.2 M tokens, rebuilt recipe
Choose it for keyboard suggestions, autocomplete, prefix completion chat, Q&A, short rewrites
Do not choose it for assistant behaviour: it continues your question instead of answering autocomplete: it answers instead of continuing

The two tasks reward opposite behaviour. Trained on both jobs, one checkpoint does each badly: it answers when it should continue, and continues when it should answer.

Model details

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
Layers 28
Hidden size 896
Attention 14 heads, GQA with 2 KV heads, head_dim 64
FFN intermediate 2560 (SiLU)
Context 40 960 positions
Tokenizer 65,536 tokens, byte-level BPE, `<
Embeddings tied input/output
Precision bfloat16 weights; the MNN build is INT4 (W4A16, block 64)
Languages Russian, English, Chinese
Training tokens 1.2 B — 0.9 B ru + 0.204 B en + 0.096 B zh
Method full fine-tune, 1 epoch, no LoRA

Results

Bits per character: base vs v1

100 k held-out tokens per language, identical settings for both checkpoints:

Lang ppl base → v1 bits/char base → v1 top-1 base → v1 top-5 base → v1
ru 10.42 → 5.05 1.625 → 1.123 (−31%) 46.2% → 61.0% 69.3% → 80.6%
en 21.85 → 41.16 1.016 → 1.225 (+21%) 39.9% → 35.5% 64.1% → 58.7%
zh 23.95 → 51.86 3.274 → 4.071 (+24%) 41.9% → 37.7% 62.0% → 55.6%

The published weights were re-downloaded and re-evaluated independently (CPU, fp32, 20 k tokens per language) and reproduce the same ordering: ru 1.022 against base 1.519, en 1.337 against 1.124, zh 4.054 against 3.393. The raw numbers are in review/: review/metrics_base.json and review/metrics_final.json for the table above, review/eval_base.json and review/eval_model_v1.json for the re-download.

The Russian measurement is also on record in machine-readable form: review/bytes_v1.json against the base in review/bytes_base.json: 0.557 against 0.878 bits per byte on a fixed 200 000-character Russian corpus, published as review/val_ru_200k.txt. Both records pin the SHA-256 of the published weights, so they double as a checksum for model.safetensors.

Russian landed past the target (1.123 against a 1.40 gate). English and Chinese regressed 21–24% instead of the ≤10% the mix aimed for: a 25% English replay is too thin at 0.30 B when the target language is tokenised this badly. Treat v1 as Russian-first, with working but measurably weaker English and Chinese.

The base vocabulary is itself a pruned set: the technical report describes cutting Qwen3's ~151 k tokens down to ~64 k by frequency while keeping BPE dependencies and byte fallback. Poor Cyrillic coverage is what that pruning cost.

Why the tokenizer matters

Russian characters per token, base vs extended vocabulary

The base vocabulary is a distilled 65 k set with almost no Cyrillic merges, and it is byte-level: the vocabulary stores UTF-8 bytes remapped to latin-1, so convert_ids_to_tokens prints С where the text says С. That is a display artifact; decode returns the word. The count is what matters:

Word Characters Tokens Pieces
Спасибо 7 6 С · п · ас · и · б · о
привет 6 3 пр · ив · ет
покупать 8 4 п · ок · уп · ать
Ёжик 4 4 Ё lands in two separate byte tokens

Because the vocabulary is byte-level, a token can end in the middle of a character: in Ёжик and ЩУКА the uppercase letters are cut into single bytes. Decoding the whole sequence is still exact, but a streaming client must hold an incomplete UTF-8 sequence back instead of printing it. llama.cpp and transformers buffer it for you; a hand-rolled decoder has to do the same or the output shows replacement characters.

Tokenizer RU chars/token RU tokens per word EN chars/token
MNN-Pocket / Qwen3-distilled (65,536) 1.75–1.85 (2.08 on dialogue text) ≈3.3 3.78
+8,192 Cyrillic merges (73,728) 3.10 ≈1.8 —
+16,384 Cyrillic merges (81,920) 3.39 ≈1.6 —
ruGPT3-small (50 k, Russian BPE) 4.2 ≈1.3 —

Consequences that shaped the plan:

  • the same 1.2 B-token budget buys 2.2 B Russian characters (340 M words), roughly 2.2× less text than a Russian-native tokenizer would fit;
  • on a phone one suggested Russian word costs ~3 decode steps instead of ~1, which matters for a keyboard latency budget;
  • the vocabulary stays as the base has it, so the weights drop into the existing MNN / GGUF toolchain unchanged. An extended vocabulary with Cyrillic merges would cut decode steps by ~1.5–1.6×, but the weights would no longer be interchangeable with the base.

Data

All sources are public Hugging Face datasets.

Language Dataset Config Tokens
ru HuggingFaceFW/fineweb-2 rus_Cyrl 0.90 B
en HuggingFaceFW/fineweb sample-100BT 0.204 B
zh HuggingFaceFW/fineweb-2 cmn_Hani 0.096 B

Licences: FineWeb / FineWeb-2 are ODC-BY 1.0. No scraped Telegram dumps or other unlicensed chat corpora were used, so the resulting weights stay publishable.

Builds

GGUF sizes

Build Size Download Note
Q8_0 309 MB gguf/MNN-Pocket-0.3B-RU-Q8_0.gguf near-lossless, for desktop
Q4_K_M 223 MB gguf/MNN-Pocket-0.3B-RU-Q4_K_M.gguf the size to ship on a phone
Q4_1 208 MB gguf/MNN-Pocket-0.3B-RU-Q4_1.gguf smallest GGUF
MNN INT4 167 MB mnn/MNN-Pocket-0.3B-RU-INT4 MNN runtime, Android

All three files sit under gguf/ with the quant tag in the name, which is what llama.cpp matches on:

llama-cli -hf Rahspide/MNN-Pocket-0.3B-RU:Q4_K_M -p "Сегодня я" -n 40

Converted with llama.cpp convert_hf_to_gguf.py (f16) and quantised with llama-quantize. Measured with llama-bench on the published files, 9 repetitions, prompt 512 and generation 128 tokens.

On a 16-thread x86 CPU (Ryzen 7 7735HS, 8 cores):

Build Prompt processing Generation
Q4_K_M 472 ± 100 tok/s 88 ± 15 tok/s
Q4_1 435 ± 60 tok/s 87 ± 26 tok/s
Q8_0 742 ± 111 tok/s 62 ± 18 tok/s

On a 4-vCPU server CPU (Intel Xeon, 2.2 GHz):

Build Prompt processing Generation
Q4_K_M 116 ± 3.4 tok/s 47 ± 0.9 tok/s
Q4_1 73 ± 0.3 tok/s 49 ± 1.2 tok/s
Q8_0 143 ± 1.8 tok/s 52 ± 1.4 tok/s

Phone figures will be several times lower. Treat the desktop numbers as indicative: the host is shared, and a second run of the same files with the same binary, under other load on that host, came out up to a third lower on prompt speed and about 15 % lower on decode. The server numbers are stable inside one instance (σ 1–3 %), but a different instance measured about 20 % higher on prompt speed. With one binary on both machines, the desktop CPU was 3.2–4.7× the server on prompt processing. Raw output: review/llama_bench.log, review/llama_bench_cpu.log, review/llama_bench_same_bin_nipogi.log and review/llama_bench_same_bin_kaggle.log.

The MNN build runs through MNN's own runtime. Runtime sources: alibaba/MNN, the LLM export and inference guide, and the official Android app apps/Android/MnnLlmChat. Build llm_demo from MNN 3.6.2 or newer with -DMNN_BUILD_LLM=ON, then point it at the folder. MNN 3.6.0 and 3.5 cannot load this export format and crash at load — it uses op types that appeared after 3.6.0 (FusedLinear, RoPE):

cd mnn/MNN-Pocket-0.3B-RU-INT4 && llm_demo config.json prompt.txt

MNN INT4: prefill and decode

167 MB on disk, the weights load in ~1.1 s. The raw logs are in review/mnn_int4_run.log (CPU, MNN 3.6.2 wheel) and review/mnn_int4_gpu_run.log (CPU and CUDA from one build). llm_config.json carries no chat template on purpose: this checkpoint continues the prompt, so the runtime should not wrap it in a dialogue format.

Device Backend Prefill (tok/s) Decode (tok/s)
4-vCPU server CPU 191 54
T4 GPU CUDA 3553 175
OnePlus 13 (CPH2649, Snapdragon 8 Elite) CPU, 4 threads 470 171
OnePlus 13 (CPH2649, Snapdragon 8 Elite) OpenCL, Adreno 346 73
iPhone, iPad Metal not measured not measured
On the OnePlus 13 the numbers come from llm_demo built from MNN 3.6.2 for Android arm64, three runs each, median
(the first OpenCL run compiles the kernels and is left out). The MNN Chat app on Play bundles MNN 3.5.0 and cannot
load this build — it crashes while loading — see
review/mnn_int4_android_app_crash.txt.

The GPU row was measured on MNN master (27.11.2026) with -DMNN_CUDA=ON; on CUDA 13 the build needs the sm_60..sm_72 gencode lines removed and the SOFTMAX kernel templates moved into their header, both required to build MNN against CUDA 13. Two caveats. MNN's CUDA backend has no RoPE kernel, so FusedRoPE runs on the CPU on all 28 layers. And the GPU path is not token-identical to the CPU path: on three of four fixed prompts the greedy token sequences diverge while the lengths match, because float16 argmax ties resolve differently. Use the CPU build when you need bit-identical output.

On iPhone

Two paths, both take the published files as they are.

  • MNN INT4, 167 MB — the official MNN iOS app (apps/iOS/MNNLLMChat) reads a model folder directly. Build MNN.framework with package_scripts/ios/buildiOS.sh and -DMNN_BUILD_LLM=ON -DMNN_METAL=ON, open MNNLLMiOS.xcodeproj in Xcode, sign it, run on the device and point the app at the mnn/MNN-Pocket-0.3B-RU-INT4 folder. Use MNN 3.6.2 or newer — 3.6.0 and 3.5 cannot load this export format. The app is meant for models up to 7B, so a 0.3 B INT4 checkpoint is well inside its range.
  • GGUF, 208–309 MB — llama.cpp's iOS sample (examples/llama.swiftui): run ./build-xcframework.sh, open the project in Xcode, run on the device and add the .gguf file.

Neither path has been measured on Apple hardware here, so the table above says not measured rather than guessing a number.

config.json carries both rope_parameters (transformers 5.x) and the legacy rope_theta (transformers 4.x), so the weights load with the same theta on either version.

Two conversion quirks, both already fixed in this repository's tokenizer_config.json.

  • the base pre-tokenizer does not hash-match in current llama.cpp, so the Qwen pre-tokenizer has to be pinned by hand (qwen2);
  • extra_special_tokens must not be a list, or transformers v4 refuses to load the tokenizer.

Reproduce

Everything below runs on CPU. The numbers in this card came from these paths.

# bits/char, ppl and top-k against the base, 20k tokens per language
python bench/eval_bpc.py --model Rahspide/MNN-Pocket-0.3B-RU --base taobao-mnn/MNN-Pocket-0.3B-Base \
    --dataset HuggingFaceFW/fineweb-2 --config rus_Cyrl --tokens 20000

# throughput and a smoke generation on the quantised build
LLAMA_CLI=/path/to/llama-cli bash bench/bench_cpu.sh gguf/MNN-Pocket-0.3B-RU-Q4_K_M.gguf

bench/eval_bpc.py reports the same three metrics as the tables above (ppl, bits/char, top-1/top-5) and exits non-zero when the model loses more than a given --max-bpc-regression against the base, so it can run as a regression gate in CI. bench/bench_cpu.sh prints prompt and generation tok/s and checks that generation stops at <|endoftext|>.

Intended use

  • On-device next-word and short-phrase suggestion in a keyboard or IME, Russian first, English and Chinese from the same checkpoint (a keyboard can pick the language from the current word or the layout).
  • Text completion, prefix continuation and autocomplete for Russian anywhere a ~220 MB quantised model has to run locally: chat composers, note apps, search fields, terminal prompts.
  • Any pipeline that needs a small causal LM fluent in Russian that can still read English and Chinese, for example tagging, short rewriting suggestions, or generating Russian seed text.

Not intended for: instruction following, factual question answering, code, long-form reasoning, or translation. This is a 0.30 B model trained for 1.2 B tokens; its knowledge is narrow by construction. The language mix is a deliberate trade: Russian is the target, English and Chinese are kept from degrading, neither is improved.

Limitations

  • Russian is tokenised near character level (see above): slower decoding and a larger effective cost per Russian word than the same model pays for English.
  • Token boundaries do not follow character boundaries. Rare and uppercase Cyrillic letters are split into single bytes, so a streaming decoder must buffer partial UTF-8 sequences; llama.cpp and transformers already do this.
  • Web text only. Register is mostly written/informal blog Russian; no dialogue corpora, no post-training.
  • Capacity is 0.30 B (302.8 M parameters). Expect weak facts, weak arithmetic, and drift on long generations.
  • English and Chinese regressed 21–24% against the base. The 25% replay mix limits the damage; it does not remove it.
  • The ChatML template from the base is inherited but untrained here. Do not use this checkpoint in chat mode.

Releases

Date Version What changed
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
2026-11-11 v1.1 MNN INT4 build for the MNN runtime: 167 MB
2026-11-25 v2.0 (sister) Assistant checkpoint updated in place: rebuilt recipe, 12.2 M-token SFT on top of this model; the previous weights stay on the v1 branch of the assistant repository
2026-11-29 v1.2 Publication refreshed: config.json now carries both RoPE fields, the MNN INT4 folder is complete (llm.mnn.json, export_args.json), Q4_1 added to gguf/, measurement artefacts published under review/, throughput re-measured on the published files. Weights unchanged; the earlier card and file set stay on the v1 branch of this repository

Licence and attribution

Weights: Apache-2.0, inherited from the base model. Data: ODC-BY 1.0 (FineWeb, FineWeb-2). If you use this model, credit the base release:

@misc{mnn_pocket_03b,
  title  = {MNN-Pocket-0.3B},
  author = {Taobao MNN team},
  year   = {2026},
  url    = {https://huggingface.co/taobao-mnn/MNN-Pocket-0.3B}
}
Downloads last month
7,876
Safetensors
Model size
0.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Rahspide/MNN-Pocket-0.3B-RU

Quantized
(1)
this model
Quantizations
2 models

Datasets used to train Rahspide/MNN-Pocket-0.3B-RU

Paper for Rahspide/MNN-Pocket-0.3B-RU