Instructions to use tinyopsec/Nanbeige4.2-3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tinyopsec/Nanbeige4.2-3B-GGUF 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 tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use tinyopsec/Nanbeige4.2-3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tinyopsec/Nanbeige4.2-3B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tinyopsec/Nanbeige4.2-3B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
- Ollama
How to use tinyopsec/Nanbeige4.2-3B-GGUF with Ollama:
ollama run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use tinyopsec/Nanbeige4.2-3B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tinyopsec/Nanbeige4.2-3B-GGUF: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": "tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use tinyopsec/Nanbeige4.2-3B-GGUF with Docker Model Runner:
docker model run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
- Lemonade
How to use tinyopsec/Nanbeige4.2-3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Nanbeige4.2-3B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use tinyopsec/Nanbeige4.2-3B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tinyopsec/Nanbeige4.2-3B-GGUF: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 tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use tinyopsec/Nanbeige4.2-3B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tinyopsec/Nanbeige4.2-3B-GGUF: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 "tinyopsec/Nanbeige4.2-3B-GGUF: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"
Nanbeige4.2-3B — GGUF Quantizations
Community-provided GGUF quantizations of Nanbeige/Nanbeige4.2-3B, a compact agentic LLM developed by Nanbeige LLM Lab.
All weight files were converted from the original BF16 SafeTensors checkpoint using the Nanbeige fork of llama.cpp (-b nanbeige42). No fine-tuning or architectural changes were applied.
Model Overview
| Property | Value |
|---|---|
| Base model | Nanbeige/Nanbeige4.2-3B |
| Architecture | Looped Transformer (nanbeige) |
| Total parameters | 4B |
| Non-embedding parameters | 3B |
| Context length | 262,144 tokens (256K) |
| Languages | English, Chinese |
| Format | GGUF |
| Original license | Apache 2.0 |
| Technical report | arXiv:2607.22083 |
Nanbeige4.2-3B is a supervised fine-tuned + RL-trained agentic model built on Nanbeige4.2-3B-Base. Its Looped Transformer architecture reuses transformer layers to increase effective model capacity without increasing parameter count. At 3B non-embedding parameters it outperforms models such as Qwen3.5-9B and Gemma4-12B on several agentic and reasoning benchmarks.
Available Quantizations
| Quantization | File size | Notes |
|---|---|---|
Q2_K |
1.76 GB | Minimum footprint; noticeable quality loss |
Q3_K_S |
2.00 GB | Small 3-bit; good for very constrained memory |
Q3_K_M |
2.17 GB | Medium 3-bit; better quality than S |
Q4_0 |
2.48 GB | Legacy 4-bit; lower quality than K-quants |
Q4_K_S |
2.50 GB | Small 4-bit K-quant |
Q4_K_M |
2.57 GB | Recommended default — best quality/size ratio |
Q5_K_S |
2.94 GB | Small 5-bit K-quant |
Q5_K_M |
2.99 GB | Medium 5-bit; high quality with modest size |
Q6_K |
3.42 GB | Near-lossless; use when RAM allows |
Q8_0 |
4.43 GB | Minimal precision loss; reference quality |
F16 |
8.34 GB | Full half-precision; for benchmarking only |
Recommendation:
Q4_K_Mis the best starting point for most deployments. UseQ6_KorQ8_0if you have sufficient RAM and need maximum fidelity.
Quickstart
llama.cpp
Install (macOS / Linux)
curl -LsSf https://llama.app/install.sh | sh
Install (Windows via WinGet)
winget install llama.cpp
Run a local OpenAI-compatible server
llama serve -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Run inference in the terminal
llama cli -hf tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Ollama
ollama run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
Docker
docker model run hf.co/tinyopsec/Nanbeige4.2-3B-GGUF:Q4_K_M
LM Studio
Download any GGUF file from the Files tab and open it directly in LM Studio.
Note: The bundled llama.cpp inside LM Studio does not yet support the
nanbeigearchitecture. You must replace the LM Studio backend binaries with the Nanbeige fork:
- Build llama.cpp from the
nanbeige42branch- Copy
build/bin/*into your LM Studio backend directory (e.g.~/.lmstudio/extensions/backends/llama.cpp-<version>)
Inference Parameters
The following settings are recommended by the original authors:
| Scenario | Temperature | Max new tokens |
|---|---|---|
| Agentic / tool-use tasks | 1.0 | 65,536 |
| Reasoning / chat tasks | 0.6 | 131,072 |
The chat template exposes two configuration flags:
enable_thinking— enables chain-of-thought reasoning (on by default; set tofalsefor non-thinking mode)preserve_thinking— controls whether reasoning tokens from previous turns are retained in multi-turn conversations (recommendedtruefor tool-use and code-agent workflows;falsefor general chat)
For tool-calling, tool_call_format="xml" yields the best performance; json is supported for compatibility.
Benchmark Summary
Results reported by the original authors (thinking mode, preserve_thinking=true):
| Benchmark | Nanbeige4.2-3B | Qwen3.5-9B | Qwen3.5-4B | Gemma4-12B |
|---|---|---|---|---|
| SWE-Bench Verified | 63.6 | 53.1 | 38.8 | 44.2 |
| SWE-Bench Pro | 46.9 | 33.8 | 29.4 | 21.9 |
| GPQA-Diamond | 87.4 | 81.7 | 78.2 | 78.8 |
| HMMT-Feb-2026 | 82.8 | 69.6 | 60.6 | 51.5 |
| LiveCodeBench-V6 | 72.5 | 65.6 | 55.8 | 72.0 |
| HLE (w/o Search) | 17.8 | 12.5 | 6.8 | 14.8 |
| Claw-Evalpass | 52.2 | 47.1 | 36.9 | 25.5 |
| GDPval rubrics | 74.3 | 61.9 | 46.7 | 68.5 |
Full benchmark tables and methodology are available in the original model card and technical report.
Conversion Notes
GGUF files were produced using the Nanbeige fork of llama.cpp. The standard upstream llama.cpp (ggerganov/llama.cpp) does not support the nanbeige architecture at the time of publication; use the forked build for any operations that require re-quantizing or converting these files.
# Clone the Nanbeige fork
git clone -b nanbeige42 https://github.com/Nanbeige/llama.cpp.git
cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j
# BF16 → GGUF (reference step)
python3 convert_hf_to_gguf.py /path/to/Nanbeige4.2-3B \
--outfile Nanbeige4.2-3B-BF16.gguf \
--outtype bf16
# Re-quantize to Q4_K_M
./build/bin/llama-quantize \
Nanbeige4.2-3B-BF16.gguf \
Nanbeige4.2-3B-Q4_K_M.gguf \
Q4_K_M
Limitations
As noted by the original authors: the model may produce inaccurate, biased, or otherwise inappropriate outputs due to its probabilistic nature. These GGUF files are unmodified quantizations of the original checkpoint and inherit all limitations documented in the original model card.
License
The original model weights are released under the Apache 2.0 license by Nanbeige LLM Lab. This repository provides only format-converted quantizations. The Apache 2.0 license terms apply; see LICENSE in the original repository.
Citation
If you use this model, please cite the original work:
@article{lab2026nanbeige4,
title={Nanbeige4.2-3B: Unlocking Agentic Capabilities in a Compact Model},
author={Lab, Nanbeige and Yang, Chen and Huang, Chengrui and Lan, Fufeng and others},
journal={arXiv preprint arXiv:2607.22083},
year={2026}
}
Links
- Downloads last month
- 398
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit