Commit graph

35638 commits

Author SHA1 Message Date
Ishaan Jaffer
1fbf098108 fix: address remaining greptile issues - Windows compat, YAML quoting, credential flow
- guard termios/tty imports with try/except ImportError for Windows compat
- quote master_key as YAML double-quoted scalar (same as env vars)
- remove unused port param from _build_config signature
- _validate_and_report now returns the final key so re-entered creds are stored
- add test for master_key YAML quoting
2026-03-17 13:23:35 -07:00
Ishaan Jaffer
6d95ddef4c style: black format setup_wizard.py 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
7ab9d06c3e address greptile review: fix yaml escaping, port validation, display name collisions, tests
- setup_wizard.py: add _yaml_escape() for safe YAML embedding of API keys
- setup_wizard.py: add _styled_input() with readline ANSI ignore markers
- setup_wizard.py: change DIVIDER to _divider() fn to avoid import-time color capture
- setup_wizard.py: validate port range 1-65535, initialize before loop
- setup_wizard.py: qualify azure display names (azure-gpt-4o) to avoid collision with openai
- setup_wizard.py: work on env_copy in _build_config to avoid mutating caller's dict
- setup_wizard.py: skip model_list entries for providers with no credentials
- setup_wizard.py: prompt for azure deployment name
- setup_wizard.py: wrap os.execlp in try/except with friendly fallback
- setup_wizard.py: wrap config write in try/except OSError
- setup_wizard.py: fix _validate_and_report to use two print lines (no \r overwrite)
- setup_wizard.py: add .gitignore tip next to key storage notice
- setup_wizard.py: fix run_setup_wizard() return type annotation to None
- scripts/install.sh: drop pipefail (not supported by dash on Ubuntu when invoked as sh)
- scripts/install.sh: use litellm[proxy] from PyPI (not hardcoded dev branch)
- scripts/install.sh: guard /dev/tty read with -r check for Docker/CI compat
- scripts/install.sh: remove --force-reinstall to avoid downgrading dependencies
- tests/test_litellm/test_setup_wizard.py: 13 unit tests for _build_config and _yaml_escape
2026-03-17 13:23:35 -07:00
Ishaan Jaffer
cd85a3b2c7 refactor(setup_wizard): class with static methods, use check_valid_key from litellm.utils 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
d5b7b515c0 style(install.sh): show git clone warning in blue 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
bab4f16a4c feat(setup_wizard): credential validation after key entry + clear next-steps after proxy start 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
967fd46134 fix(setup_wizard): use sysconfig binary to start proxy, not python -m litellm 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
8413fbca29 feat(setup_wizard): arrow-key selector, updated model names 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
cf1b12b48a fix(install.sh): warn about git clone duration, drop --no-cache-dir so re-runs are faster 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
fa1c412912 fix(install.sh): redirect stdin from /dev/tty on exec so wizard gets terminal, not exhausted pipe 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
29fa7c0f75 fix(install.sh): use sysconfig.get_path('scripts') to find pip-installed litellm binary 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
2b3d8a1dbf fix(install.sh): use Python bin-dir litellm binary to avoid CWD sys.path shadowing 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
86162d7714 fix(install.sh): suppress RuntimeWarning from module invocation 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
5c757ba9d0 fix(install.sh): use litellm.proxy.proxy_cli module (no __main__.py exists) 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
f99be57ed2 fix(install.sh): always launch wizard via $PYTHON_BIN -m litellm, not PATH binary 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
6871959111 fix(install.sh): show pip progress bar during install 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
c0d1ac9f54 fix(install.sh): force-reinstall from git to bypass cached PyPI version 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
027174df58 fix(install.sh): remove stale LITELLM_BRANCH reference that caused unbound variable error 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
3998b47c84 fix(install.sh): install from git branch so --setup is available for QA 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
f765541dda fix(install.sh): remove orange color, add LITELLM_BRANCH env var for branch installs 2026-03-17 13:23:35 -07:00
Ishaan Jaffer
db7075b080 feat(setup): add interactive setup wizard + install.sh
Adds `litellm --setup` — a Claude Code-style TUI onboarding wizard that
guides users through provider selection, API key entry, and proxy config
generation, then optionally starts the proxy immediately.

