Instructions to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit"
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 jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit
Run Hermes
hermes
- OpenClaw new
How to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit"
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 "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit" \ --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"
- MLX LM
How to use jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jishnuvenugopal/Nanbeige4.2-3B-mlx-6bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Nanbeige4.2-3B MLX (6-bit)
An MLX conversion and 6-bit quantization (group size 64) of
Nanbeige/Nanbeige4.2-3B — a
3-billion-parameter Looped Transformer (num_loops=2, weight-shared over 22
layers for an effective depth of 44). Produced by the independent
nanbeige-mlx project;
not affiliated with the Nanbeige team.
Load (no conversion step)
from nanbeige_mlx import pull
import mlx_lm
model, tok = mlx_lm.load(pull("6bit"))
Weights arrive on first use and are cached in ~/.cache/huggingface.
KV-cache ceiling (a real cost of the looped design)
The looped architecture needs num_loops * num_hidden_layers = 44 KV slots.
At full context that is 44 x 8 KV-heads x 128 dim x 2 (K+V) x 262144 positions
x 2 bytes ~= 47 GB — unreachable on a 16 GB machine. Because this model
supplies make_cache, mlx-lm's --max-kv-size knob is inert; use --kv-bits
to reduce KV precision instead.
Fidelity of the port
This quant is produced by a from-scratch MLX port of the looped architecture, checked against the HuggingFace reference. The headline finding carries over verbatim from the port's documentation, and must read identically wherever it appears (repo README, model card, investigation log):
Bottom line: the source of the logit gap is documented-open, not blocking. Six candidate causes are ruled out by measurement (the seventh, "RoPE runs in bf16," was killed by a bit-identical upcast experiment —
mx.fast.ropeis fp32-internal regardless of input dtype). The[1,1,5,6]mask shape is a red herring: the 6th column is HF'spast_seen_tokens + sequence_length + 1boilerplate for StaticCache sizing, present in every Llama-family model, and eager attention slices it to[:,:,:,:L]before use — nothing to do withnum_loops. The gap does not affect behavior on the agentic suite. Bit-exact parity is not claimed and not expected in bf16. Full record:docs/investigation-log.md.
License
Apache-2.0 (the upstream license; quantization is a modification under §4(d)).
The nanbeige.py model definition is MIT-licensed source from nanbeige-mlx.
See LICENSE and NOTICE.
- Downloads last month
- -
6-bit