8000 feat: enable prompt caching for gemini-2.5-flash-preview-05-20 by shariqriazz · Pull Request #3907 · RooCodeInc/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: enable prompt caching for gemini-2.5-flash-preview-05-20 #3907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2025

Conversation

shariqriazz
Copy link
@shariqriazz shariqriazz commented May 24, 2025

Closes: #3901

Description

This PR enables supportsPromptCache for the gemini-2.5-flash-preview-05-20:thinking and gemini-2.5-flash-preview-05-20 models within both the vertexModels and geminiModels configurations in src/shared/api.ts. This change allows these specific Gemini models to utilize prompt caching, which can improve performance and reduce costs for repetitive prompts.

Test Procedure

This change is a configuration update for model capabilities.

  • No new unit tests were added as this is a direct configuration change.
  • Existing API integration tests for Gemini models should continue to pass.
  • Manual verification would involve observing prompt caching behavior if a specific testing environment for it is available.

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes. (N/A for this configuration change)
    • All tests pass locally (npm test). (Assuming existing tests pass)
    • The application builds successfully with my changes. (Assuming successful build)
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required. (This change is an internal model configuration and likely does not require user-facing documentation updates.)

Additional Notes

None.

Get in Touch

shariqriaz


Important

Enables prompt caching for gemini-2.5-flash-preview-05-20 models in src/shared/api.ts to improve performance and reduce costs.

  • Configuration Update:
    • Enables supportsPromptCache for gemini-2.5-flash-preview-05-20:thinking and gemini-2.5-flash-preview-05-20 models in src/shared/api.ts.
    • Affects vertexModels and geminiModels configurations.
  • Testing:
    • No new unit tests added; existing tests should pass.
    • Manual verification of prompt caching behavior if environment available.

This description was created by Ellipsis for 82ee51e. You can customize this summary. It will automatically update as commits are pushed.

@@ -783,7 +783,7 @@ export const geminiModels = {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
supportsPromptCache: true,
Copy link

Choose a reason for hiding this comment

The 8000 reason will be displayed to describe this comment to others. Learn more.

Enabled prompt caching for Gemini model gemini-2.5-flash-preview-05-20. Consider whether cache pricing details (e.g. cacheReadsPrice/cacheWritesPrice) are needed for this model.

@shariqriazz
Copy link
Author
shariqriazz commented May 24, 2025

@mrubens do we need to add cache pricing in vertex models also? i don't see it in pro-preview either in vertex so i just added for geminimodels at the moment

also do we keep pro-exp which doesnt work anymore and 04-17 flasg which is now replaced by 05-20 flash?

@mrubens mrubens merged commit ff50a47 into RooCodeInc:main May 24, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 24, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No caching shown for Gemini 2.5 Flash via Google Gemini
2 participants
0