Conversation
…e map with ZoneInfo (#21754) * fix(budget): fix timezone config lookup and replace hardcoded timezone map with ZoneInfo * fix(budget): update stale docstring on get_budget_reset_time
… in streaming_handler (#21750) * fix: add return type annotations to iterator protocol methods in streaming_handler Add missing return type annotations to __iter__, __aiter__, __next__, and __anext__ methods in CustomStreamWrapper and related classes. - __iter__(self) -> Iterator["ModelResponseStream"] - __aiter__(self) -> AsyncIterator["ModelResponseStream"] - __next__(self) -> "ModelResponseStream" - __anext__(self) -> "ModelResponseStream" Also adds AsyncIterator and Iterator to typing imports. Fixes issue with PLR0915 noqa comments and ensures proper type checking support. Related to: #8304 * fix: add ruff PLR0915 noqa for files with too many statements
Show how to use gollem, a production Go agent framework, with LiteLLM proxy for multi-provider LLM access including tool use and streaming.
* server root path regression doc * fixing syntax * fix: replace Zapier webhook with Google Form for survey submission (#21621) * Replace Zapier webhook with Google Form for survey submission * Add back error logging for survey submission debugging --------- Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com> * Revert "Merge pull request #21140 from BerriAI/litellm_perf_user_api_key_auth" This reverts commit 0e1db3f, reversing changes made to 7e2d6f2. * test_vertex_ai_gemini_2_5_pro_streaming * UI new build * fix rendering * ui new build * docs fix * docs fix * docs fix * docs fix * docs fix * docs fix * docs fix * docs fix * release note docs * docs * adding image * fix(vertex_ai): enable context-1m-2025-08-07 beta header The `context-1m-2025-08-07` Anthropic beta header was set to `null` for vertex_ai, causing it to be filtered out when users set `extra_headers: {anthropic-beta: context-1m-2025-08-07}`. This prevented using Claude's 1M context window feature via Vertex AI, resulting in `prompt is too long: 460500 tokens > 200000 maximum` errors. Fixes #21861 --------- Co-authored-by: yuneng-jiang <yuneng.jiang@gmail.com> Co-authored-by: milan-berri <milan@berri.ai> Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile SummaryThis staging PR bundles three independent changes:
Additional minor changes: ruff lint suppressions for three proxy files, sidebar navigation update, and documentation for IANA timezone support. Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| litellm/litellm_core_utils/duration_parser.py | Replaces hardcoded timezone offset map with ZoneInfo for proper IANA timezone and DST support. Variable rename from timezone to tz avoids shadowing the stdlib timezone class. |
| litellm/litellm_core_utils/streaming_handler.py | Adds return type annotations to iterator protocol methods (__iter__, __aiter__, __next__, __anext__). No behavioral changes. |
| litellm/proxy/common_utils/timezone_utils.py | Replaces general_settings dict lookup with getattr(litellm, "timezone", None), eliminating circular import risk and aligning with how proxy_server.py sets litellm_settings as module attributes. |
| tests/test_litellm/litellm_core_utils/test_duration_parser.py | Adds tests for previously-unsupported IANA timezones (Tokyo, Sydney, Chicago) and DST transitions (fall-back and spring-forward). All tests are pure mock-free unit tests. |
| tests/test_litellm/proxy/common_utils/test_timezone_utils.py | Removes fastapi.testclient import, adds tests for get_budget_reset_timezone (reading litellm attr, fallback to UTC, None handling, timezone-aware reset). Tests properly clean up litellm module state. |
| ruff.toml | Adds PLR0915 (too-many-statements) ignore rules for three proxy files and fixes missing newline at EOF. |
| docs/my-website/docs/proxy/budget_reset_and_tz.md | Adds documentation note about IANA timezone support via Python's zoneinfo module and automatic DST handling. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["proxy_server.py startup"] -->|"setattr(litellm, 'timezone', value)"| B["litellm.timezone module attribute"]
C["get_budget_reset_timezone()"] -->|"getattr(litellm, 'timezone', None)"| B
C -->|"fallback"| D["'UTC'"]
C --> E["get_budget_reset_time(budget_duration)"]
E --> F["get_next_standardized_reset_time()"]
F --> G["_setup_timezone(current_time, timezone_str)"]
G -->|"new: ZoneInfo(timezone_str)"| H["Proper IANA tz with DST"]
G -->|"old: hardcoded map lookup"| I["Fixed UTC offset - no DST"]
H --> J["_handle_day_reset / _handle_hour_reset / ..."]
J --> K["Next reset datetime in correct timezone"]
Last reviewed commit: 52585eb
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes