docs(config): prompt_cache only caches via the OpenRouter Claude route - #309
Merged
Conversation
The prompt_cache flag (#273/#302) attaches a cache_control breakpoint to the system prompt, but whether that saves anything is decided by the model string, because open-llm-proxy routes by name: - value "anthropic/claude-haiku-4.5" -> OpenRouter -> honors cache_control (verified in proxy logs: 6841-tok prefix, cache_write then cache_read, ~12x cheaper on the cached prefix) - value "claude-haiku-4-5" -> Anthropic-direct OpenAI-compat endpoint -> ignores message-embedded cache_control (prompt_tokens_details: None) The prior note steered users to 'Anthropic-routed models', which is the route where the flag does nothing. Rewrite to nudge Claude entries to the anthropic/ OpenRouter model id + prompt_cache: true, with the measured numbers and the routing table.
Coverage Report
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Corrects the
prompt_cachedocumentation added with #302. The flag attaches an Anthropiccache_controlbreakpoint to the system prompt — but whether it saves anything is decided by the model string, because open-llm-proxyget_provider_for_model()routes by name.Ground truth (proxy logs, 2026-07-10)
valueanthropic/claude-haiku-4.5cache_write_tokens:6841(1st call, $0.0086) thencached_tokens:6841(2nd call, $0.0007), ~12× cheaper on the cached prefixclaude-haiku-4-5prompt_tokens_details: None; that endpoint ignores message-embeddedcache_control(native/v1/messages-only)The previous note told users to enable it 'on Anthropic-routed models only' — which is exactly the route where the flag does nothing. This rewrite:
anthropic/…OpenRouter model id +prompt_cache: true.valuetoanthropic/claude-haiku-4.5.No code change — docs only.