Instructions to use Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX 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("Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX") 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 Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX"
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": "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX 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 "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX"
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 Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX"
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 "Foresee/Qwen3.8-9B-heretic-uncensored-4bit-MTPLX" \ --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-9B Heretic Uncensored - 4-bit MLX + MTP (MTPLX)
Fast local build of rohit267/Qwen3.8-9B-heretic-uncensored for Apple Silicon, tuned for native-MTP speculative decoding with MTPLX.
Measured 21.25 -> 40.05 decode tok/s (+88%) on an M5 24GB MacBook, lossless (exact speculative verify - the emitted tokens match the target model's own decoding).
Contents
| File | What it is |
|---|---|
model.safetensors (+ index) |
4-bit affine MLX trunk, group size 64 (4.5 bpw, ~5.0 GB) |
mtp.safetensors |
Native MTP head sidecar (Qwen3.5-9B lineage) |
mtp-adapter-r64.npz |
Trained C4 LoRA MTP adapter (rank 64) that lifts draft acceptance on this fine-tune |
mtplx_runtime.json |
MTPLX runtime contract (depth, hidden variant, sampler) |
The adapter is merged at load time; it is not baked into mtp.safetensors, so the
base sidecar stays reusable.
How it was built
- Convert the BF16 source to 4-bit MLX:
mlx_lm.convert --q-bits 4 --q-group-size 64. - Graft the Qwen3.5-9B MTP sidecar, then train a rank-64 C4 LoRA adapter on hidden states captured from this 4-bit trunk (coding + math + long-code calibration). Training the adapter on the final trunk is required - an adapter calibrated on a different trunk pairs wrongly.
- Serve with a tape-replay GDN verify kernel at draft depth 2.
Full lever study (every quantization / depth / adapter-rank / verify-core tested): see the autoresearch repo linked below.
Run it
Requires macOS 14+, Apple Silicon, and MTPLX (brew install youssofal/mtplx/mtplx).
mtplx serve \
--model . \
--model-id qwen-heretic \
--mtp --depth 2 \
--profile sustained \
--verify-strategy capture_commit \
--verify-core linear-gdn-from-conv-tape \
--mtp-adapter mtp-adapter-r64.npz --merge-mtp-adapter \
--host 127.0.0.1 --port 8080
Serves OpenAI /v1/chat/completions and Anthropic /v1/messages (Claude Code / OMP compatible).
Notes / caveats
- Apple Silicon + MLX only. The MTP fast path is MTPLX-specific.
- Lossy trunk, lossless decode. 4-bit quantization changes the weights; the speculative decode itself is exact-verify, so output matches the 4-bit target model.
- This fine-tune always opens with a
<think>block; budget tokens accordingly. - Draft acceptance on the benchmark suite is ~0.71 at depth 2; depth 3+ does not pay on this hybrid (GatedDeltaNet) 9B. ~40 tok/s is the honest lossless ceiling on this model / this hardware.
License
Apache-2.0, inherited from the Qwen3.5-9B base.
- Downloads last month
- 12,044
4-bit