How to use from
MLX LM
Generate or start a chat session
# Install MLX LM
uv tool install mlx-lm
# Interactive chat REPL
mlx_lm.chat --model "MercuriusDream/Nanbeige4.2-3B-mlx-3bit"
Run an OpenAI-compatible server
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "MercuriusDream/Nanbeige4.2-3B-mlx-3bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
   -H "Content-Type: application/json" \
   --data '{
     "model": "MercuriusDream/Nanbeige4.2-3B-mlx-3bit",
     "messages": [
       {"role": "user", "content": "Hello"}
     ]
   }'
Quick Links

Nanbeige4.2-3B — MLX 3bit

Quantized to 3 bits per weight, group size 64 (1.7 GB, 3.5 effective bpw).

Converted from Nanbeige/Nanbeige4.2-3B using mlx-lm. Logits of the MLX port match the reference implementation to a max abs difference of 9.5e-05 (fp32, CPU).

Nanbeige4.2-3B is a Looped Transformer: its 22 decoder layers run twice per forward pass (num_loops=2) with shared weights, giving 4B total parameters with the capacity of a deeper model.

Requirements

The nanbeige model type is pending upstream support in mlx-lm (ml-explore/mlx-lm#1597). Until that merges, install from the PR branch:

pip install git+https://github.com/MercuriusDream/mlx-lm.git@add-nanbeige-model

Use

mlx_lm.generate --model MercuriusDream/Nanbeige4.2-3B-mlx-3bit --prompt "hello"
from mlx_lm import load, generate

model, tokenizer = load("MercuriusDream/Nanbeige4.2-3B-mlx-3bit")
prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "hello"}], add_generation_prompt=True
)
print(generate(model, tokenizer, prompt=prompt))

All variants

Downloads last month
28
Safetensors
Model size
4B params
Tensor type
U32
·
BF16
·
MLX
Hardware compatibility
Log In to add your hardware

3-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for MercuriusDream/Nanbeige4.2-3B-mlx-3bit

Quantized
(51)
this model

Collection including MercuriusDream/Nanbeige4.2-3B-mlx-3bit