Model reference · open weights
Nanbeige4.2 is an open-weight language model from Nanbeige. Nanbeige4.2-3B (BF16) weighs 8.3 GB; 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.
Summary of the Nanbeige/Nanbeige4.2-3B model card, 2026-10-01
What it is
| Released by | Nanbeige |
|---|---|
| Released | 2026-07-21 |
| Parameters | 4.2B |
| VRAM | 8.3 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 3 | 27K | 11.6 GB | |
| RTX 4060 Ti 16 GB | 8 | 2 | 68K | 15.4 GB |
| RTX 3090 24 GB | 19 | 4 | 155K | 23.4 GB |
| RTX 4090 24 GB | 19 | 4 | 154K | 23.4 GB |
| RTX 5090 32 GB | 29 | 7 | 237K | 31.0 GB |
| L40S 48 GB | 47 | 11 | all 256K | 44.0 GB |
| A100 80 GB | 93 | 23 | all 256K | 78.2 GB |
| H100 80 GB | 87 | 21 | all 256K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 108 | 27 | all 256K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 127 | 31 | all 256K | 107 GB |
| H200 141 GB | 168 | 42 | all 256K | 138 GB |
| B200 180 GB | 219 | 54 | all 256K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 18 | 4 | 145K | 11.6 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 9.8 GB | 12.0 GB |
| 5 | 12.8 GB | 23.8 GB |
| 8 | 15.0 GB | 32.7 GB |
| 16 | 20.9 GB | 56.3 GB |
| 32 | 32.7 GB | 104 GB |
| 64 | 56.3 GB | 198 GB |
One card, with vLLM's small-card settings.
From the model card
Nanbeige4.2-3B is a compact agentic model built on Nanbeige4.2-3B-Base, designed to combine strong agentic behavior with broad reasoning and alignment capabilities. Its Looped Transformer architecture reuses the transformer layers to increase model capacity without adding parameters. With only 3B non-embedding parameters, the model delivers solid performance on general-agent and code-agent tasks.
During supervised fine-tuning (SFT), we expand the diversity of training environments through real-world environment integrations and large-scale environment synthesis. We further diversify task types, task assets, and the agentic scaffolds used for each task. To ensure training data quality, we apply filtering at both the trajectory and turn levels, combining test-case-based validation with rubric-based assessment. During reinforcement learning (RL), we combine outcome and process rewards to improve training stability for the compact model.
Key strengths include:
Solid Agentic Behavior at the 3B Scale: Across complex tool-use, office-agent, and code-agent benchmarks, Nanbeige4.2-3B outperforms larger models such as Qwen3.5-9B and Gemma4-12B.
Strong Reasoning Capabilities: Nanbeige4.2-3B leads open-source models of comparable size across mathematical, coding, and scientific reasoning tasks, continuing the strong reasoning performance of Nanbeige4.1-3B.
Local Personal Assistant: When integrated with an agentic scaffold designed for personal workflows (e.g., OpenClaw), Nanbeige4.2-3B can support extended tasks spanning daily assistance, office work, and deep research.
The accompanying
modeling_nanbeige.pyalso includes our latest architectural improvements, including LoopSplit, mHC with depth attention, and concatenated n-gram embeddings. These features have been incorporated into Nanbeige4.5, whose training is underway for release later in 2026.
We compare Nanbeige4.2-3B with Qwen3.5 and Gemma4 models across a diverse benchmark suite covering general agents, code agents, reasoning, and alignment capabilities.
The results demonstrate that Nanbeige4.2-3B delivers strong performance well beyond its parameter scale. With only 3B non-embedding parameters, it consistently outperforms larger models, including Qwen3.5-9B and Gemma4-12B, across general-agent, code-agent, and reasoning benchmarks, while remaining competitive on alignment tasks.
With only 3B non-embedding parameters, Nanbeige4.2-3B is compact enough for local deployment while retaining the agentic capabilities needed for multi-step workflows, making it a natural fit for local personal-assistant applications. To assess this use case in a practical and consistent agent environment, we use OpenClaw, a general-purpose framework that supports daily assistance, office workflows, and deep research tasks. All compared models use the same framework and are evaluated on tasks requiring multi-step interaction with tools and external resources.
Across all six benchmarks, Nanbeige4.2-3B outperforms both Qwen3.5-4B and the larger Qwen3.5-9B. These results support its use as a compact local personal assistant.
The tokenizer provides a configurable chat template for reasoning and tool-use scenarios:
enable_thinking controls whether the model generates reasoning for the current response. It is enabled by default; set it to False for non-thinking mode.preserve_thinking controls whether reasoning from previous assistant turns is retained in a multi-turn conversation. We recommend False for general chat and question answering, and True for multi-turn tool use, office tasks, and code-agent workflows.tools enables the tool-use template. We recommend tool_call_format="xml" for the best tool-calling performance; json is also supported for compatibility.The model supports a context length of up to 262,144 tokens (256K).
We recommend adjusting the inference settings according to the target scenario:
| Scenario | Temperature | Max New Tokens |
|---|---|---|
| Agentic and tool-use tasks | 1.0 | 65,536 |
| Reasoning and chat tasks | 0.6 | 131,072 |
Install the required version with pip install transformers==4.45.1.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Nanbeige/Nanbeige4.2-3B"
tokenizer = AutoTokenizer.from_pretrained(
model_id,
use_fast=False,
trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
messages = [
{"role": "user", "content": "Which number is bigger, 9.11 or 9.8?"}
]
prompt = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=False
)
input_ids = tokenizer(
prompt,
add_special_tokens=False,
return_tensors="pt"
).input_ids
output_ids = model.generate(
input_ids.to("cuda"),
max_new_tokens=131072,
temperature=0.6,
top_p=0.95,
top_k=20,
eos_token_id=166101
)
response = tokenizer.decode(
output_ids[0][len(input_ids[0]):],
skip_special_tokens=True
)
print(response)
# Clone repository
git clone -b nbg42 https://github.com/Nanbeige/sglang.git
cd sglang
pip install -e "python"
MODEL_PATH=/path/to/your/Nanbeige4.2-3B
python -m sglang.launch_server \
--model-path ${MODEL_PATH} \
--host 0.0.0.0 \
--port 8000 \
--tp-size 1 \
--mem-fraction-static 0.8 \
--reasoning-parser nanbeige \
--toolQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.