Text Generation
MLX
Safetensors
qwen4_exp
omlx
oq
quantized
apple-silicon
mixture-of-experts
4-bit precision
long-context
conversational
tool-calling
Instructions to use jedisct1/Qwen3.8-Flash-Next-oQ4e-128k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jedisct1/Qwen3.8-Flash-Next-oQ4e-128k 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("jedisct1/Qwen3.8-Flash-Next-oQ4e-128k") 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 jedisct1/Qwen3.8-Flash-Next-oQ4e-128k with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k"
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": "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use jedisct1/Qwen3.8-Flash-Next-oQ4e-128k with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use jedisct1/Qwen3.8-Flash-Next-oQ4e-128k 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 "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k"
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 jedisct1/Qwen3.8-Flash-Next-oQ4e-128k
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jedisct1/Qwen3.8-Flash-Next-oQ4e-128k with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k"
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 "jedisct1/Qwen3.8-Flash-Next-oQ4e-128k" \ --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"
File size: 7,135 Bytes
2b5444a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | ---
base_model:
- Qwen/Qwen3.8-Flash-Next-FP8
base_model_relation: quantized
library_name: mlx
license: other
license_name: qwen-community-1.0
license_link: LICENSE
pipeline_tag: text-generation
tags:
- mlx
- safetensors
- qwen4_exp
- omlx
- oq
- quantized
- apple-silicon
- mixture-of-experts
- 4-bit
- long-context
- conversational
- tool-calling
---
# Qwen3.8 Flash Next oQ4e 128K for oMLX
This is a community, text-only dynamic quantization of [Qwen/Qwen3.8-Flash-Next-FP8](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8) for Apple Silicon and oMLX.
It is designed for a 131,072-token context window on a Mac with 128 GiB of unified memory. The conversion removes the vision encoder and MTP head. It is not an official Qwen release.
## Quantization
The model uses oMLX enhanced importance-matrix quantization with 4-bit affine, group-size 128 weights as the default. Precision is assigned by tensor family:
- The token embedding and language-model head use 4-bit affine quantization.
- Large linear and routed-expert weights use importance-matrix-guided mixed precision.
- Sensitive attention and shared-expert matrices retain higher precision, including 8-bit floors.
- Routers, recurrent state, convolutions, normalization, residual controls, and related control tensors retain BF16.
- The 51.2B-parameter PLE n-gram bank remains split into 128 shards. Shards 0 through 3 use 2-bit affine, group size 32. Shards 4 through 127 use 3-bit affine, group size 32.
The importance matrix was collected from 1,024 tool-heavy multilingual calibration samples at sequence length 512. The included `oq_imatrix_report.json` records the allocation inputs and coverage.
The resulting checkpoint contains 18 safetensors shards and occupies 86.608 GiB. Its index contains 2,854 tensors.
## Runtime requirements
This checkpoint is not compatible with stock Transformers, stock MLX-LM, or an oMLX release without Qwen4 experimental support. The exact text model, cache integration, and mixed-bit SSD-backed PLE implementation used for validation are included under `omlx_support`.
The tested software stack is:
- Apple Silicon
- MLX and mlx-metal 0.32.1
- The MLX-LM package bundled with oMLX 0.6.3rc3
- oMLX 0.6.3rc3
- MTP disabled
The Qwen4 implementation is based on [oMLX pull request #3161](https://github.com/jundot/omlx/pull/3161) at commit `79e11cf86360ca800db5bdc45cec4ee582ada6b1`, with an adaptation for this checkpoint's per-shard 2-bit and 3-bit PLE metadata. [Pull request #3163](https://github.com/jundot/omlx/pull/3163) adds experimental MTP decoding, but MTP was not used here.
Install the tested MLX runtime inside the downloaded model directory, then launch the bundled oMLX wrapper:
```sh
hf download jedisct1/Qwen3.8-Flash-Next-oQ4e-128k \
--local-dir models/Qwen3.8-Flash-Next-oQ4e-128k
cd models/Qwen3.8-Flash-Next-oQ4e-128k
uv pip install --target .mlx-runtime mlx==0.32.1 mlx-metal==0.32.1
zsh omlx_support/serve
```
The launcher expects oMLX at `/Applications/oMLX.app`, listens only on `127.0.0.1:8766`, and uses `omlx` as its default local API key. Set `OMLX_APP_RESOURCES`, `OMLX_API_KEY`, `OMLX_PORT`, `OMLX_CACHE_DIR`, or `OMLX_MLX_RUNTIME` to override those paths and values.
It installs the included model settings into a fresh oMLX base path, permits one concurrent request, selects oMLX's balanced memory guard, disables the in-memory hot cache, memory-maps the PLE safetensors, and uses an SSD prompt cache. The context budget is total input plus generated output, so keep that total at or below 131,072 tokens.
## Recommended generation settings
Thinking mode is enabled by default. The upstream recommended settings are included in `generation_config.json`:
```text
temperature: 1.0
top_p: 0.95
top_k: 20
min_p: 0.0
presence_penalty: 0.0
repetition_penalty: 1.0
```
For multi-turn agents, preserve `reasoning_content` between tool turns and keep `preserve_thinking` enabled.
## Validation
The artifact validator found:
- 18 expected and readable safetensors shards
- 2,854 indexed and stored tensors
- No missing, unindexed, duplicated, or misplaced tensors
- All 128 PLE mixed-bit overrides applied as intended
- No missing or mismatched importance-matrix entries for measurable modules
On an M5 Max with 128 GiB of unified memory, the SSD-backed PLE implementation loaded 63.30 GB of Metal-backed model arrays. A fresh request containing 131,071 uncached prompt tokens generated one token, for exactly 131,072 total tokens, with oMLX's balanced memory guard enabled.
## Tool calling
The original chat template and XML tool-call protocol are included. Direct structured tool calls, continuation after a tool result, and a multi-turn file-write, checksum, and read-back workflow were tested successfully through oMLX and Swival.
Tool calling is stochastic and is not guaranteed to be flawless. Synthetic exact-call testing passed 17 of 18 cases with resident PLE and 16 of 18 cases with SSD-backed PLE. One failed response emitted duplicate calls. Agents should reject duplicate identical calls before execution, allow at most one bounded repair attempt, and fail closed if the repaired response remains invalid.
The duplicate-call protection used during validation is implemented by Swival and is not part of these model weights.
## Limitations
- This is a text-only conversion. Image and video inputs are unsupported.
- MTP speculative decoding is unsupported by this checkpoint.
- The architecture supports 262,144 native tokens, but this conversion was validated and operationally limited to 131,072 total tokens.
- Only the stated Apple Silicon and oMLX configuration was tested.
- Quantization can reduce quality relative to the FP8 source.
- The model can produce incorrect content, malformed tool calls, duplicate tool calls, or unsafe actions. Tool execution requires independent validation and appropriate permission boundaries.
- The model inherits the limitations and intended-use considerations of the upstream Qwen model.
## Source and license
The conversion was produced from revision `bcd9f01ddc9cff2316eb84281bebcd5b058bddce` of [Qwen/Qwen3.8-Flash-Next-FP8](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8).
The weights remain subject to the Qwen Community License 1.0. Read `LICENSE` before using or redistributing the model, particularly its terms for commercial Model as a Service and AI Work Assistant businesses.
The bundled `omlx_support` code is distributed under the Apache License 2.0 in `omlx_support/LICENSE` and includes modifications to the implementation proposed in oMLX pull request #3161.
## Citation
```bibtex
@techreport{qwen2026design,
title = {On the Design of {Qwen3.8-Next} Architecture: Evaluation, Efficiency, and Training Stability},
author = {{Qwen Team}},
institution = {Alibaba Group},
month = {August},
year = {2026}
}
@misc{qwen3.8flashnext,
title = {{Qwen3.8-Flash-Next}: A New Architecture, Towards Ultimate Cost-Efficiency},
author = {{Qwen Team}},
month = {August},
year = {2026},
url = {https://qwen.ai/blog?id=qwen3.8-flash-next}
}
```
|