A Claude Code plugin that uses a local llama.cpp LLM as a cheap pre-processing layer before cloud calls.
Three patterns:
| Pattern | When | Saves |
|---|---|---|
| Pre-filter | grep/search returns > 5 results | Cloud reads only relevant hits |
| Summarize | Reading > 3 files to answer a question | Summaries enter context, not full files |
| Route | Vague problem across 3+ modules | Searches right module first |
All patterns fail gracefully — if the local LLM is down, Claude proceeds normally.
- llama.cpp server running locally (or LM Studio with local server enabled)
- A non-thinking / fast model loaded (e.g. any Qwen3 instruct without
enable_thinking) - Claude Code ≥ 1.x
claude plugin marketplace add HermannsIT/local-filter
claude plugin install local-filter@local-filterThis installs the local-filter skill and adds the auto-trigger rules to your global CLAUDE.md.
The plugin works standalone, but pairing it with the local-qwen-subagent MCP lets Claude call the local LLM without spawning a Python subprocess each time.
LLAMA_MODEL="your-model-id" bash setup-mcp.shTo find your model ID:
curl -s http://127.0.0.1:8080/v1/models | python3 -c \
"import json,sys; [print(m['id']) for m in json.load(sys.stdin)['data']]"Custom server URL:
LLAMA_MODEL="Qwen3.6-35B-nonThinking" LLAMA_URL="http://127.0.0.1:8080" bash setup-mcp.shRestart Claude Desktop after running the script.
Add to a project's CLAUDE.md:
LOCAL_FILTER: disabled
Claude will skip all three patterns for that project.
Claude auto-invokes the skill when:
- Search results exceed 5 items → local LLM picks the relevant ones
- 3+ files need reading to answer a question → local LLM summarizes each first
- Problem is vague across multiple modules → local LLM routes to the right one
The skill uses direct HTTP calls to http://127.0.0.1:8080/v1/chat/completions with temperature: 0 — fast, deterministic, cheap.
llama-mcp-server (npm) doesn't pass a model parameter in its API requests, so it always hits the server's default model. setup-mcp.sh patches two files in the global install:
config.js: addsLLAMA_MODELenv var →modelIdclient.js: injectsmodel: modelIdinto chat requests
The patch is idempotent — safe to re-run after npm upgrades.
MIT