Views
No views yet
| Precision | 8-bit |
| On-disk size | 4.2 GB |
| Peak RAM (generation) | ~4.6 GB |
| Context length | 262 144 |
| Languages | English, Chinese |
model_type: nanbeige) that is not yet
part of mlx-lm, so you must drop a small model file into your mlx-lm install
before loading:1pip install -U mlx-lm
2# copy the bundled nanbeige.py into mlx_lm/models/
3curl -L https://huggingface.co/vote-for-pedro/Nanbeige4.2-3B-mlx-8bit/resolve/main/nanbeige.py \
4 -o "$(python3 -c 'import mlx_lm,os;print(os.path.dirname(mlx_lm.__file__))')/models/nanbeige.py"nanbeige.py is included in this repo.1python3 -m mlx_lm generate --model vote-for-pedro/Nanbeige4.2-3B-mlx-8bit \
2 --prompt "Explain how rotary position embeddings work." --max-tokens 4001from mlx_lm import load, generate
2
3model, tok = load("vote-for-pedro/Nanbeige4.2-3B-mlx-8bit")
4messages = [{"role": "user", "content": "Give me three study tips."}]
5prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
6print(generate(model, tok, prompt=prompt, max_tokens=400))Note: Nanbeige4.2 is a reasoning model — it emits a thinking trace before the final answer. Parse after the trace for the answer itself.
num_loops: 2) — the full 22-layer stack is executed
twice with shared weights, each loop keeping its own KV cache, with a final
RMSNorm applied between loops. All other optional features in the original
modeling code (n-gram embeddings, hyper-connection / mHC, depth-attention,
double-loop split, QK-LayerNorm) are disabled in this checkpoint and carry no
weights.mlx_lm.convert from the original bf16 safetensors.During validation, twotransformers >= 5incompatibilities were found in the original modeling code (arope_scalingcrash and a degenerate RoPE). This MLX build is unaffected — it does not usetransformersfor inference — but be aware the original PyTorch weights may misbehave on currenttransformers.