Image-Text-to-Text
MLX
Safetensors
qwen3_5_moe
vision-language
multimodal
code
conversational
4-bit precision
Instructions to use sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit 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("sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit") config = load_config("sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit") # 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 sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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 "sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit"
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": "sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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 "sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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 "sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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"
- Hermes Agent
How to use sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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 "sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-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 sluttybutfast/KAT-Coder-V2.5-Dev-Vision-OptiQ-4bit
Run Hermes
hermes
| #!/usr/bin/env python3 | |
| """ | |
| Memory-efficient verification. Streams tensors one at a time via | |
| safetensors mmap instead of loading whole models into RAM. | |
| Verifies: merged LM == A, merged vision == B. | |
| """ | |
| import hashlib | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import numpy as np | |
| from safetensors import safe_open | |
| def build_key_index(model_dir: Path) -> dict: | |
| """Map each tensor name -> the shard file that contains it.""" | |
| idx = {} | |
| for f in sorted(model_dir.glob("*.safetensors")): | |
| with safe_open(f, framework="numpy") as sf: # metadata only | |
| for k in sf.keys(): | |
| idx[k] = f | |
| return idx | |
| def get_tensor_np(index: dict, key: str): | |
| """Fetch a single tensor as float32-normalized numpy for hashing.""" | |
| f = index[key] | |
| with safe_open(f, framework="pt") as sf: # pt handles bf16 | |
| t = sf.get_tensor(key) | |
| # torch tensor -> float32 numpy (lossless for bf16; passthrough others) | |
| import torch | |
| if t.dtype == torch.bfloat16: | |
| t = t.to(torch.float32) | |
| return t.numpy() | |
| def h(np_arr) -> str: | |
| return hashlib.sha256(np_arr.tobytes()).hexdigest()[:16] | |
| def check(name, merged_idx, ref_idx, prefix): | |
| keys = sorted(k for k in merged_idx if k.startswith(prefix)) | |
| mismatches = [] | |
| for i, k in enumerate(keys): | |
| if k not in ref_idx: | |
| mismatches.append((k, "missing in reference")) | |
| continue | |
| hm = h(get_tensor_np(merged_idx, k)) | |
| hr = h(get_tensor_np(ref_idx, k)) | |
| if hm != hr: | |
| mismatches.append((k, "hash differs")) | |
| if (i + 1) % 100 == 0: | |
| print(f" {name}: checked {i+1}/{len(keys)}…") | |
| print(f"\n=== {name} ===") | |
| print(f"Checked {len(keys)} mismatches: {len(mismatches)}") | |
| for k, why in mismatches[:30]: | |
| print(" !!", k, "-", why) | |
| return not mismatches | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("-a", "--finetune", required=True) | |
| ap.add_argument("-b", "--base", required=True) | |
| ap.add_argument("-m", "--merged", required=True) | |
| ap.add_argument("--only", choices=["lm", "vision", "both"], | |
| default="both") | |
| args = ap.parse_args() | |
| print("Indexing (metadata only, no tensor loads)…") | |
| a_idx = build_key_index(Path(args.finetune)) | |
| b_idx = build_key_index(Path(args.base)) | |
| m_idx = build_key_index(Path(args.merged)) | |
| lm_ok = vis_ok = True | |
| if args.only in ("lm", "both"): | |
| lm_ok = check("LM (merged vs A)", m_idx, a_idx, "language_model.") | |
| if args.only in ("vision", "both"): | |
| vis_ok = check("VISION (merged vs B)", m_idx, b_idx, "vision_tower.") | |
| print("\n=== SUMMARY ===") | |
| if args.only in ("lm", "both"): | |
| print(f"LM == A: {'PASS' if lm_ok else 'FAIL'}") | |
| if args.only in ("vision", "both"): | |
| print(f"VIS == B: {'PASS' if vis_ok else 'FAIL'}") | |
| print("✅ VERIFIED" if (lm_ok and vis_ok) else "❌ MISMATCH") | |
| if __name__ == "__main__": | |
| main() | |