Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX (v3: RW-GPTQ-Gosset-v3 + PolarQJL-BLUE 1M KV, 5.9193 WikiText-2 PPL, 50.6–52.3 tok/s, 13.27 GiB RAM)
tejadabheja/Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX is a native Apple Silicon MLX + Custom Metal C++ compression of Qwen/Qwen3.6-35B-A3B (35.95B total parameters, 3.0B active parameters/token) using DioLLLE8 v3 (Mixed-Radix Diophantine Butterfly + Residual-Writer Selective Pivoted-Cholesky GPTQ-Gosset-v3 + Unbiased PolarQJL-BLUE 1M KV Cache).
New in
v3(RW-GPTQ-Gosset-v3+PolarQJL-BLUEMathematical & Systems Upgrade — Zero Extra Weight Bytes!):
- Closes
45.3%of the entireWikiText-2perplexity gap to19 GiBMLX-4bitat0extra weight bytes (5.9951 → 5.9193vs.MLX-4bit5.8280) and strictly improves held-out Python 3.12 code perplexity (1.7000 → 1.6924), achieving8/8 (100.0%)GSM8K,4/4 (100.0%)executable Python / strict JSON / class refactoring, and50.55 tok/smean (52.28 tok/speak) lossless speculative decode on a base Apple M5 (153.6 GB/s).- Residual-Writer Selective
GPTQ-Gosset-v3(RW-GPTQ-Gosset) +D₈⁺Weyl-Chamber Exact Voronoi Pullback: Proves that applying linear HessianGPTQexclusively to the 240 linear residual-stream writers (self_attn.o_proj,linear_attn.out_proj,shared_expert.down_proj,switch_mlp.down_proj) while preserving isotropic Gosset quantization on pre-gate projections avoids downstream multiplicative gate (SwiGLU/RMSNormGated/normalize_qk) re-amplification, boosting mean backbone SQNR to29.11 dBand expert SQNR to18.56 dB(99.93%/0.003 dBof exhaustive 65,536-codeword brute-force Gosset Voronoi oracle) with 100% canonicalcodes_u32 + scales_fp16inference layout.- Unbiased
PolarQJL-BLUE(3.0625 bpp) 1M-Token KV Cache (3.996 GiB → 3.7085 GiB@1M,Slope = 1.0000): Replaces biased scalar KV scaling with our exact Householder Polar-Unbiased scaleγ_unb = ‖y‖₂² / ⟨y, z⟩(eliminating logit shrinkage bias with vanishing radial variance∝ sin²∠(q, k)on needles), causal 64-token NoPE key-mean centering (+1.25 dBfree Key SQNR), and Kronecker preconditioned transforms (24.55 dBKV SQNR,100%exact32Kpasskey retrieval).- New Ultra-Compact Sub-3-Bit Companion (
10.22 GiBRAM /9.89 GiBno-MTP,2.576 bpw,49.64 tok/s,3.14 GiB1M KV — runs on 16 GB Macs!): Seetejadabheja/Qwen3.6-35B-A3B-DioLLLE8-2.5bit-1M-MLX, powered by OpenAI First Proof #6 Spectral-Light Mixed-Bit MoE (Top-483-bit +208ε-light 2-bit experts).- Companion Recurrent-Depth Release: Looking for latent recurrent depth (
T=1/2/3passes =64 / 80 / 96effective layers +LoopCD-Hidden+2.22×MTP speedup in13.43 GiBRAM)? Seetejadabheja/Looped-Qwen3.8-27B-DioLLLE8-1M-MLX.
It bundles:
- Zero-pickle compressed
.safetensorsweights (13.435 GiBbase +0.325 GiBoptionalmtp-diollle8.safetensors=13.266 GiBresting Unified GPU RAM with MTP enabled, or12.952 GiBwithload_mtp=False) — saving4.90–5.22 GiB(27%–28.7%) of GPU RAM vs.mlx-community/Qwen3.6-35B-A3B-4bit(18.169 GiB) while staying within+0.091WikiText-2PPL (5.9193vs.5.8280) and+0.065Python 3.12 code PPL (1.6924vs.1.6275). - Swap-free
1,000,000-token live context on a 32 GB Mac (16.97 GiBtotal active GPU RAM for base weights +3.71 GiBPolarQJL-BLUE1M KV combined,0.0 MBswap) viaDioLLLE8PolarQJLKVCache(polar_hq,3.0625 bpp) and automaticYaRN 4.0×context extension. - Turnkey local OpenAI (Chat Completions, Responses, Completions) + Anthropic Messages (+ Gemini) API server & terminal chat REPL (
diollle8_mlx/serve_cli.py+api_server.py): native tool calling, streaming, extended thinking and multi-slot prefix caching. Tested end-to-end with Claude Code and the official OpenAI / Anthropic SDKs. Includes a one-command macOS installer,install_and_serve.sh(see Quick Start). - Full Preprint Paper (
paper/DIOLLLE8_PREPRINT.pdf,.tex,.md) — also hosted attejadabheja/DioLLLE8-Preprint.
v3 Head-to-Head Benchmark Summary (Apple M5 MacBook Pro, 32 GB Unified Memory)
Measured back-to-back on an idle MacBook Pro (Mac17,2, Base Apple M5 153.6 GB/s, 32 GB Unified Memory) via diollle8_mlx/benchmark_v3_dual_35b.py (raw JSON in benchmark_v3_gptq_gosset_polar.json):
| Metric | MLX-4bit (Official) | DioLLLE8-3bit (v2) | DioLLLE8-3bit (v3 — This Repo) | DioLLLE8-2.5bit (v1) |
|---|---|---|---|---|
| Effective Bits / Weight | 4.50 bpw | 3.332 bpw | 3.332 bpw | 2.576 bpw |
Backbone .safetensors Disk | 19.001 GiB | 13.435 GiB | 13.435 GiB (+0.325 MTP) | 10.388 GiB (+0.325 MTP) |
| Resting Unified GPU RAM | 18.169 GiB | 13.266 GiB | 13.266 GiB (12.95 no-MTP) | 10.220 GiB (9.89 no-MTP) |
| Cold Load Time (M5 SSD) | 5.46 s | 2.61 s | 2.61 – 2.85 s | 2.08 s |
WikiText-2 Test PPL (16K @ 2K) | 5.8280 (38.25s) | 5.9951 (24.39s) | 5.9193 (27.47s) | 6.3073 (26.27s) |
Python 3.12 Stdlib PPL (8K @ 2K) | 1.6275 (24.37s) | 1.7000 (11.26s) | 1.6924 (12.02s) | 1.8103 (13.26s) |
GSM8K Math Spot-Eval (temp=0) | — | — | 8 / 8 (100.0%) | 8 / 8 (100.0%) |
| Executable Code / JSON / Refactor | 100% | 4 / 4 (100%) | 4 / 4 (100.0%) | 4 / 4 (100.0%) |
Chat Decode (MTP K=2 + Suffix) | 54.4 tok/s | 51.3 – 53.4 tok/s | 50.55 – 52.28 tok/s (41.6 base) | 47.96 – 49.64 tok/s (41.6 base) |
1M-Token PolarQJL-BLUE KV RAM | 19.07 GiB (FP16) | 3.996 GiB | 3.7085 GiB (3.06 bpp) | 3.1409 GiB (2.59 bpp) |
32K Needle Retrieval (POLAR-GOSSET) | — | PASS | 100% EXACT (28.34 tok/s) | 100% EXACT (29.53 tok/s) |
Total RAM @ 1,000,000 Context | 38.1 GiB (Swap/OOM) | 17.49 GiB | 16.97 GiB (0.0 MB swap) | 13.03 GiB (0.0 MB swap) |
Task-by-Task v3 Speed & Functional Verification (temp = 0, Base Apple M5)
| Task | Base (tok/s) | MTP K=2 | Hybrid | Gain | Check |
|---|---|---|---|---|---|
binary_search (O(log n)) | 41.52 | 52.28 | 51.72 | 1.26× | exec() PASS |
merge_intervals | 42.26 | 51.73 | 51.96 | 1.23× | exec() PASS |
strict_json_schema | 42.50 | 46.55 | 46.05 | 1.10× | json PASS |
refactor_suffix (BillingClient) | 41.02 | 47.32 | 51.42 | 1.25× | ast PASS (362/362) |
Public Agentic, Coding & Reasoning Benchmarks (Controlled Head-to-Head vs. MLX-4bit, DioLLLE8-2.5bit & Official BF16)
Evaluated back-to-back on the same Apple M5 MacBook Pro (32 GB Unified Memory) using identical prompts, identical strided sample indices, identical sampling (temp=0.0 non-thinking; temp=0.6, top_p=0.95 thinking), and official public graders (Gorilla BFCL v4 ast_checker & live stateful Python multi_turn_checker, sandboxed execution for HumanEval & LiveCodeBench v6, exact match for MMLU-Pro, GPQA Diamond, and AIME26). Raw JSON logs: benchmark_agentic_bfcl_v4_3bit.json, benchmark_pillars_234_3bit.json, benchmark_agentic_bfcl_v4_4bit_mlx.json, benchmark_pillars_234_4bit_mlx.json, benchmark_agentic_bfcl_v4_25bit.json, benchmark_pillars_234_25bit.json.
| Benchmark / Split | DioLLLE8-3bit (13.27 GiB) | DioLLLE8-2.5bit (10.22 GiB) | MLX-4bit (18.17 GiB) | Official BF16 (~65 GiB) |
|---|---|---|---|---|
BFCL v4 — Non-Live AST Avg (100 Qs) | 92.00% | 83.00% | 91.00% | — |
↳ simple_python (25) / multiple (25) | 92.0% / 96.0% | 88.0% / 100.0% | 96.0% / 92.0% | — |
↳ parallel (25) / parallel_multiple (25) | 92.0% / 88.0% | 72.0% / 72.0% | 92.0% / 84.0% | — |
BFCL v4 — Non-Live Overall (incl. irrelevance) | 88.80% | 81.60% | 88.80% | — |
BFCL v4 — Live AST Avg (90 Qs) | 77.54% | 73.42% | 77.46% | — |
BFCL v4 — Live Overall (131 Qs) | 77.32% | 75.15% | 77.18% | — |
BFCL v4 — Multi-Turn Stateful Avg (32 eps) | 46.11% | 42.22% | 41.67% | 64.7–67.2% (v4 overall w/ thinking) |
↳ multi_turn_base (12) / miss_func (10) / miss_param (10) | 58.3% / 30.0% / 50.0% | 66.7% / 30.0% / 30.0% | 75.0% / 30.0% / 20.0% | — |
HumanEval (164/164 FULL) | 93.90% (154/164) | 90.24% (148/164) | 95.73% (157/164) | 90.2% (pub. omlx.ai MLX-4bit) |
MMLU-Pro (30 Qs, uncapped) | 76.67% (23/30) | 80.00% (24/30) | 80.00% (24/30) | 85.2% (HF Card) |
LiveCodeBench v6 (15 Qs, 16K cap)* | 26.67% (4/15) | 40.00% (6/15) | 26.67% (4/15) | 80.4% (HF Card, 32K–64K) |
GPQA Diamond (20 Qs, 16K cap)* | 50.00% (10/20) | 50.00% (10/20) | 65.00% (13/20) | 86.0% (HF Card, 32K–64K) |
AIME26 (15 Qs, 16K cap)* | 6.67% (1/15) | 6.67% (1/15) | 13.33% (2/15) | 92.7% (HF Card, 32K–64K) |
Key Takeaway:
DioLLLE8-3bit(13.27 GiB) beatsMLX-4bit(18.17 GiB) on every composite BFCL v4 agentic metric (92.00%vs.91.00%Non-Live AST,77.32%vs.77.18%Live Overall,46.11%vs.41.67%Multi-Turn Stateful —+4.44 ptsahead!), tiesMLX-4bitonLiveCodeBench v6(26.67%), and lands within 3 problems on fullHumanEval(154/164 = 93.90%vs.157/164 = 95.73%, going80/80 = 100%on the first half) — all while saving4.90 GiB(−27%) of Unified GPU RAM.* Methodology note on
LiveCodeBench v6,GPQA Diamond, andAIME26: All three local quants (includingMLX-4bit) averaged306–413 s/qand hit ourmax_tokens=16384ceiling inside<think>, whereas official Qwen3.6 BF16 evals use32K–64Ktokens +presence_penalty=1.5.
Mathematical Innovations in v3
1. D₈⁺ Weyl-Chamber Exact Gosset Voronoi Pullback & Two-Level Pivoted-Cholesky RW-GPTQ-Gosset-v3
D₈⁺Weyl-Chamber Reduction: Reduces all 240 Gosset Voronoi facets ofV(q·E₈)to just 2 dominant half-spaces (v_(8) + v_(7) ≤ qand∑ v_i ≤ 2q) plus single-step Gosset root pullback (gosset_v3_quantizer.py), achieving99.93%(0.003 dB) of exhaustive65,536-codeword brute-force Voronoi search at0extra bits and 100% compatibility with our existing8 KBSRAM LUT Metal decode kernels.- Residual-Writer Selective
GPTQ-Gosset-v3(RW-GPTQ-Gosset): Across 40 layers of strictly held-out calibration activations (verified_16gram_eval_overlap == 0), we proved empirically on35.95Bthat applying linear-HessianGPTQerror feedback to pre-gate projections (q_proj,k_proj,in_proj_qkv,in_proj_z,gate_proj,up_proj) hurts end-to-end perplexity because downstream scale-invariant / multiplicative gates (normalize_qk,RMSNormGated,SwiGLU) re-amplify sacrificed low-variance pre-gate channels. RestrictingGPTQ-Gosset-v3exclusively to the 240 linear residual-stream writers (self_attn.o_proj,linear_attn.out_proj,shared_expert.down_proj,switch_mlp.down_proj) while keeping isotropic Gosset quantization on pre-gate projections strictly improves both prose (5.9951 → 5.9193) and code (1.7000 → 1.6924) simultaneously.
2. Unbiased PolarQJL-BLUE (polar_hq & polar_qjl_2bit) 1M-Token KV Cache (polar_qjl_kv_cache.py)
Inspired by recent PolarQuant + QJL inner-product theory and Gauss–Markov BLUE estimation:
- Householder Polar-Unbiased Scale: Standard nearest-lattice KV quantization shrinks inner products (
E[⟨q, k̂⟩] < ⟨q, k⟩), causing attention entropy drift at128K–1Mcontext. Setting the per-block scale toγ_unb = ‖y‖₂² / ⟨y, z⟩makesk̂ = γ_unb · zstrictly unbiased (Slope = 1.0000) for every deterministic lattice quantizer, while decomposing error orthogonally so radial variance vanishes as∝ sin²∠(q, k)on high-similarity needle keys. - Causal 64-Token NoPE Key-Mean Centering + Kronecker Transform: Subtracting a rollback-safe causal 64-token running mean
μ_kon unrotated RoPE dimensions yields+1.25 dBfree Key SQNR, whileU₂₅₆ = D_pre · (H₄ ⊗ U₆₄)smears cross-group outliers across all 256 head dimensions, cutting1M-token 3-bit KV RAM from3.996 GiBto3.7085 GiB(24.55 dBSQNR). - Gauss–Markov Wiener-BLUE Fusion (
2.5-bit/polar_qjl_2bit): Fuses 2-bit Gosset centroids with an orthogonal-subspace 1-bitPolarQJLresidual sign sketch (2.75×lower variance than i.i.d. Gaussian QJL) via zero-overhead scale foldingλₜ* = sec²θₜ / (sec²θₜ + σ_B²)(0extra decode FLOPs).
Authorship, Upstream Open-Source Credits & AI Provenance Disclosure
Transparent AI-Primary Credit & Open-Source Attribution: Almost 100% of the mathematical research, red-team verification, Metal C++ kernel engineering, benchmarking, and documentation in this release was performed autonomously by AI systems in response to high-level human prompts, building directly on verified open-source community and mathematical research:
- Core Mathematical Formulation (
DioLLLE8v1–v3): Co-developed autonomously by Gemini Carbon / Nano, Claude Fable, GPT Astra 6.0, and Antigravity (Google DeepMind) multi-agent math & systems swarm (D₈⁺Weyl-chamber Gosset pullback,RW-GPTQ-Gosset-v3,PolarQJL-BLUEWiener-BLUE KV cache, and OpenAI First Proof #6 ε-light spectral MoE compression).- Upstream Speculative & Thinking-Budget Inspiration (
v2/v3): Special credit to David Y. Tan (turbo-tan/tqllm,Apache-2.0) for pioneering training-free suffix-copy continuation drafting, live-cache--thinking-budgetgraceful</think>closure without re-prefilling, andO(1)deferred-commit speculative verification on hybrid Qwen3.5/3.6 MLX architectures; to Jason Titus (sliderforthewin/Looped-Qwen3.8-27B,MIT); and to the Qwen Team forQwen/Qwen3.6-35B-A3B.- Human Role (
tejadabheja/ Tejas Phatak): Prompting, problem framing, red-team direction, hardware execution host, and Hugging Face stewardship.
Complete Setup & Usage Instructions
System Requirements
- Hardware: Apple Silicon Mac (
M1,M2,M3,M4, orM5)- 16 GB Unified Memory: Runs
4K–16Kcontext (12.95 GiBwithload_mtp=False), or useQwen3.6-35B-A3B-DioLLLE8-2.5bit-1M-MLX(9.89–10.22 GiBRAM!) for spacious 16 GB operation. - 24 GB Unified Memory: Smoothly runs up to
256K+context. - 32 GB+ Unified Memory: Smoothly runs the full
1,000,000-token context (16.97–17.29 GiBtotal active GPU RAM,0.0 MBswap).
- 16 GB Unified Memory: Runs
- OS & Python: macOS
14.0+, Python3.11+(3.12recommended).
Quick Start: One-Command Install & Launch (macOS, Apple Silicon)
# Without cloning first: sets up uv + .venv, downloads the model, starts the OpenAI/Anthropic server on :8080
curl -fsSL https://huggingface.co/tejadabheja/Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX/resolve/main/install_and_serve.sh | bash
# From inside a downloaded copy of this repo:
./install_and_serve.sh # install deps on first run, then serve on http://127.0.0.1:8080
./install_and_serve.sh --claude # start the server in the background and open Claude Code on it
./install_and_serve.sh --chat # interactive terminal chat
./install_and_serve.sh --port 9000 --enable-thinking --thinking-budget 2048 # other flags go to serve_cli
./install_and_serve.sh --install-only # only create .venv and install dependencies
The script checks for macOS on arm64 and installs uv if it is missing. It creates .venv (Python 3.12) and installs mlx, mlx-lm, transformers, safetensors and huggingface_hub, and downloads the weights only when they are not already present. If a DioLLLE8 server is already running on the port, it re-uses it. In --claude mode it waits for /health, launches Claude Code with the right environment variables, and stops the server when Claude Code exits.
Step 1: Install Environment & Download Checkpoint
uv venv .venv --python 3.12
source .venv/bin/activate
uv pip install "mlx>=0.30.0" "mlx-lm>=0.30.0" "transformers>=4.51.0" "safetensors>=0.4.5" "huggingface_hub>=0.28.0" numpy
hf download tejadabheja/Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX --local-dir ./Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX
cd ./Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX
Step 2A: Local OpenAI + Anthropic API Server (Claude Code, Codex, Cursor, OpenWebUI, …)
python -m diollle8_mlx.serve_cli --port 8080 # HTTP server (model type and KV bits are auto-detected)
python -m diollle8_mlx.serve_cli --port 8080 --enable-thinking --thinking-budget 2048 # <think> on by default
The server prints the exact client settings at startup. One process serves all of these API shapes from the same model and the same prefix cache:
| API | Endpoints | Supported |
|---|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions | streaming (+stream_options.include_usage), tools / tool_choice (auto/none/required/named), assistant tool_calls + tool results, reasoning_effort → <think> with reasoning_content deltas, response_format (json_object/json_schema, best-effort via prompt), stop, max_completion_tokens, usage.prompt_tokens_details.cached_tokens |
| OpenAI Responses | POST /v1/responses, GET/DELETE /v1/responses/{id} | input string or items (message, function_call, function_call_output, reasoning), instructions, function tools, previous_response_id, reasoning.effort, max_output_tokens, full SSE event sequence (response.created … response.completed) |
| OpenAI Completions / Models | POST /v1/completions, GET /v1/models[/{id}] | streaming, echo, token-id prompts |
| Anthropic Messages | POST /v1/messages, POST /v1/messages/count_tokens | system (string/blocks, incl. interleaved system messages), tools → tool_use / tool_result (incl. is_error), tool_choice (auto/any/tool/none), extended thinking (thinking.type enabled/adaptive/disabled, budget_tokens, display: omitted) → thinking blocks, stop_sequences → stop_reason: stop_sequence, max_tokens, full SSE event sequence (message_start, content_block_*, ping, message_delta, message_stop), Anthropic-style errors |
| Gemini | POST /v1beta/models/{m}:generateContent / :streamGenerateContent / :countTokens | text, functionDeclarations → functionCall, thinkingConfig |
Tool calls use the model's native Qwen3.6 XML tool format and are parsed with the open-source mlx-lm qwen3_coder tool parser (derived from Qwen's qwen3coder_tool_parser.py), with a bundled fallback copy. Images, PDFs and audio are replaced with a text placeholder because this server is text-only.
Claude Code
ANTHROPIC_BASE_URL=http://127.0.0.1:8080 \
ANTHROPIC_AUTH_TOKEN=local \
ANTHROPIC_MODEL='Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX[1m]' \
ANTHROPIC_SMALL_FAST_MODEL=Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX \
ANTHROPIC_DEFAULT_HAIKU_MODEL=Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
CLAUDE_CODE_AUTO_MODE_SERVER=0 \
API_TIMEOUT_MS=1800000 \
claude
- The
[1m]suffix tells Claude Code the model has a 1M-token window. Without it, Claude Code assumes 200K and auto-compacts. You can also setCLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000. - Any model name works: the server serves its one loaded model whatever name you send.
- Auto mode (
Shift+Tab, or--permission-mode auto): Claude Code normally asks the Anthropic API to run its safety classifier server-side. A local server cannot provide Anthropic's hosted classifier, so without extra settings Claude Code reports that127.0.0.1:8080"doesn't pass it through" and falls back to asking you.CLAUDE_CODE_AUTO_MODE_SERVER=0is the documented setting that makes Claude Code send its own classifier requests instead. They go to this server like any other request, so the local model acts as the safety classifier. That is weaker than Anthropic's hosted review, so keep that in mind for risky work, or use Manual /acceptEditsmode. The server keeps the classifier's long prompt in its own prefix-cache slot. The first classifier call prefills about 30K tokens; later calls reuse the cache.install_and_serve.sh --claudesets this variable for you. - Claude Code sends
thinking: {type: "adaptive"}by default. That follows the server's--enable-thinkingsetting (off by default, which is faster). Override it with--adaptive-thinking/--no-adaptive-thinking. - Claude Code's first request is a ~20K-token system prompt plus tools, so the first turn takes about 45 s on a base M5 (~19.5K tokens at ~440 tok/s prefill). We measured later turns at 0.1-1 s of prefill. After that, prefix caching re-uses the conversation: later turns only prefill the new tokens.
- If you set
--api-key KEY, useANTHROPIC_AUTH_TOKEN=KEY.
OpenAI-compatible clients (OpenAI SDK, Codex CLI, Cursor, Continue, Cline, OpenWebUI, LiteLLM): base URL http://127.0.0.1:8080/v1, any API key.
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="local")
r = client.chat.completions.create(model="Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX", messages=[{"role": "user", "content": "Hi"}],
tools=[{"type": "function", "function": {"name": "get_weather", "parameters": {
"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}])
print(r.choices[0].message.tool_calls)
Useful flags: --host / --port, --api-key, --served-model-name, --max-tokens (default when the client sends none), --temp + --force-temp, --enable-thinking / --adaptive-thinking / --thinking-budget, --cache-slots (prefix-cache sessions kept warm; default 3: main agent, auto-mode classifier and side calls), --kv-bits (default 3), --chunk-size, --speculative / --num-draft / --suffix-copy. Set DIOLLLE8_DUMP_REQUESTS=/tmp/d8req to save every incoming request body for debugging.
How it works: HTTP requests are handled on many threads, but all MLX/GPU work runs on one dedicated worker thread, so /health, /v1/models and count_tokens answer even during a long generation. Requests queue in order, a client disconnect cancels its generation, and SSE keep-alive pings are sent during long prefills.
[!NOTE] LM Studio: not supported. DioLLLE8 weights use custom E8-lattice / rotated-domain quantization that needs the bundled Metal kernels. LM Studio's MLX engine only loads stock mlx-lm affine-quantized models and does not run custom model code (
trust_remote_code=False). Useserve_cliabove instead: it exposes the same OpenAI-compatible API that LM Studio's server does.
Step 2B: Interactive 1M-Context Terminal Chat REPL
python -m diollle8_mlx.serve_cli --chat # /think toggles <think>, /stats, /reset, /exit
Step 2C: Python API (v3 RW-GPTQ-Gosset + PolarQJL-BLUE 1M Caching)
import sys
from huggingface_hub import snapshot_download
model_dir = snapshot_download("tejadabheja/Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX")
sys.path.insert(0, model_dir)
from diollle8_mlx import (
load_diollle8_qwen35_model,
generate_diollle8,
prefill_chunked,
save_e8_cache,
load_e8_cache,
)
model, tokenizer = load_diollle8_qwen35_model(model_dir, enable_1m_yarn="auto", load_mtp=True)
messages = [{"role": "user", "content": "Write an O(log n) Python search_range(nums, target) function."}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
res = generate_diollle8(
model,
prompt,
tokenizer=tokenizer,
max_tokens=384,
temp=0.0,
speculative="auto",
num_draft=2,
suffix_copy=True,
)
print(res["text"])
print(f"Decode: {res['decode_tps']} tok/s | Accept: {res.get('acceptance_rate', 0):.1%}")
Preprint Paper & Citation
Bundled in paper/DIOLLLE8_PREPRINT.pdf and hosted at tejadabheja/DioLLLE8-Preprint.
@misc{diollle8_v3_2026,
title = {Breaking the Walsh--Hadamard Rational Kernel Trap: Diophantine-Butterfly Nested-{E8} Lattice Quantization, Residual-Writer {GPTQ-Gosset}, and {PolarQJL-BLUE} 1M-Context Inference on Consumer Apple Silicon},
author = {Phatak, Tejas},
note = {AI-Primary Autonomous Research \& Engineering by Gemini Carbon/Nano, Claude Fable, GPT Astra 6.0, and Google DeepMind Antigravity; speculative \& thinking-budget runtime inspired by David Y. Tan (tqllm) and Jason Titus (Looped-Qwen3.8-27B)},
year = {2026},
howpublished = {\url{https://huggingface.co/tejadabheja/Qwen3.6-35B-A3B-DioLLLE8-3bit-1M-MLX}}
}