Skip to content
Local · 98K window · Tool use

Claude Code on local Qwen.

One switch runs new sessions of your normal claude on Qwen 3.8 27B on your Mac's Metal GPU, through llama.cpp, with a 98K window and tool use. Your code and prompts stay on the Mac.

Before you start

  • Apple Silicon Mac with at least 32 GB unified memory for Qwen 3.8 27B. On 16 GB or 24 GB, Gemma 4 12B qualifies too.
  • Claude Code installed (run claude --version to verify).
  • ToolPiper installed (free DMG from modelpiper.com/download).

Setup

  1. 1

    Download Qwen 3.8 27B in ToolPiper

    Open Choose a language model on ToolPiper's Home screen. ToolPiper recommends Qwen 3.8 27B at 32 GB or more, and Choose another lists the rest, each with its size and how well it fits this Mac. Claude Code needs a model trained for at least 98,304 tokens, which this one is.

  2. 2

    Turn on Engine in the Claude Code row

    Under Connect your coding agent on Home, turn on Engine in the Claude Code row and pick Qwen. It takes a few seconds. ToolPiper writes a few entries to Claude Code's user settings and gives Claude Code its own entry of the model at 98,304 tokens. Sessions you already have open stay as they are.

  3. 3

    Start a new session

    Run your normal command. The first message also loads the model.

    shell
    claude
    # /model lists your ToolPiper models.
    # This session runs on your Mac.
  4. 4

    Add the tools if you want them

    Engine decides which model thinks, and Tools, the switch beside it, decides what the agent can do. It runs this command for you, and a new session has the tools.

    shell
    claude mcp add -s user --transport http toolpiper http://127.0.0.1:9998/mcp
  5. 5

    Turn it off when you are done

    Turn Engine off. New sessions go back to your Anthropic account and the settings file returns as ToolPiper found it. If you picked a model with /model in a session, run /model once more there.

Why this recipe

Fully local

GGUF on Metal GPU, llama.cpp, your filesystem. Your code and prompts stay on the Mac. ToolPiper's resource scheduler evicts cleanly when memory pressure hits.

Real tool use

The switch offers only models that carry tool calls, so Claude Code's Bash, Edit, Read and Write all work, locally.

Burst to cloud anytime

Hit a hard problem? Pick a cloud model you added in /model. That session moves to it, and the other sessions stay where they are.

Frequently asked

Which model size should I pick?

At 32 GB or more, Qwen 3.8 27B. On 16 GB or 24 GB, Gemma 4 12B. The switch lists only the models trained for at least 98,304 tokens that fit this Mac's memory, so you don't have to guess.

Why does Claude Code need a 98K window?

Claude Code holds about 33K back for compaction whatever the window is, and it compacts between 65K and 70K of usage at its lowest setting. The window still has to hold the reply and the compaction. A local chat stays at its own window, and the same model in chat and in Claude Code at once loads twice.

How long does compaction take?

On a large local model, a turn that holds a compaction takes minutes. An ordinary turn is shorter, and a smaller model such as Gemma 4 E4B is quicker at both. Each model compacts on its own, so sessions on different models don't affect each other.

How does this compare to Ollama?

ToolPiper uses the same llama.cpp engine Ollama wraps. The difference is the platform around it: over 450 MCP tools, browser automation, an Anthropic proxy with provider switching, and resource intelligence. See the comparison page.

Can I run Claude Code and other AI clients against the same Qwen model?

Yes. ToolPiper serves /v1/chat/completions (OpenAI-shape) and /v1/messages (Anthropic-shape) simultaneously. Claude Code runs its own entry of the model at its larger window, so its memory counts separately from the other clients' entry.

Ready to try it?

ToolPiper is a free download. Configure once and Claude Code routes through your Mac.

Other Claude Code recipes