Instructions to use ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4") config = load_config("ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4"
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": "ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 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 "ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4"
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 ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4"
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 "ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4" \ --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-4bit-e4o8-ngram4
Qwen/Qwen3.8-Flash-Next の MLX 4bit 版。 e4o8(エキスパート 4bit・ほか 8bit)の n-gram 埋め込みだけを 4bit にして、 一律 4bit とほぼ同じ大きさに収めたもの。道具の使い方は一律 4bit より良く、e4o8 よりは少し落ちる。
- サイズ: 106 GiB(5.136 bits per weight、モデルサーバーのメモリは最大 115GB を観測)
- 量子化(affine):
- ルーティングされるエキスパート(
switch_mlp.{gate,up,down}_proj): 4bit g32 - n-gram 埋め込み(
ple.ple_embedding.ngram_embedding.shards.*、128 モジュール・約 51B パラメータ): 4bit g32 - 注意機構・共有エキスパートなど、ほかの線形層: 8bit g32(ルーターは 8bit g64)
- 画像部分: 量子化しない(bf16)
- ルーティングされるエキスパート(
作り方
e4o8 の n-gram 埋め込みの重みを、一律 4bit 版(revision f128069、bf16 から直接 4bit g32)の
同じ名前の重みにそのまま差し替えた(丸め直しはしていない)。config.json にはそのモジュールごとに {"group_size": 32, "bits": 4} を書いてある。
n-gram 埋め込みは e4o8 の 130 GiB のうち 54 GiB を占める。
評価
思考オフ、温度 0.6・top_p 0.95・top_k 20、各ケース 5 回。mlx-vlm 0.7.11 のモデルサーバーを直接使い、MTP なし。 probe は日本語・英語の短い問答 34 問、道具は呼び出しの場面 20 種を日本語と英語でそれぞれ。
| 8bit | 一律 4bit | e4o8-ngram4 | e4o8 | |
|---|---|---|---|---|
| probe 正答 | 100% | 100% | 100% | 100% |
| 日本語の道具 | 97% | 94% | 99% | 99% |
| 英語の道具 | 88% | 80% | 92% | 98% |
| 正しい呼び出し形式(英語) | 100% | 95% | 98.5% | 100% |
| 重みの大きさ | 186 GiB | 104 GiB | 106 GiB | 130 GiB |
| 生成速度(MTP なし) | — | 46.6 tok/s | 37.0 tok/s | 38.5 tok/s |
| 生成速度(MTP あり) | — | 48.7 tok/s | 37.0 tok/s | 39.0 tok/s |
生成速度は M3 Ultra、温度 0・400 トークン × 3 問の平均。
- 一律 4bit の主な失敗: 要らない場面での道具呼び出し、3 件並べて呼ぶべきところを 1 件だけ、設定ファイルを読む道具の使い間違い(いずれも 5 回中 5 回)。
- e4o8-ngram4 は英語で、道具の呼び出しを本文にそのまま書く失敗が 100 回中 2 回あった(e4o8・8bit では 0 回)。
- 8bit が e4o8 より悪い理由は分かっていない(エキスパート以外の重みは両者で同じ)。
- 長い会話・画像入力は試していない。
使い方
pip install -U mlx-vlm
python -m mlx_vlm generate --model ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 \
--prompt "この画像を説明してください" --image path/to/image.jpg --max-tokens 512
MTP ドラフター(投機デコード)
ドラフターは別リポジトリ Qwen3.8-Flash-Next-MTP-bf16(mlx-vlm 0.7.0 以降)。 この量子化ではほとんど速くならなかった(上の表)。
python -m mlx_vlm generate --model ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4 \
--draft-model ToPo-ToPo/Qwen3.8-Flash-Next-MTP-bf16 \
--draft-kind mtp --prompt "..." --max-tokens 512
- Downloads last month
- 45
8-bit
Model tree for ToPo-ToPo/Qwen3.8-Flash-Next-mlx-4bit-e4o8-ngram4
Base model
Qwen/Qwen3.8-Flash-Next