mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
Takeover of #1988 (OpenRouter prompt caching), reimplemented on current master: supports_prompt_cache may now be a per-model-id predicate; the OpenRouter recipe marks openai/* chat and anthropic/claude-* routes cacheable. Claude routes get an explicit cache_control on the system content block via the recipe compat fetch shim (OpenRouter's documented per-block format, not a top-level body field), signaled through a private in-process marker header instead of the promptCacheKey sentinel that now collides with the real OpenAI prompt_cache_key derivation. Cache reads on OpenAI-compatible routes surface via the SDK's cachedInputTokens. Root fix for #1135: deepseek, groq, and together now declare expansion touchpoints (their expansion path is the same plain OpenAI-compatible languageModel call as chat), so an explicit expansion_model pointed at them no longer silently yields zero expansion. Co-authored-by: Garry Tan <garrytan@gmail.com> Co-authored-by: tmchow <tmchow@users.noreply.github.com> Co-authored-by: warkcod <warkcod@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>