Show HN: AirMind – Zig and Metal Qwen4-35B engine and local agent for 16GB Macs A developer released AirMind, a zero-dependency inference engine written from scratch in Zig 0.17.1 with custom Apple Metal GPU shaders, built to run the Qwen4-35B-A3B model and a built-in local coding agent on 16 GiB MacBooks without swap. In its default IQ2 Resident Mode, AirMind holds a 10.6 GiB UD-IQ2_XXS model fully in unified memory and reports 250–300 tok/s prefill and 25–36 tok/s decode, while a 4-bit streaming mode (--iq4) reaches 14–18 tok/s decode and 70–120 tok/s prefill on 16 GiB of RAM. The engine ships a disk-persisted KV+GDN prefix cache that restores 1,100+ system and tool tokens in about 54 ms on repeat launches, zero-RAM stochastic N-gram speculative decoding that accepts up to roughly 40% free tokens, 9 built-in agent tools, and an OpenAI-compatible HTTP server via `airmind serve`. Zero-dependency Zig + Apple Metal GPU inference engine and built-in local coding agent for Qwen4-35B-A3B — engineered to run fast on a 16 GiB MacBook. AirMind compiles to a single native binary with zero external runtime dependencies no Python runtime required for inference, no llama.cpp, no PyTorch, no HTTP hop between the agent and the model . Just run ./zig-out/bin/airmind to launch a resident in-process coding & web agent powered by custom Metal shaders. - From-Scratch Zig 0.17.1 + Native Apple Metal GPU - Custom simdgroup matrix hardware GEMM prefill, 0-barrier warp QSA attention, 128-TG in-register GDN recurrence, and adaptive expert-grouped MoE. - Full 13-format GGML quantization support F32 , F16 , BF16 , Q8 0 , Q4 K , Q5 K , Q6 K , IQ4 NL , IQ4 XS , IQ3 XXS , IQ2 S , IQ2 XS , IQ2 XXS , bit-exact against libggml . - Custom - Built-In In-Process Coding & Web Agent Default Mode - Bare ./zig-out/bin/airmind launches directly into an interactive coding agent with zero HTTP overhead between the agent loop and the GPU engine. - 9 built-in tools : - Auto-run read-only: list files , read file , grep files , web search no API key , web fetch , plot chart Unicode sparkline + bar chart . - Interactive approval y es / n o / a lways or --yolo : write file , edit file , run shell . - Auto-run read-only: - UTF-8 / CJK-aware terminal line editor : full Left/Right/Home/End cursor navigation, mid-line insert/delete across wrapped Chinese + English text, Up/Down history, live prefill/tool-generation progress bars, and automatic two-stage context compaction. - Bare - Instant Startup & Speculative Acceleration - Disk-persisted KV+GDN prefix cache /tmp/airmind prefix .zqs : restores 1,100+ system + tool tokens in ~54 ms on repeat launches ~1s cold boot to ready . - Zero-RAM Stochastic N-gram Speculative Decoding : exact Leviathan rejection sampling compatible with temperature , min p , and repeat penalty — accepts up to ~40% free tokens when generating code & unit tests with 0 MiB extra weights. - Fits 16 GiB Apple Silicon Without Swap - IQ2 Resident Mode default on ≤18 GiB Macs : 10.6 GiB UD-IQ2 XXS fully resident in unified memory 250–300 tok/s prefill, 25–36 tok/s decode . - 4-Bit Streaming Mode --iq4 : explicit 2-slab GPU Hot-Expert LRU Cache + 8-thread F NOCACHE NVMe streaming 14–18 tok/s decode, 70–120 tok/s prefill on 16 GiB RAM, zero desktop lag . - Optional Loop4-HC v3.0 Recurrent Depth --smart / --deep : zero-LoRA 34.8 MB BF16 Depth-AttnRes sidecar looping L12..27 T=2/3 , Prompt-Split keeps full prefill speed + bounded --think-budget . - OpenAI-Compatible HTTP Server airmind serve - Full SSE streaming, OpenAI tools / delta.tool calls / role: "tool" , and multi-conversation KV+GDN state snapshotting. - Full SSE streaming, OpenAI - macOS on Apple Silicon M1/M2/M3/M4, 16 GiB+ Unified Memory recommended; pure-Zig CPU fallback included - Zig 0.17.1 brew install zig One command: builds ReleaseFast binary + auto-downloads optimal model for your Mac's RAM <=18 GiB RAM - IQ2 XXS + Loop4-HC sidecar; =24 GiB RAM - 4-bit IQ4 XS + Loop4-HC sidecar zig build setup Launch AirMind Local Coding Agent zero flags needed ./zig-out/bin/airmind Other build & setup options: zig build setup -Dmodel=iq2 Force 2-bit full-resident model + Loop4-HC sidecar zig build setup -Dmodel=iq4 Force 4-bit UD-IQ4 XS hardlinks Shard 2 if IQ2 exists zig build setup -Dmodel=all Download both IQ2 and IQ4 + Loop4-HC sidecar zig build Offline build only defaults to ReleaseFast zig build test Run full unit test suite Debug safety checks Default: Built-in Local Coding Agent auto-detects Apple Silicon RAM/cores & local models ./zig-out/bin/airmind Extra reasoning presets ./zig-out/bin/airmind --smart Loop4-HC v3.0 T=2 Prompt-Split higher IQ, full prefill speed ./zig-out/bin/airmind --deep Loop4-HC T=2 + 320-token bounded