Instructions to use jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp 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("jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp") config = load_config("jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp") # 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 jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp"
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 "jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp" \ --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"
- Hermes Agent
How to use jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp 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 "jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp"
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 jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ8e-mtp
Run Hermes
hermes
oQ6e version?
Thanks for this quant. Could you either provide the script you mention in the README (or elaborate what I need to do to "Fuse KAT's per-expert MoE tensors into the fused layout mlx-vlm expects (gate first, then up).") or provide a oQ6e variant? A 6-bit version works well with the default oMLX memory limit on a 64GB machine with the full 256k context.
Thanks!
Thanks โ and the README deserved this question. It claimed "fully scripted," but only the fusion was
actually a script; the MTP graft was done inline during the build session and never saved. Both are
now in the repo under build/, and the README section is rewritten to match reality:
build/merge_kat_vl.pyโ the fusion you quoted, plus the vision tower copy.build/graft_mtp.pyโ the MTP head.
They take torch + safetensors only, neither imports omlx, and each hardcodes its paths as
constants at the top โ edit those and run them in order. Budget ~146 GB free disk (65 GB KAT source
- 11 GB donor shards + 70 GB output); peak RAM is ~8 GB, so your 64 GB machine is fine for the build
as well as for serving.
On the fusion specifically, since that's the line you quoted โ KAT ships every expert separately aslayers.{L}.mlp.experts.{i}.{gate,up,down}_proj.weight. mlx-vlm's qwen3_5_moe sanitize pops a
fused experts.gate_up_proj with no default, so a per-expert checkpoint dies with a KeyError on
layer 0. Per layer, stack all 256 experts:
gate_up_proj = stack_i( cat([gate_i, up_i], dim=0) )โ[256, 1024, 2048]โ gate first,
because sanitize splits atshape[-2] // 2and takes[:mid]as the gate halfdown_proj = stack_i( down_i )โ[256, 2048, 512]
No transposes; it's pure re-packing. Verified bit-exact by round-tripping random (layer, expert)
samples back through mlx-vlm's own split.
On oQ6e โ the recipe covers it directly. oMLX won't requantize an already-quantized checkpoint, so
no new level can come from this repo; it starts from the bf16 merge either way. Once you have that
(steps 1โ2, ~15 min of compute), oQ6e is step 3 with "oq_level": 6. Valid levels are 2, 2.5, 2.7,
3, 3.5, 4, 5, 6, 8.
One caveat worth knowing before you spend the disk: a preserved MTP head can lose draft acceptance
badly at lower levels โ oMLX's own quantizer warns it can collapse toward ~0%. This build measures
~84% at oQ8e. Check the MTP[n] โฆ accept= line in the server log on your oQ6e before trusting the
speedup; if it has collapsed, you're better off serving with MTP disabled, in which case you may as
well strip the mtp.* tensors and get a checkpoint that loads in stock MLX too.
If you do build one and the acceptance rate holds up, I'd be glad to hear the number โ that's a data
point I don't have.
Thanks for elaborating. ๐
I saw you already uploaded https://huggingface.co/jason-schulz/KAT-Coder-V2.5-Dev-VL-oQ6e-mtp (as well as a 4-bit version), so I'll take those for now.
What I have done in my local builds is to separate the vision tower as the MTP head into their own .safetensors file each, so that they're easily transplantable (or removable). I'm still curious to try the original bf16 MTP head to see where acceptance lies (and whether any possible gain there isn't eaten up by the increased cost of evaluation...).