Skip to main content

Crate mimir_proxy

Crate mimir_proxy 

Source
Expand description

Mimir’s optional local API proxy (“Headroom”-style, our own implementation).

It sits between the agent and api.anthropic.com: forwards every request verbatim (streaming SSE back untouched) EXCEPT it may rewrite the body of POST /v1/messages to add prompt-cache breakpoints, dedup repeated blocks, and (optionally) prune stale tool results. Cache savings are MEASURED from the response’s usage.cache_read_input_tokens; dedup/prune are measured at the request.

It is OFF by default (you start it with mimir proxy) and it is a man-in-the-middle on your prompts/completions — see docs/proxy.md. Auth headers pass through untouched; the proxy never reads your API key.

Structs§

Optimization
Tokens removed by the request-side passes, for the savings ledger. Cache savings are NOT here — they’re measured from the response.
OptimizeOpts
ProxyConfig

Functions§

optimize_request
serve
Run the proxy until the process is killed.