Instructions to use p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit 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("p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit") 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 p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit"
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": "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit 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 "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit"
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 p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit"
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 "p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit" \ --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"
Qwen3.8-Flash-Next-MLX-BEAM-4bit
Experimental โ work in progress. Text generation works (smoke-tested, see below). Images do not work yet: the vision tower is shipped, but no runtime uses it from here. Quality was not measured by us - the weights are bit-identical to the source build, whose card carries the numbers.
MLX build of Qwen3.8-Flash-Next (125B-A6B hybrid Gated-DeltaNet / sparse-attention MoE with a 51B hashed n-gram embedding) for Apple Silicon. The weights are those of pipenetwork/Qwen3.8-Flash-Next-MLX-mixed-4_8bit - 4-bit routed experts, 8-bit everything else - repackaged in the B.E.A.M. layout: the bf16 vision tower moved out of the first shard into extras/, a hardened chat template, and a manifest that records the bit allocation. 106 GB on disk. No multi-token-prediction head (the source ships none).
The architecture (qwen4_exp) is not in a released mlx-lm; the package ships qwen4_exp.py (the source build's runtime file, unchanged) and declares it via model_file, hence --trust-remote-code.
What is in the package
This is a B.E.A.M. package: a standard MLX checkpoint plus everything the base model ships beyond the language model, kept as separate, index-listed parts under extras/. Any loader that follows model.safetensors.index.json finds them; nothing here depends on a particular runtime. (B.E.A.M. is the engine this layout is built for; it is not published yet โ the package works without it.)
| Part | File | Note |
|---|---|---|
| Chat template | chat_template.jinja |
10 KiB โ hardened chat template (Unsloth pattern): leading system/developer messages merged into one system block, reasoning_effort 'high' mapped to 'xhigh', no exception for a conversation without a user turn |
| Vision tower (bf16) | extras/vision.safetensors |
333 tensors, 856 MiB โ split out of model-00001.safetensors; patch_embed.proj.weight transposed from the PyTorch conv layout to MLX (out, T, H, W, in) |
| Allocation | extras/allocation.json |
bits per module, schema v1 |
| Manifest | extras/manifest.json |
sizes and SHA-256 of every part |
extras/manifest.json lists every part with its size and SHA-256, and extras/allocation.json records which module got how many bits.
Quantization
Affine MLX quantization, group size 64 unless noted - taken over unchanged from the source build. This package repackages, it does not re-quantize; nothing about the allocation was measured by us.
| Group | Bits |
|---|---|
routed experts (switch_mlp, 96.6 % of the parameters) |
4 |
| hashed n-gram embedding tables (128 shards) | 4, group size 32 (row width 160 is not a multiple of 64) |
attention, DeltaNet, hyper-connection mixers, shared experts, PLE projections, embed_tokens, lm_head |
8 |
MoE routers, gates, DeltaNet in_proj_a/b, indexer projection |
bf16 |
| vision tower | bf16 |
extras/allocation.json lists every quantized module with its bits (module names as in the quantization map of config.json; a quantized module not listed there takes the default of 4 bit). The source card explains why this split was chosen and gives paired per-window NLL results against bf16 and against the uniform 4-bit, 6-bit and 8-bit builds - they apply here unchanged.
Use
Text, with mlx-lm:
pip install -U mlx-lm
mlx_lm.generate --model p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit --trust-remote-code --prompt "Explain the difference between a list and a tuple in Python." --max-tokens 200
from mlx_lm import load, generate
model, tokenizer = load("p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit", trust_remote_code=True)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Explain the difference between a list and a tuple in Python."}],
add_generation_prompt=True)
print(generate(model, tokenizer, prompt=prompt, max_tokens=200))
Images: the vision tower is in the package (extras/vision.safetensors, listed in the index), but no runtime uses it from here yet. mlx-lm is text-only. mlx-vlm would run the tower with its own qwen4_exp implementation, but a model_file in config.json takes precedence there, and qwen4_exp.py is an mlx-lm text model (no ModelConfig, no tower) - so mlx-vlm does not load this package at all. Text via mlx-lm only, for now.
What has been checked
Mac mini M4 Pro, 64 GB unified memory, 2026-09-14, mlx 0.32.2 / mlx-lm 0.31.3:
- Layout - every part matches
extras/manifest.json(bytes, SHA-256, tensor count); the index is complete and names all 333 vision tensors inextras/vision.safetensors; the 432 routed-expert tensors are byte-identical to the source's uniform 4-bit build (the mixed build differs from it only in the 8-bit groups). - Text - the package is larger than that machine's memory, so it ran under our own expert-streaming loader (routed experts and n-gram tables read from SSD on demand, 5.4 GB resident): greedy output on two short prompts and a 3.7k-token prompt is coherent; 3.9 tokens/s decode and about 120 tokens/s prompt processing there. A smoke test, not a benchmark, and not a stock-mlx-lm run.
- Not checked - loading with stock mlx-lm on a machine with enough memory (128 GB or more); the hardened chat template with tool calls on this model; the vision tower (no runtime, see above); quality (bit-identical weights, see the source card).
License
Qwen Community License 1.0, as the base model. qwen4_exp.py is the runtime file of the source build (port code: https://github.com/PipeNetwork/qwen38-flash-next-mlx).
- Downloads last month
- 895
4-bit
Model tree for p4ik/Qwen3.8-Flash-Next-MLX-BEAM-4bit
Base model
Qwen/Qwen3.8-Flash-Next