Text Generation
MLX
Safetensors
gpt_oss
omlx
quantized
oQ4
apple-silicon
4-bit precision
conversational
Instructions to use cjnielson44/gpt-oss-120b-oQ4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use cjnielson44/gpt-oss-120b-oQ4 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("cjnielson44/gpt-oss-120b-oQ4") 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 cjnielson44/gpt-oss-120b-oQ4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "cjnielson44/gpt-oss-120b-oQ4"
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": "cjnielson44/gpt-oss-120b-oQ4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use cjnielson44/gpt-oss-120b-oQ4 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 "cjnielson44/gpt-oss-120b-oQ4"
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 cjnielson44/gpt-oss-120b-oQ4
Run Hermes
hermes
- OpenClaw new
How to use cjnielson44/gpt-oss-120b-oQ4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "cjnielson44/gpt-oss-120b-oQ4"
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 "cjnielson44/gpt-oss-120b-oQ4" \ --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 cjnielson44/gpt-oss-120b-oQ4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "cjnielson44/gpt-oss-120b-oQ4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "cjnielson44/gpt-oss-120b-oQ4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cjnielson44/gpt-oss-120b-oQ4", "messages": [ {"role": "user", "content": "Hello"} ] }'
Improve model card
Browse files
README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: openai/gpt-oss-120b
|
| 4 |
library_name: mlx
|
|
|
|
| 5 |
tags:
|
| 6 |
- mlx
|
| 7 |
- omlx
|
|
@@ -9,33 +10,67 @@ tags:
|
|
| 9 |
- quantized
|
| 10 |
- oQ4
|
| 11 |
- apple-silicon
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# gpt-oss-120b-oQ4
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
- Non-expert tensors use the oQ4 affine quantization plan generated by oMLX.
|
| 22 |
-
- GPT-OSS MoE expert projection tensors are preserved as MXFP4 passthrough tensors and are marked with per-layer `mxfp4` overrides in `config.json`; this is required for oMLX/MLX loading.
|
| 23 |
-
- Tested locally with oMLX model discovery/load after generation.
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
```bash
|
| 30 |
-
|
|
|
|
| 31 |
```
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
```text
|
| 36 |
gpt-oss-120b-oQ4
|
| 37 |
```
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: openai/gpt-oss-120b
|
| 4 |
library_name: mlx
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- mlx
|
| 8 |
- omlx
|
|
|
|
| 10 |
- quantized
|
| 11 |
- oQ4
|
| 12 |
- apple-silicon
|
| 13 |
+
- 4-bit
|
| 14 |
---
|
| 15 |
|
| 16 |
# gpt-oss-120b-oQ4
|
| 17 |
|
| 18 |
+
`cjnielson44/gpt-oss-120b-oQ4` is an Apple Silicon / oMLX-ready MLX checkpoint for GPT-OSS 120B. It was produced with oMLX oQ4 quantization and published for local inference through oMLX.
|
| 19 |
|
| 20 |
+
This checkpoint is not a uniform 4-bit conversion of every tensor. GPT-OSS uses MoE expert projection tensors that are already stored in MXFP4 form, so those expert tensors are preserved as MXFP4 passthrough tensors and explicitly marked in `config.json`.
|
| 21 |
|
| 22 |
+
## Quantization Details
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
- Source: local oMLX-compatible `gpt-oss-120b` MLX checkpoint, originally derived from `openai/gpt-oss-120b`.
|
| 25 |
+
- Quantizer: oMLX oQ4.
|
| 26 |
+
- Main quantized tensors: affine oQ4, `bits: 4`, `group_size: 64`.
|
| 27 |
+
- GPT-OSS MoE expert projections: MXFP4 passthrough, `bits: 4`, `group_size: 32`, `mode: mxfp4`.
|
| 28 |
+
- Expert override coverage: all 36 layers for `gate_proj`, `up_proj`, and `down_proj` under `model.layers.<i>.mlp.experts`.
|
| 29 |
+
- Floating dtype used during quantization: `bfloat16`.
|
| 30 |
|
| 31 |
+
The MXFP4 expert overrides are required for oMLX/MLX loading. Without them, the loader treats the expert tensors as affine-quantized tensors and expects `*.biases` parameters that do not exist for these MXFP4 expert weights.
|
| 32 |
+
|
| 33 |
+
## Use With oMLX
|
| 34 |
+
|
| 35 |
+
Download into an oMLX-discoverable model directory:
|
| 36 |
|
| 37 |
```bash
|
| 38 |
+
hf download cjnielson44/gpt-oss-120b-oQ4 \
|
| 39 |
+
--local-dir ~/.omlx/models/cjnielson44/gpt-oss-120b-oQ4
|
| 40 |
```
|
| 41 |
|
| 42 |
+
Restart oMLX, then use this model id:
|
| 43 |
|
| 44 |
```text
|
| 45 |
gpt-oss-120b-oQ4
|
| 46 |
```
|
| 47 |
|
| 48 |
+
Example OpenAI-compatible request, assuming your oMLX server is listening locally:
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
curl http://127.0.0.1:8000/v1/chat/completions \
|
| 52 |
+
-H "Content-Type: application/json" \
|
| 53 |
+
-H "Authorization: Bearer $OMLX_API_KEY" \
|
| 54 |
+
-d '{
|
| 55 |
+
"model": "gpt-oss-120b-oQ4",
|
| 56 |
+
"messages": [{"role": "user", "content": "Write a short note about Apple Silicon inference."}],
|
| 57 |
+
"max_tokens": 128
|
| 58 |
+
}'
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Choosing This Variant
|
| 62 |
+
|
| 63 |
+
Use oQ4 if you want the smallest non-expert tensor precision among these releases. Because GPT-OSS expert tensors are preserved as MXFP4 in all three variants, the practical disk-size difference between oQ4, oQ6, and oQ8 may be smaller than expected.
|
| 64 |
+
|
| 65 |
+
For best quality from this release family, prefer `cjnielson44/gpt-oss-120b-oQ8`.
|
| 66 |
+
|
| 67 |
+
## Verification
|
| 68 |
+
|
| 69 |
+
This repo was uploaded after local oMLX discovery and load/unload smoke testing. The same GPT-OSS MXFP4 expert override fix used for oQ8 was applied to this oQ4 repo.
|
| 70 |
+
|
| 71 |
+
## Limitations
|
| 72 |
|
| 73 |
+
- Experimental community quantization.
|
| 74 |
+
- Requires recent oMLX/MLX support for GPT-OSS and MXFP4 expert tensors.
|
| 75 |
+
- No benchmark or perplexity numbers are provided yet.
|
| 76 |
+
- This model card does not change the upstream license or usage terms of `openai/gpt-oss-120b`.
|