Instructions to use Jakevin/Qwen3.8-Flash-Next-ternary-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Jakevin/Qwen3.8-Flash-Next-ternary-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("Jakevin/Qwen3.8-Flash-Next-ternary-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 Jakevin/Qwen3.8-Flash-Next-ternary-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 "Jakevin/Qwen3.8-Flash-Next-ternary-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": "Jakevin/Qwen3.8-Flash-Next-ternary-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Jakevin/Qwen3.8-Flash-Next-ternary-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 "Jakevin/Qwen3.8-Flash-Next-ternary-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Jakevin/Qwen3.8-Flash-Next-ternary-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jakevin/Qwen3.8-Flash-Next-ternary-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Jakevin/Qwen3.8-Flash-Next-ternary-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 "Jakevin/Qwen3.8-Flash-Next-ternary-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 Jakevin/Qwen3.8-Flash-Next-ternary-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Jakevin/Qwen3.8-Flash-Next-ternary-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 "Jakevin/Qwen3.8-Flash-Next-ternary-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 "Jakevin/Qwen3.8-Flash-Next-ternary-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"
Jakevin/Qwen3.8-Flash-Next-ternary-mlx
Mixed-precision MLX checkpoint of Qwen/Qwen3.8-Flash-Next. The start point is the official FP8 weights. Ternary matrices run on mlx-ternary (Hugging Face: Jakevin/mlx-ternary).
The checkpoint has 288 units: 48 layers, and in each layer the attention block, the shared expert, and four routed-expert bands. Their storage is
| Format | Units |
|---|---|
| Ternary, about 1.85 bits, one scale per 64 weights | 117 |
| 4-bit affine, group 64 | 92 |
| 3-bit affine, group 64 | 62 |
| 2-bit affine, group 64 | 17 |
Held-out next-token KL against the FP8 reference is 0.167 nats/token. ISTA 2-bit on the same text is 0.217.
On a 216-question multiple-choice set this mix scores 149 and ISTA 2-bit scores 162. That is 13 fewer correct answers (about 6 points), well beyond the roughly half-point noise of one question, so this mix answers fewer questions correctly than ISTA 2-bit. Its advantage is a lower KL divergence, meaning its outputs stay closer to the original model.
Speed depends on the device. Measured tokens per second for the mlx-ternary v3 kernel, with SSD read time split from GPU compute, will be added later.
Limitations
An all-ternary allocation of the same model (every one of the 288 units ternary) keeps about 57% of the official FP8 score on those 216 questions. This release is the mixed allocation above, not that all-ternary model.
The runtime reads every routed expert from the layer files. It does not ship the allocation, calibration, or KL programs that chose the bit widths. Text generation also needs the official FP8 checkpoint for the tensors that stayed there: norms, hyper-connections, PLE tables, and the routers (the routers are quantized to affine 8-bit at load).
Apple Silicon and MLX only. The qwen4_exp architecture currently comes from oMLX's mlx-vlm build.
Layout
Each layer directory L00 โฆ L47 holds codes.bin, scales.bf16, bias.bf16, and index.json. Ternary codes are five base-3 trits per byte. The loader unpacks them into mlx-ternary's four 2-bit codes per byte and calls the v3 kernel. Affine 2/3/4-bit codes stay in the MLX uint32 lane pack. skeleton.safetensors holds the affine 8-bit embedding and lm_head.
Weights are under the Qwen Community License 1.0. See LICENSE and NOTICE.
Setup
Use the oMLX Python, which provides MLX, mlx-vlm, and the qwen4_exp patch. Point a new virtualenv at that stack, then install mlx-ternary from a checkout of https://github.com/Jakevin/mlx-ternary (the package is also named on https://huggingface.co/Jakevin/mlx-ternary).
PY=/Applications/oMLX.app/Contents/Resources/Python/cpython-3.11/bin/python3.11
"$PY" -m venv .venv
SITE=.venv/lib/python3.11/site-packages
printf '%s\n' /Applications/oMLX.app/Contents/Resources/Python/framework-mlx-base/lib/python3.11/site-packages > "$SITE/omlx-mlx.pth"
printf '%s\n' /Applications/oMLX.app/Contents/Resources > "$SITE/omlx-root.pth"
.venv/bin/pip install --no-deps -e /path/to/mlx-ternary
Generate
--fp8 is a local copy of Qwen/Qwen3.8-Flash-Next-FP8. The script wraps the prompt with the Qwen chat template and a generation prompt, then generates. The process keeps RSS plus Metal active memory under 20 GB and caps the MLX cache at 2 GB.
.venv/bin/python generate.py --fp8 /path/to/Qwen3.8-Flash-Next-FP8 --max-tokens 8
Optional check of one ternary expert against the v3 kernel, without loading the whole model:
.venv/bin/python generate.py --self-check
Quantized