Skip to content

[Docs] Add LITELLM_MAX_BUDGET_PER_SESSION_TTL to env vars reference - #23186

Merged
yuneng-jiang merged 2 commits into
mainfrom
litellm_doc_max_budget_per_session_ttl
Mar 9, 2026
Merged

yuneng-jiang merged 2 commits into
mainfrom
litellm_doc_max_budget_per_session_ttl

Conversation

@yuneng-jiang

Copy link
Copy Markdown
Contributor

Summary

Failure Path (Before Fix)

The test_env_keys CI check scans all Python files for os.getenv() and litellm.get_secret() calls, then verifies each key is documented in config_settings.md. The new max_budget_per_session_limiter.py uses LITELLM_MAX_BUDGET_PER_SESSION_TTL but it was not added to the docs table.

Fix

Add LITELLM_MAX_BUDGET_PER_SESSION_TTL to the environment variables reference table in config_settings.md.

Testing

  • test_env_keys.py should pass with this env var now documented

Type

📖 Documentation

Add missing env var to config_settings.md to fix test_env_keys CI check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
litellm Building Building Preview, Comment Mar 9, 2026 9:40pm

Request Review

@yuneng-jiang
yuneng-jiang merged commit 1a5e215 into main Mar 9, 2026
31 of 38 checks passed
@greptile-apps

greptile-apps Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a minimal, docs-only PR that adds one missing row to the environment variables reference table in config_settings.md for LITELLM_MAX_BUDGET_PER_SESSION_TTL. The entry was absent, causing the test_env_keys CI check to fail because it detected the env var being consumed in max_budget_per_session_limiter.py but found no matching documentation.

  • The new row is inserted in correct alphabetical order (between LITELLM_MASTER_KEY and LITELLM_MAX_ITERATIONS_TTL).
  • The description ("TTL in seconds for session budget counters used by the max-budget-per-session limiter") accurately reflects the variable's usage in _PROXY_MaxBudgetPerSessionHandler.__init__.
  • The documented default of 3600 matches DEFAULT_MAX_BUDGET_PER_SESSION_TTL = 3600 in the implementation.
  • No code changes are introduced; there is no risk of behavioral regression.

Confidence Score: 5/5

  • This PR is safe to merge — it is a documentation-only change with no code modifications.
  • The single changed line is a documentation table entry. The variable name, description, and default value all accurately match the implementation in max_budget_per_session_limiter.py. No logic, configuration, or API surface is altered.
  • No files require special attention.

Important Files Changed

Filename Overview
docs/my-website/docs/proxy/config_settings.md Adds a single documentation row for LITELLM_MAX_BUDGET_PER_SESSION_TTL in alphabetical order between LITELLM_MASTER_KEY and LITELLM_MAX_ITERATIONS_TTL; description and default value accurately reflect the implementation in max_budget_per_session_limiter.py.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Proxy Startup] -->|reads env var| B["os.getenv('LITELLM_MAX_BUDGET_PER_SESSION_TTL', 3600)"]
    B --> C[_PROXY_MaxBudgetPerSessionHandler.__init__]
    C --> D{Redis available?}
    D -->|Yes| E[Register Lua atomic-increment script]
    D -->|No| F[In-memory fallback]
    E --> G[async_pre_call_hook: check session spend ≥ max_budget?]
    F --> G
    G -->|Yes| H[Raise HTTP 429]
    G -->|No| I[Allow request]
    I --> J[async_log_success_event: increment session spend by response_cost]
    J -->|TTL applied on first write| K[Cache key expires after TTL seconds]
Loading

Last reviewed commit: b4e78ac

@ishaan-berri
ishaan-berri deleted the litellm_doc_max_budget_per_session_ttl branch March 26, 2026 22:29
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…per_session_ttl

[Docs] Add LITELLM_MAX_BUDGET_PER_SESSION_TTL to env vars reference

This branch had an error being deployed

1 failed deployment
Preview — b4e78ac7 Deployed Mar 9, 2026 by vercel[bot]
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.

1 participant