litellm - ✅(Solved) Fix [Feature]: add support priority/flex paygo for gemini-2.5-flash and gemini-2.5-flash-lite [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#23388Fetched 2026-04-08 00:37:01
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×2

Fix Action

Fixed

PR fix notes

PR #23389: feat(vertex_ai): add priority/flex pricing configs for gemini-2.5 models

Description (problem / solution / changelog)

Relevant issues

Fixes #23388

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🆕 New Feature

Changes

  • Updated model_prices_and_context_window.json to include priority/flex pricing logic for Vertex AI gemini-2.5-flash and gemini-2.5-flash-lite models.

Changed files

  • model_prices_and_context_window.json (modified, +14/-2)
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

The Feature

Recently, with #21560, priority/flex paygo pricing was added for Vertex AI. While this is correctly configured for newer models (like Gemini 3 and 3.1), it is missing for gemini-2.5-flash and gemini-2.5-flash-lite. This PR adds the missing priority/flex pricing configs for the Gemini 2.5 models.

see vertex ai pricing

Motivation, pitch

I want to ensure accurate cost tracking for users still utilizing the Gemini 2.5 family. Currently, these models lack the priority/flex pricing logic that is already available for newer models, causing incorrect cost reporting.

What part of LiteLLM is this about?

Proxy

LiteLLM is hiring a founding backend engineer, are you interested in joining us and shipping to all our users?

No

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To add the missing priority/flex pricing configs for the Gemini 2.5 models, follow these steps:

  • Update the pricing configuration to include the Gemini 2.5 models
  • Add the priority/flex pricing logic for these models

Example code snippet:

# Update the pricing configuration
pricing_configs = {
    'gemini-3': {'priority': 1, 'flex': True},
    'gemini-3.1': {'priority': 1, 'flex': True},
    'gemini-2.5-flash': {'priority': 2, 'flex': False},  # Add this line
    'gemini-2.5-flash-lite': {'priority': 2, 'flex': False}  # Add this line
}

# Add the priority/flex pricing logic
def get_pricing(model_name):
    if model_name in pricing_configs:
        config = pricing_configs[model_name]
        if config['flex']:
            # Apply flex pricing logic
            return calculate_flex_price(model_name)
        else:
            # Apply priority pricing logic
            return calculate_priority_price(model_name, config['priority'])
    else:
        # Handle unknown models
        return None

Verification

To verify that the fix worked, check the cost reporting for users utilizing the Gemini 2.5 models and ensure that the correct priority/flex pricing is applied.

Extra Tips

  • Make sure to update the documentation to reflect the changes to the pricing configuration and logic.
  • Test the changes thoroughly to ensure that the correct pricing is applied for all models.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Feature]: add support priority/flex paygo for gemini-2.5-flash and gemini-2.5-flash-lite [1 pull requests, 1 participants]