Text Generation
MLX
Safetensors
English
gpt_oss
coding-agent
agentic
gpt-oss
codex
apple-silicon
conversational
4-bit precision
Instructions to use exalandru/GPT-OSS-Coder-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use exalandru/GPT-OSS-Coder-MLX 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("exalandru/GPT-OSS-Coder-MLX") 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 exalandru/GPT-OSS-Coder-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "exalandru/GPT-OSS-Coder-MLX"
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": "exalandru/GPT-OSS-Coder-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use exalandru/GPT-OSS-Coder-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "exalandru/GPT-OSS-Coder-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "exalandru/GPT-OSS-Coder-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "exalandru/GPT-OSS-Coder-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use exalandru/GPT-OSS-Coder-MLX 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 "exalandru/GPT-OSS-Coder-MLX"
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 exalandru/GPT-OSS-Coder-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use exalandru/GPT-OSS-Coder-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "exalandru/GPT-OSS-Coder-MLX"
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 "exalandru/GPT-OSS-Coder-MLX" \ --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"
| license: apache-2.0 | |
| base_model: openai/gpt-oss-120b | |
| base_model_relation: finetune | |
| library_name: mlx | |
| tags: | |
| - coding-agent | |
| - agentic | |
| - mlx | |
| - gpt-oss | |
| - codex | |
| - apple-silicon | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| # GPT-OSS Coder | |
| A **gpt-oss-120b** version focused on improving practical coding-agent behavior in repository-level software engineering tasks. | |
| > Also available in **[GGUF for llama.cpp / LM Studio / Ollama →](https://huggingface.co/exalandru/GPT-OSS-Coder-GGUF)** | |
| # Version 1.1 | |
| > This release adds three focused passes over re-curated data, each targeting a behaviour measured missing in the previous one: writing failure-injection regression tests before closing, iterating on multi-defect repositories past the first green suite, and honouring per-harness completion contracts. Every pass was gated by calibrated probes and a held-out benchmark ladder before being promoted. | |
| ## How it works | |
| It digs deeper into the repository, follows evidence to the root cause, and keeps iterating until the fix holds under real tests instead of stopping at a plausible-looking patch. | |
| - Fixes the bug, not the symptom : traces the actual defect, not the first thing that looks broken | |
| - Inspects more before editing, and re-runs tests after : more reads, more checks, fewer false successes | |
| - Emits tool calls the harness can actually run : dramatically fewer rejected calls | |
| - Revisits files when new evidence appears | |
| - Reasons about state and invariants across components | |
| - Continues iterating when the first implementation is incomplete | |
| - Ends its turns with a real report of what was done — no empty summaries, no truncated turns | |
| - Writes its own failing test before declaring victory : adds regression tests that fail on the unfixed code, then proves the fix against them | |
| - Iterates past the first green suite : coupled defects don't survive the second pass | |
| - Follows each harness's closing convention : a Codex task ends with a final report, a Cline task ends with a proper `attempt_completion` call | |
| - Tightens what a fix requires : removes deprecated or unauthorized call forms instead of quietly keeping them accepted | |
| The fine-tune also significantly reduced malformed JSON arguments. | |
| Works even better with my **[Adversarial Agent Engineering](https://github.com/exalandru/Adversarial-Agent-Engineering)** pack of skills and rules | |
| ## Runtime | |
| <span style="color:orange;">Optimized for Codex.</span> | |
| ### Codex GPT-OSS Server | |
|  | |
| It provides native Codex integration for GPT-OSS on MLX. Rather than exposing GPT-OSS only through a generic OpenAI-compatible compatibility layer, it is designed so that Codex can use GPT-OSS as a native local model while preserving the GPT-OSS/Codex protocol details. | |
| This includes the native Codex Responses protocol, GPT-OSS Harmony handling, reasoning continuity across tool turns, and Codex-specific routing and metadata. | |
| Agent loops work smoothly without the stalls and rejections you get with generic OpenAI-compatible endpoints. | |
| **https://github.com/exalandru/Codex-GPT-OSS-Server** | |
| ### Or run it directly with MLX | |
| ```bash | |
| mlx_lm.generate --model exalandru/GPT-OSS-Coder-MLX --prompt "Hello World!" | |
| ``` | |
| **Format:** MLX, MXFP4 experts + bf16 attention, ~61 GB on disk. Weights are consolidated — nothing to fuse or merge. Runs on Apple silicon with 96 GB unified memory; a full agent session peaks around 82 GB. | |
| > **116.8B parameters** (MoE, ~5.1B active per token — which is why it decodes | |
| > faster than much smaller dense models). The Hub badge shows ~24B because MLX | |
| > packs eight 4-bit weights per uint32 element and the badge counts elements, | |
| > not parameters. | |
| --- | |
| ## How it was trained | |
| Supervised fine-tuning on ~10 000 steps carefully selected from real coding-agent sessions to isolate the targeted behavior : some of my personal sessions with Opus/Fable 5 and GPT 5.6 Sol, public SWE-agent, OpenHands, SWE-smith and Fable trajectories, keeping **only runs that actually resolved their issue**. A run that gave up, or ran out of context and submitted anyway, teaches exactly the habit this model is meant to shed, so those were filtered out. | |
| Each training example is a real repository state plus the next action the successful agent took, so what is learned is the loop itself: look, edit, run, read the result, correct. | |
| The fine-tune itself is deliberately small, a low-rank update on the last layers only, then consolidated back into the weights. The goal was to shift behaviour, not to overwrite what the base model already knows. | |
| Custom small in-house benchmarks were used to validate the training. Models such as Qwen3.6, DeepSeek v4 Flash and other distilled gpt-oss variants all failed these benchmarks. Opus 5 and GPT 5.6 Sol served as references proving the tasks were solvable. | |
| --- | |
| *Built by [exalandru](https://github.com/exalandru). If you use it in a real | |
| agent loop, the failure reports are more useful than the success ones.* | |