Local LLM compresses long prompts before they reach Claude – MCP server
1–3 of 3 posts
Re: Local LLM compresses long prompts before they reach Claude – MCP server
#2I built a two-stage prompt compressor that runs entirely locally before your prompt hits any frontier model API.
How it works:
1. llama3.2:1b (via Ollama) compresses the prompt to its semantic minimum
2. nomic-embed-text validates that the compressed version preserves the original meaning (cosine ≥ 0.85)
3. If validation fails → original is returned unchanged. No silent corruption.
When it actually helps:
The effect is meaningful only on longer inputs. Short prompts are skipped entirely — no cost, no risk.
┌─────────────────────────────────┬────────────┬────────┐
│ Input │ Tokens │ Saving │
├─────────────────────────────────┼────────────┼────────┤
│ Re: Local LLM compresses long prompts before they reach Claude – MCP server
#3would love to hear what you say abot it