Running Claude Code Offline on an M3 Pro with Qwen3.6: 4 Fixes That Made It Work

Claude Code connects to a local model on an Apple M3 Pro (18 GPU cores, 36GiB unified memory, ~150 GB/s bandwidth) running qwen3.6:35b-a3b-coding-nvfp4 — a 35.1B-parameter MoE model with ~3B active per token, NVFP4 quantized, ~21GB on disk and ~20GiB resident. The setup took a Kubernetes incident from investigation to PR: found root cause, wrote patch, pushed branch, filed PR via gh — all air-gapped. Four fixes turned a model that timed out in 10 minutes into one that closes the loop. Speed is hardware-bound; capability is not.
Stack and Environment
- Hardware: Apple M3 Pro, 18 GPU cores, 36 GiB unified memory, ~150 GB/s memory bandwidth
- Model:
qwen3.6:35b-a3b-coding-nvfp4 - Runtime: Ollama 0.24.0, MLX runner (Apple Silicon-native)
- Client: Claude Code v2.1.84 pointed at local Ollama endpoint
Key environment variables (set in a launchd plist for persistence):
OLLAMA_MLX=1
OLLAMA_CONTEXT_LENGTH=32768
OLLAMA_FLASH_ATTENTION=1
OLLAMA_MULTIUSER_CACHE=1
OLLAMA_KEEP_ALIVE=24h
OLLAMA_NO_CLOUD=1
Setup Steps
- Install Ollama 0.24.0+
ollama pull qwen3.6:35b-a3b-coding-nvfp4(~21GB one-time)- Start server with the env vars above
- Launch Claude Code:
ANTHROPIC_BASE_URL=http://localhost:11434 MAX_THINKING_TOKENS=0 claude --model qwen3.6:35b-a3b-coding-nvfp4 - Smoke test:
Run kubectl get pods -A and tell me if anything appears unhealthy
Performance Notes
First tool call: seconds (thinking disabled). Prefill (loading ~25K tokens) takes ~60s. Subsequent turns are faster due to prefix caching (OLLAMA_MULTIUSER_CACHE). The model stays loaded via OLLAMA_KEEP_ALIVE=24h. Burst of 404s in Ollama log during prefill is normal (fix #4).
The MoE architecture is key: only ~3B active per token, so runtime cost resembles a 14B dense model while answers approach 35B. A dense 35B doesn't fit 36GiB.
📖 Read the full source: HN LLM Tools
👀 See Also

Sylve: A FreeBSD Management Plane for Virtualization, Containers, and Storage
Sylve is a BSD-2 licensed management plane for FreeBSD that provides unified control over Bhyve VMs, FreeBSD Jails, ZFS storage, and networking. It uses a RAFT consensus model for clustering and includes Samba share management with ZFS snapshot automation.

Engram v1.0.0: Persistent Memory for Local LLMs via Knowledge Graph
Engram is a single binary that provides persistent memory for local LLMs through a knowledge graph system. It includes an MCP server for integration with Claude Code, Cursor, and Windsurf, stores all data in a single .brain file, and runs fully offline.

LLMock: HTTP-based mocking server for deterministic LLM testing across processes
LLMock is a real HTTP server that mocks OpenAI, Claude, and Gemini APIs, allowing developers to run deterministic tests across multiple processes without hitting real APIs. It supports SSE streaming, tool calls, predicate routing, and request journaling with zero dependencies.

OpenJet v0.4: Zero-Config Local Coding Agent with llama.cpp Backend
OpenJet v0.4 is an open-source terminal coding agent for local LLMs that auto-detects hardware, configures llama.cpp, and provides a Claude Code-style workflow with no API keys.