Instructions to use nightmedia/Qwen3-Coder-Next-mxfp4-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nightmedia/Qwen3-Coder-Next-mxfp4-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("nightmedia/Qwen3-Coder-Next-mxfp4-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 nightmedia/Qwen3-Coder-Next-mxfp4-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 "nightmedia/Qwen3-Coder-Next-mxfp4-mlx"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nightmedia/Qwen3-Coder-Next-mxfp4-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nightmedia/Qwen3-Coder-Next-mxfp4-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 "nightmedia/Qwen3-Coder-Next-mxfp4-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nightmedia/Qwen3-Coder-Next-mxfp4-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nightmedia/Qwen3-Coder-Next-mxfp4-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use nightmedia/Qwen3-Coder-Next-mxfp4-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 "nightmedia/Qwen3-Coder-Next-mxfp4-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 nightmedia/Qwen3-Coder-Next-mxfp4-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nightmedia/Qwen3-Coder-Next-mxfp4-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 "nightmedia/Qwen3-Coder-Next-mxfp4-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 "nightmedia/Qwen3-Coder-Next-mxfp4-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"
mxfp4 produces garbage (solved)
After 30-40 lines of output the model produces garbage. Settings: temperature: 1.0, top_p: 0.95, top_k: 40. Latest ml-explore/mlx-lm,
python3 -m mlx_lm.server --model nightmedia/Qwen3-Coder-Next-mxfp4-mlx --temp 1.0 --top-p 0.95 --top-k 40
Other models work flawlessly.
Interesting, did you try it in LMStudio? also, update the local MLX tools, they keep changing every day now. I was not able to replicate issues with my setup, and I use the latest codebase from main
I did a fresh git clone with a venv and all latest packages. I did not try with LMStudio as it wanted to re-download again as it expects the models in ~/.lmstudio. Would a symlink do it? I may try again one of the next days, currently I am downloading the mlx-community quant.
yeah, symlink should work, I do that often.
I went through the pyenv nightmare a few times. Hard to stabilize an environment on mlx if you try to do more than one thing at a time. I ended up with a merge environment, a quant environment, etc... it gets crazy after a while
LMStudio is always stable with running quants because it embeds a safe mlx version
It does indeed work with LMStudio and it also works with pip install mlx==0.30.1 mlx-metal==0.30.1. And also the mlx-community quant produces similar garbage, so definitely not your quant the reason. Will see if I find some time the next days to pinpoint the problem or at least write a decent but report for mlx-lm.
For info on M1 64GB with mxfp4 I get ~300Tok/s PP and ~40Tok/s TG with 5000 context.
Excellent, thank you for confirming it. Should also check out the qx64-hi I just uploaded, about same performance level
Looks like an M1/M2 issue and a fix is in the pipeline for merge with main: https://github.com/ml-explore/mlx/pull/3099
Once it is merged I'll give it a test run.