- litellm/setup_wizard.py: wizard with ASCII art, numbered provider menu
  (OpenAI, Anthropic, Azure, Gemini, Bedrock, Ollama), API key prompts,
  port/master-key config, and litellm_config.yaml generation
- litellm/proxy/proxy_cli.py: adds --setup flag that invokes the wizard
- scripts/install.sh: curl-installable script (detect OS/Python, pip
  install litellm[proxy], launch wizard)

Usage:
  curl -fsSL https://raw.githubusercontent.com/BerriAI/litellm/main/scripts/install.sh | sh
  litellm --setup
2026-03-17 13:23:35 -07:00
ryan-crabbe
ef9cc33ee3
Merge pull request #23822 from BerriAI/litellm_ryan_march_16
Litellm ryan's daily branch march 16
2026-03-17 10:03:01 -07:00
yuneng-jiang
a622a1fa35
Merge pull request #23827 from BerriAI/litellm_internal_dev_03_16_2026
[Infra] Merge daily dev branch with main
2026-03-17 09:58:06 -07:00
yuneng-jiang
b4c9c8a9f0
Merge pull request #23868 from BerriAI/revert-22188-litellm_langfuse_key_leakage
Revert "fix: langfuse trace leak key on model params"
2026-03-17 08:58:30 -07:00
yuneng-jiang
467706ea30
Revert "fix: langfuse trace leak key on model params" 2026-03-17 08:58:07 -07:00
yuneng-jiang
dcbaa0512b
Merge pull request #23826 from BerriAI/litellm_yj_march_16_2026
[Infra] Merge personal dev branch with daily dev branch
2026-03-16 23:47:50 -07:00
yuneng-jiang
ad62071fd3
Merge pull request #22188 from BerriAI/litellm_langfuse_key_leakage
fix: langfuse trace leak key on model params
2026-03-16 23:46:06 -07:00
Ryan Crabbe
302292c805 Merge remote-tracking branch 'origin/main' into litellm_ryan_march_16 2026-03-16 22:51:45 -07:00
ryan-crabbe
cde28aa018
Merge pull request #23819 from BerriAI/litellm_fix-csv-export
fix(ui): CSV export empty on Global Usage page
2026-03-16 22:46:36 -07:00
yuneng-jiang
a087c44c95
Merge pull request #23812 from BerriAI/litellm_disable_custom_api_keys
[Feature] Disable Custom Virtual Key Values via UI Setting
2026-03-16 22:37:48 -07:00
Ryan Crabbe
c098eca509 fix(ui): CSV export empty on Global Usage page
Aggregated endpoint returns empty breakdown.entities; fall back to
grouping breakdown.api_keys by team_id.
2026-03-16 22:36:23 -07:00
yuneng-jiang
471e0f147e [Fix] Remove "API" from custom key description text
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 22:35:44 -07:00
yuneng-jiang
0b0fe7e263 [Fix] Rename toggle label to "Disable custom Virtual key values"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 22:26:53 -07:00
Krish Dholakia
245a3d2b26
Revert "docs: add v1.82.3 release notes and update provider_endpoints_support…" (#23817)
This reverts commit 966124966f.
2026-03-16 22:26:45 -07:00
yuneng-jiang
c687e631b4 [Feature] Add disable_custom_api_keys toggle to UI Settings page
Adds a toggle switch to the admin UI Settings page so administrators can
enable/disable custom API key values without making direct API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 22:26:11 -07:00
Joe Reyna
966124966f
docs: add v1.82.3 release notes and update provider_endpoints_support.json (#23816) 2026-03-16 22:25:55 -07:00
Harshit Jain
d15c2d546e
fix: Register DynamoAI guardrail initializer and enum entry (#23752)
* fix: Register DynamoAI guardrail initializer and enum entry

Fix the "Unsupported guardrail: dynamoai" error by:
1. Adding DYNAMOAI to SupportedGuardrailIntegrations enum
2. Implementing initialize_guardrail() and registries in dynamoai/__init__.py

The DynamoAI guardrail was added in PR #15920 but never properly registered
in the initialization system. The __init__.py was missing the
guardrail_initializer_registry and guardrail_class_registry dictionaries
that the dynamic discovery mechanism looks for at module load time.

Fixes #22773

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* test: Add tests for DynamoAI guardrail registration

Verifies enum entry, initializer registry, class registry,
instance creation, and global registry discovery.

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

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-16 22:24:29 -07:00
yuneng-jiang
72aa5fc219 [Fix] Add disable_custom_api_keys to UISettings Pydantic model
Without this field on the model, GET /get/ui_settings omits the setting
from the response and field_schema, preventing the UI from reading it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 22:10:02 -07:00
yuneng-jiang
53d96c8353 [Feature] Disable custom API key values via UI setting
Add disable_custom_api_keys UI setting that prevents users from specifying
custom key values during key generation and regeneration. When enabled, all
keys must be auto-generated, eliminating the risk of key hash collisions
in multi-tenant environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 21:35:21 -07:00
yuneng-jiang
a771fe55e4 [Fix] Update log filter test to match empty-result behavior
The test expected fallback to all logs when backend filters return empty,
but the source was intentionally changed to show empty results instead of
stale data. Updated test to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 18:19:02 -07:00
yuneng-jiang
616b311dec
Merge pull request #23798 from BerriAI/litellm_skip_alias_revalidation_on_update
[Fix] Key Alias Re-validation on Update Blocks Legacy Aliases
2026-03-16 18:15:45 -07:00
yuneng-jiang
4a92db8da1 [Fix] Skip key_alias re-validation on update/regenerate when alias unchanged
When updating or regenerating a key without changing its key_alias, the
existing alias was being re-validated against current format rules. This
caused keys with legacy aliases (created before stricter validation) to
become uneditable. Now validation only runs when the alias actually changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 18:09:00 -07:00
yuneng-jiang
c8c4774213
Merge pull request #23795 from BerriAI/litellm_fix_internal_user_invalid_keys
[Fix] Prevent Internal Users from Creating Invalid Keys
2026-03-16 17:56:00 -07:00
yuneng-jiang
208740a87c [Fix] Remove duplicate get_team_object call in _validate_update_key_data
Move the non-admin team validation into the existing get_team_object call
site to avoid an extra DB round-trip. The existing call already fetches
the team for limits checking — we now add the LIT-1884 guard there when
team_obj is None for non-admin callers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:40:42 -07:00
yuneng-jiang
bc752fb109 [Fix] Prevent internal users from creating invalid keys via key/generate and key/update
Internal users could exploit key/generate and key/update to create unbound
keys (no user_id, no budget) or attach keys to non-existent teams. This
adds validation for non-admin callers: auto-assign user_id on generate,
reject invalid team_ids, and prevent removing user_id on update.

Closes LIT-1884

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:27:12 -07:00
ryan-crabbe
0d45b1d35c
Merge pull request #23791 from BerriAI/litellm_update-blog-posts-rss
Litellm update blog posts rss
2026-03-16 16:54:47 -07:00
yuneng-jiang
2ebea084c9 Merge remote-tracking branch 'origin/main' into litellm_internal_dev_03_16_2026 2026-03-16 16:33:40 -07:00
yuneng-jiang
31a677e357
Merge pull request #23792 from BerriAI/litellm_ui_logs_filter_2
[Fix] UI - Logs: Empty Filter Results Show Stale Data
2026-03-16 16:33:24 -07:00
yuneng-jiang
c951b337e1 [Fix] Reapply empty filter fix after merge with main
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:32:12 -07:00
yuneng-jiang
57bba3b863 [Fix] UI - Logs: Fix empty filter results showing stale data
Remove `.length > 0` check so that when a backend filter returns an
empty result set the table correctly shows no data instead of falling
back to the previous unfiltered logs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:28:11 -07:00