Skip to content

Comments

Litellm oss staging 02 22 2026#21877

Open
krrishdholakia wants to merge 6 commits intomainfrom
litellm_oss_staging_02_22_2026
Open

Litellm oss staging 02 22 2026#21877
krrishdholakia wants to merge 6 commits intomainfrom
litellm_oss_staging_02_22_2026

Conversation

@krrishdholakia
Copy link
Member

Relevant issues

Pre-Submission checklist

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

  • I have Added testing in the tests/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

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

LeeJuOh and others added 6 commits February 21, 2026 19:35
…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>
@vercel
Copy link

vercel bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Error Error Feb 22, 2026 4:14am

Request Review

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2026

CLA assistant check
All committers have signed the CLA.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

This staging PR bundles three independent changes:

  1. Timezone handling overhaul: Replaces the hardcoded timezone offset map in duration_parser.py with Python's zoneinfo.ZoneInfo, enabling support for all IANA timezones and automatic DST handling. The timezone_utils.py module is simplified to read the timezone from litellm.timezone (set via setattr by proxy_server.py at startup) instead of importing general_settings from proxy_server — eliminating a circular import risk.

  2. Streaming handler type annotations: Adds return type annotations (Iterator/AsyncIterator/ModelResponseStream) to the iterator protocol methods on CustomStreamWrapper. No behavioral changes.

  3. Gollem Go agent framework cookbook: Adds a new cookbook example demonstrating how to use the gollem Go agent framework with LiteLLM as a proxy gateway, including basic, streaming, and tool-use examples.

Additional minor changes: ruff lint suppressions for three proxy files, sidebar navigation update, and documentation for IANA timezone support.

Confidence Score: 4/5

  • This PR is safe to merge — the timezone refactor is a clear improvement with good test coverage, and the other changes are low-risk.
  • Score of 4 reflects: well-tested timezone changes with DST coverage, correct use of ZoneInfo replacing a buggy hardcoded map, proper cleanup of circular import pattern, and type-only changes to streaming handler. Deducted 1 point because this is a staging PR bundling multiple unrelated changes (timezone fix, type annotations, cookbook), and the PR description checklist items are unchecked.
  • No files require special attention — the core logic changes in duration_parser.py and timezone_utils.py are well-covered by new tests.

Important Files Changed

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"]
Loading

Last reviewed commit: 52585eb

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

15 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants