- Active Prefix-Cache Surgeon + X-Ray Diff
- Anthropic
cache_controlinjection - Basic Secret & PII redaction
- Local Ollama MLX Turbo acceleration
- Self-hosted Docker + SQLite Cockpit
OPEN-CORE ACTIVE AGENT GATEWAY • v0.1.0
Your coding agents are bleeding 90% of their prompt cache on every turn.
Passive LLM proxies watch your bill burn. CacheSurgeon operates in flight—sorting randomized tool schemas, relocating per-second timestamps, warming idle 5-minute TTL caches, vaulting leaked .env secrets, and blocking rogue rm -rf / DROP TABLE tool calls before execution.
- Prefix Cache Healed
- 0% → 98.7%
- Local MLX Speedup
- 64× faster
- Surgical Overhead
- < 2 ms
hash: 9f41a02c
hash: 1cdfcd90
FIVE SURGICAL INTERVENTIONS IN < 2 MILLISECONDS
Why engineers outgrow passive LLM wrappers.
-
01
Active Prefix-Cache Surgeon + Byte-Level X-Ray
Go, Python, and JS agent harnesses serialize tool JSON maps in non-deterministic order and stamp per-second clocks into line 1 of the system prompt. CacheSurgeon sorts schemas deterministically, relocates volatile metadata to the trailing user turn, and injects Anthropic
cache_controlbreakpoints automatically.MEASURED 40–87% token cost cut -
02
Net-Savings TTL Cache Warmer
Anthropic's default 5-minute cache TTL punishes code reviews and coffee breaks: returning at minute 6 forces a full 1.25× cache rebuild. CacheSurgeon pings only when
cold_rebuild_cost > 2× ping_costand accounts for Gross Savings − Ping Spend transparently.ANTHROPIC 5M TTL 10× cheaper than rebuild -
03
Reversible Secret & PII Egress Vault
When a coding agent runs
printenvor reads.env, AWS keys, Stripe tokens, JWTs, PEM blocks, and database URLs are scrubbed into session-scoped opaque tokens (__CS_AWS_ACCESS_KEY_01__) before cloud egress—zero plaintext secrets ever touch third-party APIs or audit logs.ZERO PLAINTEXT 11+ secret/PII detectors -
04
In-Flight Tool-Call & MCP Execution Firewall
Inspects model-emitted OpenAI
tool_callsand Anthropictool_useblocks before they execute on developer laptops or CI runners. Neutralizesrm -rf,DROP TABLE,curl | bash, force-pushes tomain, and SSH key reads at the proxy boundary.PRE-EXECUTION CISO audit trail ready -
05
Semantic Loop Circuit Breaker & Safe Same-Family Failover
Detects repeating failing edit → pytest death spirals (OWASP Denial of Wallet) and injects a root-cause Pivot Directive or trips a hard USD ceiling. On upstream
429rate limits, safely downgrades within the same model family—or fails over to local Ollama only when explicitly enabled.OWASP LLM10 Hard $ session budget cap
FINOPS TELEMETRY SIMULATOR
Calculate your team's silent cache bleed.
Estimate what unhealed prompt caches and idle 5-minute TTL expirations cost your engineering org every year.
AIR-GAPPED ED25519 LICENSING • ZERO TOKEN MARKUP
Keep 100% of your savings. Pay flat, not per token.
- Everything in Community
- Net-Savings 5-Min TTL Cache Warmer
- Reversible Secret Vault re-hydration
- Autonomous Loop Pivot & Hard Trip Breaker
- Printable Executive ROI & Audit Receipt
- Everything in Pro
- In-Flight Tool-Call & MCP Execution Firewall
- Multi-workspace USD budgets & DLP rules
- 100% air-gapped VPC / Docker verification
- Priority engineering & custom model tables
DROP-IN COMPATIBILITY • ONE ENV VAR
Prove the savings on your own agents in 30 seconds.
Works out-of-the-box with Codex, Claude Code, Cursor, Horizon Zero, OpenHands, and any OpenAI or Anthropic SDK. Zero vendor lock-in. Zero telemetry leaves your machine.
# 1. Install & launch CacheSurgeon locally (or via docker compose up -d)
pip install git+https://github.com/jsumpter415/cachesurgeon.git
cachesurgeon start --port 8787
# 2. Point your coding agent at CacheSurgeon
export OPENAI_BASE_URL="http://127.0.0.1:8787/v1"
export ANTHROPIC_BASE_URL="http://127.0.0.1:8787"
# 3. Inspect live savings & export an expense-ready CTO receipt
open http://127.0.0.1:8787
cachesurgeon receipt --out monthly-roi.html