Downloads · 30 days
24
12% of all-time downloads
andrevp/Nanbeige4.1-3B-MLX-8bit
Nanbeige4.1-3B-MLX-8bit is a text generation model from andrevp. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
This is the Nanbeige4.1-3B model converted to MLX format with 8-bit quantization (affine, groupsize=64) for Apple Silicon. This variant offers a good balance between quality and efficiency — near-original precision at…
Downloads · 30 days
24
12% of all-time downloads
All-time downloads
204
Public
Parameters
3.9B
4.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.2 GB · 99%
How the weights are stored.
U323.9B · 100%
From the Hugging Face model README
This is the Nanbeige4.1-3B model converted to MLX format with 8-bit quantization (affine, group_size=64) for Apple Silicon. This variant offers a good balance between quality and efficiency — near-original precision at roughly half the size.
Other variants:
- andrevp/Nanbeige4.1-3B-MLX-4bit — Smallest & fastest (~2.06 GB)
- andrevp/Nanbeige4.1-3B-MLX-BF16 — Full precision (~7.3 GB)
| Property | Value |
|---|---|
| Quantization | 8-bit affine |
| Group size | 64 |
| Bits per weight | ~8.5 |
| Original size (BF16) | ~7.87 GB |
| Quantized size | ~3.91 GB |
| Compression ratio | 2.0x |
| Conversion tool | mlx-lm v0.30.7 |
| Metric | Value |
|---|---|
| Prompt processing | ~342 tokens/sec |
| Generation speed | ~59 tokens/sec |
| Peak memory usage | ~4.3 GB |
| Variant | Size | Memory | Prompt Speed | Gen Speed |
|---|---|---|---|---|
| 4-bit | 2.06 GB | ~2.3 GB | ~279 tok/s | ~103 tok/s |
| 8-bit (this) | 3.91 GB | ~4.3 GB | ~342 tok/s | ~59 tok/s |
| BF16 | 7.35 GB | ~8.0 GB | ~276 tok/s | ~33 tok/s |
All three variants were tested with the same prompts under deterministic settings (temperature=0) to evaluate quality differences:
| Test | 4-bit | 8-bit | BF16 |
|---|---|---|---|
| Math: 47 * 83 | 3901 | 3901 | 3901 |
| Logic: "All but 9 die" trick | 9 | 9 | 9 |
| Code: Binary search | Correct | Correct | Correct |
| Math: f(x)=2x^2-3x+1, f(5) | 36 | 36 | 36 |
| Nuanced reasoning: Paper folding | Correct | Correct | Correct |
| Tool call: BookFlight JSON | Identical | Identical | Identical |
| AIME-style: 2^100 mod 7 | 2 | 2 | 2 |
Key findings:
This model retains all capabilities of the original Nanbeige4.1-3B:
<think>...</think> tags for chain-of-thought reasoning<tool_call>...</tool_call> JSON outputtokenizer_config_search.json)pip install mlx-lm
mlx_lm generate \
--model andrevp/Nanbeige4.1-3B-MLX-8bit \
--prompt "Explain quantum computing in simple terms." \
--max-tokens 512 \
--temp 0.6 \
--top-p 0.95
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("andrevp/Nanbeige4.1-3B-MLX-8bit")
sampler = make_sampler(temp=0.6, top_p=0.95)
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
)
response = generate(
model, tokenizer, prompt=prompt, max_tokens=512, sampler=sampler
)
print(response)
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("andrevp/Nanbeige4.1-3B-MLX-8bit")
sampler = make_sampler(temp=0.6, top_p=0.95)
messages = [
{"role": "user", "content": "What is the weather in Tokyo?"}
]
tools = [
{
"type": "function",
"function": {
"name": "SearchWeather",
"description": "Find the current weather in a city.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": ["location"]
}
}
}
]
prompt = tokenizer.apply_chat_template(
messages, tools=tools, add_generation_prompt=True, tokenize=False
)
response = generate(
model, tokenizer, prompt=prompt, max_tokens=256, sampler=sampler
)
print(response)
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("andrevp/Nanbeige4.1-3B-MLX-8bit")
sampler = make_sampler(temp=0.6, top_p=0.95)
tools = [
{
"type": "function",
"function": {
"name": "SearchWeather",
"description": "Find the current weather in a city.",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}
]
messages = [
{"role": "user", "content": "What's the weather like in Paris?"},
{"role": "assistant", "content": "", "tool_calls": [
{"function": {"name": "SearchWeather", "arguments": '{"location": "Paris"}'}}
]},
{"role": "tool", "content": '{"temperature": "18°C", "condition": "Partly cloudy"}'}
]
prompt = tokenizer.apply_chat_template(
messages, tools=tools, add_generation_prompt=True, tokenize=False
)
response = generate(
model, tokenizer, prompt=prompt, max_tokens=300, sampler=sampler
)
print(response)
| Parameter | Value |
|---|---|
| Temperature | 0.6 |
| Top-p | 0.95 |
| Repeat penalty | 1.0 |
| Max new tokens | 131,072 |
| Benchmark | Qwen3-4B | Qwen3-8B | Qwen3-14B | Qwen3-32B | Qwen3-30B-A3B | Nanbeige4.1-3B |
|---|---|---|---|---|---|---|
| Code | ||||||
| Live-Code-Bench-V6 | 57.4 | 49.4 | 55.9 | 55.7 | 66.0 | 76.9 |
| LCB-Pro-Easy | 40.2 | 41.2 | 33.0 | 42.3 | 60.8 | 81.4 |
| LCB-Pro-Medium | 5.3 | 3.5 | 1.8 | 3.5 | 3.5 | 28.1 |
| Math | ||||||
| AIME 2026 I | 81.46 | 70.42 | 76.46 | 75.83 | 87.30 | 87.40 |
| HMMT Nov | 68.33 | 48.33 | 56.67 | 57.08 | 71.25 | 77.92 |
| IMO-Answer-Bench | 48.00 | 36.56 | 41.81 | 43.94 | 54.34 | 53.38 |
| Science | ||||||
| GPQA | 65.8 | 62.0 | 63.38 | 68.4 | 73.4 | 83.8 |
| HLE (Text-only) | 6.72 | 5.28 | 7.00 | 9.31 | 11.77 | 12.60 |
| Alignment | ||||||
| Arena-Hard-v2 | 34.9 | 26.3 | 36.9 | 56.0 | 60.2 | 73.2 |
| Multi-Challenge | 41.14 | 36.30 | 36.97 | 38.72 | 49.40 | 52.21 |
| Tool Use | ||||||
| BFCL-V4 | 44.87 | 42.20 | 45.14 | 47.90 | 48.6 | 56.50 |
| Tau2-Bench | 45.9 | 42.06 | 44.96 | 45.26 | 47.70 | 48.57 |
| Model | xBench-DS-2505 | xBench-DS-2510 | Browse-Comp | GAIA | HLE | SEAL-0 |
|---|---|---|---|---|---|---|
| MiroThinker-v1.0-8B | 61 | - | 31.1 | 66.4 | 21.5 | 40.4 |
| AgentCPM-Explore-4B | 70 | - | 25.0 | 63.9 | 19.1 | 40.0 |
| Qwen3-32B | 39 | 8 | 3.15 | 30.17 | 9.26 | 8.15 |
| Nanbeige4.1-3B | 75 | 39 | 19.12 | 69.90 | 22.29 | 41.44 |
| File | Description |
|---|---|
model.safetensors | Quantized 8-bit model weights |
model.safetensors.index.json | Weight index mapping |
config.json | Model architecture config (with quantization params) |
tokenizer.json | Fast tokenizer |
tokenizer.model | SentencePiece model |
tokenizer_config.json | Tokenizer config with all special tokens |
tokenizer_config_search.json | Tokenizer config for deep-search mode |
chat_template.jinja | Chat template (chat + tool calling + reasoning) |
special_tokens_map.json | Special tokens mapping |
added_tokens.json | Additional token definitions |
generation_config.json | Default generation parameters |
| Token | ID | Purpose |
|---|---|---|
<|im_start|> | 166100 | BOS / message start |
<|im_end|> | 166101 | EOS / message end |
<|endoftext|> | 166102 | End of text |
<think> | 166103 | Start of reasoning |
</think> | 166104 | End of reasoning |
<tool_call> | 166105 | Start of tool call |
</tool_call> | 166106 | End of tool call |
For deep-search agent capabilities, switch to tokenizer_config_search.json and use the miroflow-framework for inference. See the original model card for detailed deep-search setup instructions.
Nanbeige4.1-3B is a reasoning model that generates chain-of-thought inside <think>...</think> tags before producing a final answer. This is by design — and it affects all variants equally (4-bit, 8-bit, BF16).
| Task Type | Typical Thinking Length | Recommended max_tokens |
|---|---|---|
| Math, logic, tool calling | 200–500 tokens | 512–2,048 |
| Code generation | 500–1,500 tokens | 2,048–4,096 |
| Translation, creative writing, commonsense | 3,000–5,000+ tokens | 8,192+ |
For complex tasks (translation, creative writing, open-ended questions), the model may spend 3,000–5,000+ tokens reasoning before delivering an answer. If max_tokens is too low, the output will be truncated mid-thinking and no final answer will appear — this is not a failure, the model simply needs more tokens to finish its thought process.
1. Increase max_tokens (recommended)
# For complex tasks, use high max_tokens
response = generate(
model, tokenizer, prompt=prompt,
max_tokens=8192, # or higher for very complex tasks
sampler=sampler
)
2. Skip thinking (experimental)
You can pre-fill an empty thinking block to force the model to answer directly. This does not always work — the model may re-enter thinking mode — but it can help for simpler open-ended tasks:
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, tokenize=False
)
prompt += '<think>\n\n</think>\n\n' # Force empty thinking block
response = generate(
model, tokenizer, prompt=prompt,
max_tokens=512, sampler=sampler
)
3. Post-process to extract the answer
if '</think>' in response:
answer = response.split('</think>')[-1].strip()
else:
answer = response # Still in thinking — increase max_tokens
While safety was emphasized during training, the model may still generate unexpected outputs due to its size and probabilistic nature. Users should not propagate harmful content. The developers assume no responsibility for consequences from dissemination of inappropriate content.
This model is released under the Apache 2.0 License, the same license as the original Nanbeige4.1-3B model.