Google announced that Gemini 2.0 Flash and Flash Lite models will be discontinued on March 31, 2026. Updated deprecation_date field for all affected model variants across different providers (vertex_ai, gemini, deepinfra, openrouter, vercel_ai_gateway).
Models updated:
- gemini-2.0-flash (added deprecation date)
- gemini-2.0-flash-001 (updated from 2026-02-05)
- gemini-2.0-flash-lite (added deprecation date)
- gemini-2.0-flash-lite-001 (updated from 2026-02-25)
All variants now correctly reflect the March 31, 2026 shutdown date.
- Add @lru_cache decorator to get_model_info() and _cached_get_model_info_helper()
- Update _invalidate_model_cost_lowercase_map() to clear these caches when model_cost changes
- Update test to call cache invalidation after modifying litellm.model_cost
Reduces get_model_cost_information from 46% to <1% of request handling time.
* perf: Optimize use_custom_pricing_for_model with set intersection
Cache CustomPricingLiteLLMParams.model_fields.keys() as a module-level
frozenset and use set intersection to reduce loop iterations from 882k
to 90k (only iterating over keys that exist in both sets).
Performance improvement: 84% faster (6.3x speedup)
- Before: 1.17s total, 65µs per call
- After: 0.19s total, 10µs per call
* Use .get() for defensive dictionary access
* perf: Optimize strip_trailing_slash with O(1) index check
Replace rstrip("/") with direct index check for O(1) performance
instead of O(n) string scanning.
Results:
- strip_trailing_slash: 311ms → 13ms (96% faster)
- get_standard_logging_object_payload: 6.11s → 5.80s (5% faster)
* Handle multiple trailing slashes in strip_trailing_slash
Use rstrip for correctness when URL ends with "//" or more,
otherwise use O(1) index check for single trailing slash.
* Fix: SSO user roles are not updated for existing users
Fixes#19620
* Refactor: Remove redundant user_info retrieval in SSOAuthenticationHandler
* Test: add new tests for user creation and updates in get_user_info_from_db