Model reference · open weights

MNN-Pocket-0.3B

LLMs taobao-mnn Text gen 1 build Open weights 527 dl/mo

MNN-Pocket-0.3B is an open-weight language model from taobao-mnn. MNN-Pocket-0.3B (BF16) weighs 723 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • MNN-Pocket-0.3B is a compact, instruction-tuned language model developed by taobao-mnn for on-device text generation.
  • It features 362M parameters and supports a context length of 40960 tokens.
  • The model is designed for English and Chinese tasks and is released under the Apache 2.0 license.

Summary of the taobao-mnn/MNN-Pocket-0.3B model card, 2026-11-07

What it is

Released bytaobao-mnn
Released2026-09-23
Parameters362M
VRAM723 MB for the weights

What it runs on

Memory and cards for MNN-Pocket-0.3B (BF16)

723 MBweights, file size
14 MBcache per 1K tokens
532 MBruntime overhead, at least
40,960 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB8822all 40K11.6 GB
RTX 4060 Ti 16 GB12030all 40K15.4 GB
RTX 3090 24 GB18847all 40K23.4 GB
RTX 4090 24 GB18847all 40K23.4 GB
RTX 5090 32 GB25363all 40K31.0 GB
L40S 48 GB36390all 40K44.0 GB
A100 80 GB655163all 40K78.2 GB
H100 80 GB629157all 40K78.1 GB
RTX PRO 6000 Blackwell 96 GB762190all 40K93.8 GB
DGX Spark (GB10) 128 GB unified878219all 40K107 GB
H200 141 GB1000+284all 40K138 GB
B200 180 GB1000+365all 40K176 GB
Memory needed at each load
Requests at once8K tokens each32K tokens each
11.4 GB1.7 GB
51.8 GB3.6 GB
82.2 GB5.0 GB
163.1 GB8.8 GB
325.0 GB16.3 GB
648.8 GB31.3 GB

One card, with vLLM's small-card settings.

From the model card

What taobao-mnn says about MNN-Pocket-0.3B

Read the model card

English |

MNN-Pocket-0.3B

MNN-Pocket is a family of compact language models co-designed with the MNN inference stack for on-device deployment. MNN-Pocket-0.3B is the general-purpose, instruction-tuned member of the family.

  • Tiny footprint: ~300M parameters; the INT4 (W4A16) QAT MNN build occupies only 173 MB.
  • Fast edge inference: up to 466 tokens/s decode on iPad Pro M5 (Metal), above the 200 tok/s real-time target.
  • Context length: up to 32K tokens.
  • Balanced bilingual capability: best average (50.00) across 11 zh/en benchmarks among ~300M models, surpassing several ~500M baselines.

Demo

Your browser does not support the video tag.

Model Details

ModelParametersDescription
MNN-Pocket-0.3B-Base300MPre-trained base model for fine-tuning
MNN-Pocket-0.3B-SFT300MSupervised fine-tuning (SFT) checkpoint, intermediate stage for research and ablation
MNN-Pocket-0.3B300MGeneral-purpose instruction-tuned model
MNN-Pocket-0.3B-GGUF300MGGUF for llama.cpp: F16 / Q8_0 from the BF16 checkpoint, Q4_1 from the QAT checkpoint
MNN-Pocket-0.3B-MNN300MINT4 (W4A16) QAT MNN build for on-device deployment
MNN-Pocket-0.3B-Dec300MNon-autoregressive decision model: LoRA adapter + pointer head, answers every question in one forward pass

Architecture:

  • Parameters: ~300M
  • Layers: 28
  • Hidden size: 896
  • Attention: 14 heads, GQA with 2 KV heads, head_dim 64
  • FFN intermediate: 2560 (SiLU)
  • Context: 40,960 positions (32K supported in deployment)
  • Vocabulary: 65,536
  • Embeddings: tied input/output
  • Precision: bfloat16 native; INT4 W4A16 (MNN build)
  • Languages: Chinese, English

MNN-Pocket-0.3B is intended for on-device assistants, data extraction, and lightweight agentic pipelines. Like other sub-billion-parameter models, it is not recommended for reasoning-heavy workloads such as advanced mathematics or long-horizon code generation.

Chat Template

MNN-Pocket uses a ChatML-style conversation format. The exact template (including the im_start / im_end control tokens) ships in this repo as chat_template.jinja; prefer tokenizer.apply_chat_template() so formatting stays correct automatically. Schematic:

[IM_START]system
You are a helpful assistant.[IM_END]
[IM_START]user
Hello![IM_END]
[IM_START]assistant
from transformers import AutoTokenizer
tok = AutoTokenizer.from_pretrained("taobao-mnn/MNN-Pocket-0.3B")
text = tok.apply_chat_template(
    [{"role": "system", "content": "You are a helpful assistant."},
     {"role": "user", "content": "Hello!"}],
    add_generation_prompt=True, tokenize=False)

Inference

MNN-Pocket is optimized for the MNN runtime but also runs in Transformers and llama.cpp.

On-device with MNN: the INT4 (W4A16, block 64) QAT build is published as MNN-Pocket-0.3B-MNN.

For other precisions, export from the safetensors in this repo with llmexport:

# Download the MNN source
git clone https://github.com/alibaba/MNN.git

# Export to MNN (INT4, block 64)
cd MNN/transformers/llm/export
python llmexport.py --path /path/to/MNN-Pocket-0.3B --export mnn --quant_bit 4 --quant_block 64

Build flags, config.json options and llmexport parameters are in the MNN-LLM doc.

With the MNN weights in hand — the published INT4 build or your own export — build the runtime and run it:

# Download the MNN source (only needed if you have not cloned it yet)
git clone https://github.com/alibaba/MNN.git

# Build
cd MNN
mkdir build && cd build
cmake .. -DMNN_LOW_MEMORY=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true
make -j

# Run
./llm_demo /path/to/MNN-Pocket-0.3B-MNN/config.json prompt.txt

Transformers:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "taobao-mnn/MNN-Pocket-0.3B"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", dtype="bfloat16")
tokenizer = AutoTokenizer.from_pretrained(model_id)

messages = [{"role": "user", "content": "What is MNN?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True,
                                       return_tensors="pt", tokenize=True, return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True,
                         temperature=0.8, top_p=0.8, top_k=20)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

llama.cpp: see MNN-Pocket-0.3B-GGUF.

Performance

Post-trained MNN-Pocket-0.3B vs. same-size and larger open models (higher is better). Full protocol in the tech report.

BenchmarkMNN-Pocket-0.3B-INT4Gemma-3-270MERNIE-4.5-0.3BLFM2.5-350MSmolLM2-360MHunyuan-0.5BMiniCPM4-0.5BQwen3-0.6B
Average50.0049.596.4231.9931.2818.4331.2246.8144.28
C-Eval38.8640.276.8432.1732.1023.7735.2967.9844.06
CMMLU40.1139.654.9433.9131.65

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms