Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jun 17, 2025

Summary

This PR adds support for the new Gemini 2.5 models:

  • Gemini 2.5 Pro (stable release)
  • Gemini 2.5 Flash (with thinking support)
  • Gemini 2.5 Flash Lite Preview (with thinking variant)

Changes

Added Models

  1. gemini-2.5-pro - The stable release of Gemini 2.5 Pro

    • Same configuration as gemini-2.5-pro-preview-06-05
    • Supports thinking budget (dynamic by default)
    • Tiered pricing based on context window usage
    • Required reasoning budget enabled
  2. gemini-2.5-flash - New flash model with thinking capabilities

    • Context window: 1.05M tokens
    • Max thinking tokens: 24,576
    • Supports reasoning budget
    • Pricing: $0.15/M input, $0.60/M output
    • Cache reads: $0.0375/M, Cache writes: $1.00/M
  3. gemini-2.5-flash-lite-preview-06-17 - New lightweight model

    • Regular variant (thinking disabled by default)
    • Thinking variant with :thinking suffix
    • Pricing: $0.10/M input, $0.40/M output
    • Context window: 1.05M tokens
    • Max thinking tokens: 24,576

Modified Files

  • packages/types/src/providers/gemini.ts - Added all three new models
  • packages/types/src/providers/vertex.ts - Added all three new models for Vertex AI
  • packages/types/src/providers/openrouter.ts - Added models to appropriate sets:
    • Added to OPEN_ROUTER_PROMPT_CACHING_MODELS (Flash and Flash Lite)
    • Added to OPEN_ROUTER_REASONING_BUDGET_MODELS (all three models)
    • Added to OPEN_ROUTER_REQUIRED_REASONING_BUDGET_MODELS (Pro)
  • src/api/providers/openrouter.ts - Updated OpenRouterHandler to handle reasoning tokens for gemini-2.5-pro

Testing

All linting checks have passed. The models follow the exact same schema as their preview counterparts to ensure compatibility.

References


Important

Adds gemini-2.5-pro, gemini-2.5-flash, and gemini-2.5-flash-lite-preview-06-17 models with configurations to gemini.ts, openrouter.ts, and vertex.ts, updating OpenRouterHandler for reasoning tokens.

  • Models Added:
    • gemini-2.5-pro, gemini-2.5-flash, and gemini-2.5-flash-lite-preview-06-17 added to gemini.ts, openrouter.ts, and vertex.ts.
    • gemini-2.5-pro supports dynamic thinking budget and tiered pricing.
    • gemini-2.5-flash supports reasoning budget with specific pricing.
    • gemini-2.5-flash-lite-preview-06-17 includes a thinking variant with specific pricing.
  • File Modifications:
    • gemini.ts: Added new models with configurations.
    • openrouter.ts: Integrated models into prompt caching and reasoning budget sets.
    • vertex.ts: Added models with specific configurations.
  • Behavior Changes:
    • OpenRouterHandler in openrouter.ts updated to handle reasoning tokens for both gemini-2.5-pro-preview and gemini-2.5-pro.

- Add stable gemini-2.5-pro model to gemini.ts, vertex.ts, and openrouter.ts
- Add gemini-2.5-flash-lite-preview-06-17 with thinking variant
- Configure proper pricing and thinking budget support for Flash Lite
- Add models to appropriate OpenRouter sets for reasoning budget support
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners June 17, 2025 19:09
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Jun 17, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 17, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 17, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 17, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 17, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jun 17, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 17, 2025
@hannesrudolph hannesrudolph changed the title feat: add Gemini 2.5 models (Pro and Flash Lite) feat: add Gemini 2.5 models (Pro, Flash and Flash Lite) Jun 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 17, 2025
@mrubens mrubens merged commit f18cf3d into main Jun 17, 2025
13 checks passed
@mrubens mrubens deleted the feat/add-gemini-2.5-models branch June 17, 2025 20:36
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 17, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 17, 2025
valekseev pushed a commit to valekseev/Roo-Code that referenced this pull request Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants