Instructions to use halley-ai/gpt-oss-120b-MLX-6bit-gs64 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use halley-ai/gpt-oss-120b-MLX-6bit-gs64 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("halley-ai/gpt-oss-120b-MLX-6bit-gs64") 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 halley-ai/gpt-oss-120b-MLX-6bit-gs64 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "halley-ai/gpt-oss-120b-MLX-6bit-gs64"
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": "halley-ai/gpt-oss-120b-MLX-6bit-gs64" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use halley-ai/gpt-oss-120b-MLX-6bit-gs64 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 "halley-ai/gpt-oss-120b-MLX-6bit-gs64"
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 halley-ai/gpt-oss-120b-MLX-6bit-gs64
Run Hermes
hermes
- OpenClaw new
How to use halley-ai/gpt-oss-120b-MLX-6bit-gs64 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "halley-ai/gpt-oss-120b-MLX-6bit-gs64"
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 "halley-ai/gpt-oss-120b-MLX-6bit-gs64" \ --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 halley-ai/gpt-oss-120b-MLX-6bit-gs64 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "halley-ai/gpt-oss-120b-MLX-6bit-gs64"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "halley-ai/gpt-oss-120b-MLX-6bit-gs64" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "halley-ai/gpt-oss-120b-MLX-6bit-gs64", "messages": [ {"role": "user", "content": "Hello"} ] }'
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 "halley-ai/gpt-oss-120b-MLX-6bit-gs64" \
--custom-provider-id mlx-lm \
--custom-compatibility openai \
--custom-text-input \
--accept-risk \
--skip-healthRun OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"gpt-oss-120b — MLX 6-bit (group size 64)
Summary. This is a 6-bit MLX quantization of gpt-oss-120B with group size 64. It targets a smaller memory footprint and higher throughput than the 8-bit gs=32 build while keeping quality close to the bf16/8-bit references.
- Base model:
openai/gpt-oss-120b(Apache-2.0) - Quantization: MLX int6,
q_group_size=64(some tensors may remain 16-bit for stability) - Files: MLX weight shards +
config.json; tokenizer files included for drop-in use - Intended use: local inference / research on M-series Macs
- Not intended for: safety-critical decisions; outputs may be inaccurate or biased
Requirements
Runs on Apple Silicon (M1 or newer) with macOS ≥ 13.5 via MLX (Metal).
- Not supported: Intel macOS / Linux / Windows (consider a GGUF build + llama.cpp instead).
- Memory guidance: notably smaller footprint vs 8-bit/gs32; 64–96 GB recommended for comfortable headroom on 120B with moderate context sizes. The effective GPU working set is capped by Metal’s budget; keep 5–10% headroom.
How to use (MLX)
pip install mlx-lm
# Python API (uses tokenizer bundled with this repo)
from mlx_lm import load, generate
model, tokenizer = load("halley-ai/gpt-oss-120b-MLX-6bit-gs64")
print(generate(
model, tokenizer,
prompt="Explain the Chudnovsky algorithm to compute π.",
max_tokens=256, max_kv_size=512
))
# CLI
python -m mlx_lm generate --model halley-ai/gpt-oss-120b-MLX-6bit-gs64 \
--prompt "Explain the Chudnovsky algorithm to compute pi." \
--max-kv-size 512 --max-tokens 256
Evaluation
Perplexity (PPL) streaming evaluation on WikiText-2 (raw, test) is recommended with the fast preset (window=stride=4096, ~100k tokens, EOS inserted between docs):
python python/scripts/test_perplexity-mlx.py \
--model_path "/path/to/gpt-oss-120b-MLX-6bit-gs64" \
--fast --progress
For more sensitive comparisons, use overlapping windows (for example, --stride 512) and evaluate the full split.
Results
| Variant | PPL (ctx=4096, fast) |
|---|---|
| MLX 6-bit (gs=64) | 7.40 |
| MLX 8-bit (gs=32) | 7.39 |
| MLX bf16 (reference) | 7.38 |
Conversion details (provenance)
python -m mlx_lm convert \
--hf-path openai/gpt-oss-120b \
--mlx-path gpt-oss-120b-MLX-6bit-gs64 \
--q-bits 6 --q-group-size 64 -q
- Some tensors (for example, embeddings/norms/router) may remain 16-bit for numerical stability.
Footprint and speed tips
- Limit KV cache: set
--max-kv-size(CLI) ormax_kv_size(Python) to the smallest context you need. - Batching: prefer single-stream generation; large batches increase memory pressure on 120B.
- Compute windowing: when evaluating PPL, the provided script auto-clamps the compute window to avoid Metal’s per-buffer limits.
- Sampler settings: top‑p/top‑k sampling with moderate temperature can improve throughput versus beam search.
Sibling and reference models
- halley-ai/gpt-oss-120b-MLX-8bit-gs32 (reference 8-bit)
- halley-ai/gpt-oss-120b-MLX-bf16 (non-quantized reference)
Limitations and biases
Outputs may be factually wrong or unsafe. Do not use for medical, legal, or financial decisions without human review. Large models can be sensitive to prompt wording; prefer explicit instructions and structure.
License and credits
- License: Apache-2.0 (inherits from base model)
- Base model: OpenAI gpt-oss-120B
- Quantization: Halley AI Lab (MLX int6, gs=64)
- Please cite both the base model and this repository when you use the weights.
- Downloads last month
- 69
4-bit
Model tree for halley-ai/gpt-oss-120b-MLX-6bit-gs64
Base model
openai/gpt-oss-120b
Start the MLX server
# Install MLX LM: uv tool install mlx-lm# Start a local OpenAI-compatible server: mlx_lm.server --model "halley-ai/gpt-oss-120b-MLX-6bit-gs64"