Roo-Code/packages
Murilo Pires a0018c9d04
feat: add prompt caching support for LiteLLM (#5791) (#6074)
* feat: add prompt caching support for LiteLLM (#5791)

- Add litellmUsePromptCache configuration option to provider settings
- Implement cache control headers in LiteLLM handler when enabled
- Add UI checkbox for enabling prompt caching (only shown for supported models)
- Track cache read/write tokens in usage data
- Add comprehensive test for prompt caching functionality
- Reuse existing translation keys for consistency across languages

This allows LiteLLM users to benefit from prompt caching with supported models
like Claude 3.7, reducing costs and improving response times.

* fix: improve LiteLLM prompt caching to work for multi-turn conversations

- Convert system message to structured format with cache_control
- Handle both string and array content types for user messages
- Apply cache_control to content items, not just message level
- Update tests to match new message structure

This ensures prompt caching works correctly for all messages in a conversation,
not just the initial system prompt and first user message.

* fix: resolve TypeScript linter error for cache_control property

Use type assertion to handle cache_control property that's not in OpenAI types
2025-07-28 12:56:06 -07:00
..
build Sharing improvements (#5082) 2025-06-24 16:36:32 -04:00
cloud Bugfix: Cloud: be more specific about session error codes (#6051) 2025-07-22 07:16:15 -07:00
config-eslint Upgrade to ESLint 9 + share eslint config across workspaces (#3815) 2025-05-21 21:30:21 -07:00
config-typescript Roo Code Cloud (#4069) 2025-05-28 20:43:30 -07:00
evals Use SIGKILL for command execution timeouts in the "execa" variant (#6071) 2025-07-23 01:47:10 -07:00
ipc Farewell jest (#4607) 2025-06-16 21:39:45 -07:00
telemetry Git repo cloud telemetry (#5119) 2025-06-25 17:01:32 -07:00
types feat: add prompt caching support for LiteLLM (#5791) (#6074) 2025-07-28 12:56:06 -07:00