How to use from
OpenClaw
Start the MLX server
# Install MLX LM:
uv tool install mlx-lm
# Start a local OpenAI-compatible server:
mlx_lm.server --model "MercuriusDream/Nanbeige4.2-3B-mlx-8bit"
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 "MercuriusDream/Nanbeige4.2-3B-mlx-8bit" \
  --custom-provider-id mlx-lm \
  --custom-compatibility openai \
  --custom-text-input \
  --accept-risk \
  --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Quick Links

Nanbeige4.2-3B — MLX 8bit

Quantized to 8 bits per weight, group size 64 (4.2 GB, 8.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-8bit --prompt "hello"
from mlx_lm import load, generate

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

All variants

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

8-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-8bit

Quantized
(22)
this model

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