Commit Graph
23758 Commits
Author SHA1 Message Date
Ishaan JaffandGitHub b297dffba5 [UI QA Fixes] Stable release (#13231)
* qa - user agent view

* fixes for usage time selector
2025-08-02 12:22:23 -07:00
Ishaan Jaff cd9c388a3f truncateUserAgent 2025-08-02 11:54:54 -07:00
Krish DholakiaandGitHub 363c30320f Prompt Management (2/2) - New /prompt/list endpoint + key-based access to prompt templates (#13218)
* feat: initial commit with prompt management support on pre-call hooks

allows prompt templates to work before assigning specific models

* feat: initial logic for independent prompt management settings

* feat(proxy_server.py): working logic for loading in the prompt templates from config yaml

allows creating an independent 'prompts' section in the config yaml

* feat(prompt_registry.py): working e2e custom prompt templates with guardrails and models

* refactor(prompts/): move folder inside proxy folder

easier management for prompt endpoints

* feat(prompt_endpoints.py): working `/prompt/list` endpoint

returns all available prompts on proxy

* feat(key_management_endpoints.py): support storing 'prompts' in key metadata

allows giving keys access to specific prompts

* feat(prompt_endpoints.py): enable key-based access to /prompts/list

ensures key can only see prompts it has access to

* fix(init_prompts.py): fix linting error

* fix: fix ruff check

* fix(proxy/_types.py): add 'prompts' to newteamrequest

* fix(litellm_logging.py): update logged message with scrubbed value
2025-08-02 10:36:38 -07:00
Krrish Dholakia 4cb42f81b6 fix(proxy_setting_endpoints.py): don't block startup if team doesn't exist in default team member budget 2025-08-02 10:34:37 -07:00
Krish DholakiaandGitHub 342fd2d8b6 Revert "fix: role chaining and session name with webauthentication for aws be…" (#13230)
This reverts commit 0ac093b59e.
2025-08-02 10:11:58 -07:00
Ishaan JaffandGitHub 831eeaf3ab [QA Fixes for MCP] - Ensure MCPs load + don't run a health check everytime we load MCPs on UI (#13228)
* qa - mcps should load even if they don't have required fields

* fix loading MCPs
2025-08-02 09:48:05 -07:00
Krish DholakiaandGitHub a107a4bdba Prompt Management - abstract prompt templates away from model list (enables permission management on prompt templates) (#13219)
* feat: initial commit with prompt management support on pre-call hooks

allows prompt templates to work before assigning specific models

* feat: initial logic for independent prompt management settings

* feat(proxy_server.py): working logic for loading in the prompt templates from config yaml

allows creating an independent 'prompts' section in the config yaml

* feat(prompt_registry.py): working e2e custom prompt templates with guardrails and models

* refactor(prompts/): move folder inside proxy folder

easier management for prompt endpoints

* fix: fix linting error

* fix: fix check
2025-08-02 09:39:45 -07:00
Alexander YastrebovandGitHub 825923e7be litellm/proxy: preserve model order of /v1/models and /model_group/info (#13178)
Closes #12644

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
2025-08-02 08:57:38 -07:00
Cole McIntoshandGitHub c427531c9c Fix missing extra_headers support for vLLM/openai_like embeddings (#13198)
- Add extra_headers handling to hosted_vllm/openai_like embedding providers
- Matches existing pattern used in OpenAI embeddings section
- Fixes issue where custom headers were dropped for vLLM embedding requests

Fixes #13088
2025-08-02 08:56:06 -07:00
0ac093b59e fix: role chaining and session name with webauthentication for aws bedrock (#13205)
* fix(bedrock): prevent duplicate role assumption in EKS/IRSA environments

Fixes issue where AWS role assumption would fail in EKS/IRSA environments
when trying to assume the same role that's already being used.

The problem occurred when:
1. EKS/IRSA automatically assumes a role (e.g., LitellmRole)
2. LiteLLM tries to assume the same role again, causing AccessDenied errors
3. Different models with different roles would fail due to incorrect role context

Changes:
- Added check in _auth_with_aws_role() to detect if already using target role
- Skip role assumption if current identity matches target role
- Return current credentials instead of attempting duplicate assumption
- Added comprehensive test coverage for the fix

This ensures proper role chaining works in EKS/IRSA environments where:
- Service Account can assume Role A
- Role A can assume Role B for different models/accounts

Resolves the AccessDenied errors reported in bedrock usage scenarios.

* fix(bedrock): simplify role assumption for EKS/IRSA environments

Fixes AWS Bedrock role assumption in EKS/IRSA environments by properly
handling ambient credentials when no explicit credentials are provided.

The issue occurred because commit 197e7efa8f
introduced changes that broke role assumption in EKS/IRSA environments.

Changes:
- Simplified _auth_with_aws_role() to use ambient credentials when no
  explicit AWS credentials are provided (aws_access_key_id and
  aws_secret_access_key are both None)
- This allows web identity tokens in EKS/IRSA to work automatically
  through boto3's credential chain
- Maintains backward compatibility for explicit credential scenarios

Added comprehensive test coverage:
- test_eks_irsa_ambient_credentials_used: Verifies ambient credentials work
- test_explicit_credentials_used_when_provided: Ensures explicit creds still work
- test_partial_credentials_still_use_ambient: Edge case handling
- test_cross_account_role_assumption: Multi-account scenarios
- test_role_assumption_with_custom_session_name: Custom session names
- test_role_assumption_ttl_calculation: TTL calculation verification
- test_role_assumption_error_handling: Error propagation
- test_multiple_role_assumptions_in_sequence: Sequential role assumptions

This fix ensures that in EKS/IRSA environments:
1. Service accounts can assume their initial role via web identity
2. That role can then assume other roles across accounts as configured
3. Different models can use different roles without conflicts

* fix(bedrock): add automatic IRSA detection for EKS environments

- Detect AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN environment variables
- Automatically use web identity token flow when IRSA is detected
- Read web identity token from file and pass to existing auth method
- Add test coverage for IRSA environment detection
- Fixes authentication errors in EKS with IRSA when no explicit credentials provided

* fix(bedrock): skip role assumption when IRSA role matches requested role

- Detect when AWS_ROLE_ARN environment variable matches the requested role
- Skip unnecessary role assumption when already running as the target role
- Use existing env vars authentication method for IRSA credentials
- Add test coverage for same-role IRSA scenario
- Fixes 'not authorized to perform: sts:AssumeRole' errors when trying to assume the same role

* fix(bedrock): use boto3's native IRSA support for cross-account role assumption

- Replace custom web identity token handling with boto3's built-in IRSA support
- boto3 automatically reads AWS_WEB_IDENTITY_TOKEN_FILE and assumes initial role
- Then use standard assume_role for cross-account access
- Update test to mock boto3 STS client instead of internal methods
- Fixes 'OIDC token could not be retrieved from secret manager' error

* fix(bedrock): improve IRSA error handling and add debug logging

- Add debug logging to show current identity and role assumption attempts
- Provide clearer error messages for trust policy issues
- Fix region handling in IRSA flow
- Re-raise exceptions instead of silently falling through
- This helps diagnose cross-account role assumption permission issues

* fix(bedrock): manually assume IRSA role with correct session name for cross-account scenarios

- When doing cross-account role assumption, manually assume the IRSA role first with the desired session name
- This ensures the session name in the assumed role ARN matches what's expected in trust policies
- For same-account scenarios, continue using boto3's automatic IRSA support
- Updated tests to handle the new flow
- This fixes the issue where cross-account trust policies require specific session names

* fix: Fix linting issues in base_aws_llm.py

- Fix f-string without placeholders (F541)
- Refactor _auth_with_aws_role to reduce statements count (PLR0915)
  - Extract _handle_irsa_cross_account helper method
  - Extract _handle_irsa_same_account helper method
  - Extract _extract_credentials_and_ttl helper method

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2025-08-02 08:55:35 -07:00
Sameer KankuteandGitHub 1e33dc50a0 add Perplexity citation annotations support (#13225) 2025-08-02 08:47:35 -07:00
tanjiroandGitHub eb173f9155 Add advanced date picker to all the tabs on the usage page (#13221)
* advancedatepicker for tag usage and team usage

* reduce white space in date picker

* selected time range option is visible

* dont wait for apply button to select relative time options
2025-08-02 07:54:49 -07:00
Ishaan Jaff 44900e781a testing fixes - vertex ai deprecated claude 3 sonnet models v1.74.14-nightly 2025-08-01 21:23:52 -07:00
Jugal D. BhattandGitHub 900c7f45c0 [MCP Gateway] Litellm mcp pre and during guardrails (#13188)
* add guardrail support

* add guardrail support

* guardrails for MCP

* added changes

* add mcp guardrails

* added test

* add ui

* fix guardrail form

* working with cursor

* remvoe print

* fix mcp servertests

* fix mypy and remove console logs

* fix mypy and remove console logs

* fix mypy tests
2025-08-01 20:02:25 -07:00
Jugal D. BhattandGitHub c125ae453b suppress httpx logging (#13217) 2025-08-01 20:02:08 -07:00
Jugal D. BhattandGitHub a4c11600a9 [LLM] fix model reload on model update (#13216)
* fix model reload on model update

* remove the flag
2025-08-01 18:08:02 -07:00
Jugal D. BhattandGitHub 3867813277 [Proxy]fix key mgmt (#13148)
* fix key mgmt

* Add unit test
2025-08-01 17:17:15 -07:00
Jugal D. BhattandGitHub 7cf3b4682a [Separate Health App] Update Helm Deployment.yaml (#13162)
* add helm deployment fix

* clean deployment
2025-08-01 16:50:23 -07:00
Ishaan Jaff 9d6098e8cc fix vertex deprecated old model 2025-08-01 16:46:16 -07:00
Ishaan Jaff b36df94481 ui new build 2025-08-01 15:42:19 -07:00
Ishaan Jaff 1358978abb test_recreate_prisma_client_successful_disconnect 2025-08-01 15:38:48 -07:00
Ishaan JaffandGitHub 4a85a91f20 [QA] Viewing Agent Activity Headers on UI Usage Page (#13212)
* qa - agents

* refactored WAU, MAU and DAU endpoints

* fixes for dau, wau, mau

* use stack=true

* fixes for DAU calc

* fixes for rendering WAU, MAU

* use 1 section for topline

* Fixes for endpoint

* remove filter

* fix spacing

* fix activity

* working UI rendering

* fixes for chart data

* allow selecting specific tags

* add DistinctTagResponse endpoints

* use wide selector

* add types

* fixes for UI rendering

* get_per_user_analytics
2025-08-01 15:29:13 -07:00
Krrish Dholakia 3d02d3602e docs(index.md): cleanup 2025-08-01 15:09:30 -07:00
Jugal D. BhattandGitHub bfabf2709a [LLM translation] Fix bedrock computer use #13143 (#13150)
* fix json test

* fix pr

* fix bedrock computer use tool

* added unit test

* fix failing prisma tesT

* fix prisma connect
2025-08-01 15:02:44 -07:00
Krish DholakiaandGitHub 23dfab3737 Index.md - cleanup docs (#13215)
* docs: add highlights

* docs(index.md): add model-level guardrails

* docs(index.md): cleanup notes

* docs: fix docs

* docs: add more details

* docs(index.md): cleanup doc
2025-08-01 14:57:32 -07:00
Krrish Dholakia 3501ee7e82 docs(index.md): cleanup 2025-08-01 13:56:52 -07:00
Krrish Dholakia d158a0344d test: update unit tests 2025-08-01 13:37:51 -07:00
Krrish Dholakia 72fd4e3d55 test: remove bad unit tests 2025-08-01 13:34:23 -07:00
Krrish Dholakia 917233fd52 fix(model_group_alias_settings.tsx): fix check 2025-08-01 09:26:49 -07:00
Krrish Dholakia 278dd52e71 build(ui/): fix linting errors 2025-08-01 09:23:18 -07:00
Krrish Dholakia fedd805b6a test: loosen check 2025-08-01 09:21:13 -07:00
Krrish Dholakia e3c9fc458d test: update tests 2025-08-01 09:19:31 -07:00
Krrish Dholakia 461b615bde test: update tests 2025-08-01 09:12:44 -07:00
Krrish Dholakia 952c2b5215 test: update test 2025-08-01 09:07:53 -07:00
Krrish Dholakia 032cbafd60 fix(litellm_logging.py): fix merge error 2025-08-01 08:58:13 -07:00
Krrish Dholakia 4a66617d71 build(config.yml): use ci/cd postgres in test 2025-08-01 08:48:07 -07:00
aayush-malviya-acquiaandGitHub 1e315dc33b Fix API Key Being Logged (#12978)
* AIF-262 Fix for keys being logged

* AIF-262 Undid http exception detail removal

* AIF-262 Converted f-string to normal
2025-07-31 22:41:18 -07:00
Dmitry TyumentsevandGitHub 9955521194 allow redifine base api url in pass trough (#13134) 2025-07-31 22:38:33 -07:00
Krrish Dholakia fe24c270de Prompt Management - add local dotprompt file support 2025-07-31 22:28:29 -07:00
Ishaan Jaff 817b139420 bump: version 1.74.13 → 1.74.14 2025-07-31 21:52:27 -07:00
Ishaan Jaff 32da244cc3 bump: version 1.74.12 → 1.74.13 2025-07-31 21:52:27 -07:00
6e5fe51184 add openssl in apk install in runtime stage in dockerfile.non_root (#13168)
* add openssl in apk install in runtime stage in dockerfile.non_rootdocker-compose logs -f litellm

* Improve Docker-compose.yaml for local debugging

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2025-07-31 21:52:11 -07:00
unique-jakubandGitHub 3edb71e617 allow helm hooks for migrations job (#13174) 2025-07-31 21:51:07 -07:00
Jason RobertsandGitHub 04c299410e Fix/panw prisma airs post call hook (#13185)
* fix(guardrails): Fix PANW Prisma AIRS post-call hook method name

- Changed async_post_call_hook to async_post_call_success_hook to match proxy calling convention
- Added event_hook parameter to initialization to ensure proper hook registration
- Fixes post-call response scanning for PANW Prisma AIRS guardrails

Resolves issue where post-call hooks were not being invoked due to method name mismatch.

* Update PANW Prisma AIRS tests to use correct method name
2025-07-31 21:50:32 -07:00
Ishaan JaffandGitHub 74e29ae153 [UI QA] QA - Agent Activity Tab (#13203)
* backend fixes

* fixes for User-Agent ui

* UI fixes chart loader

* fixes chart loader

* fixes ChartLoader

* fix ChartLoader

* fixes for analytics
2025-07-31 21:35:25 -07:00
Krish DholakiaandGitHub d887a3d102 Anthropic - mid stream fallbacks p2 (add token usage across both calls) (#13170)
* fix(router.py): add acompletion_streaming_iterator inside router

allows router to catch errors mid-stream for fallbacks

Work for https://github.com/BerriAI/litellm/issues/6532

* fix(router.py): working mid-stream fallbacks

* fix(router.py): more iterations

* fix(router.py): working mid-stream fallbacks with fallbacks set on router

* fix(router.py): pass prior content back in new request as assistant prefix message

* fix(router.py): add a system prompt to help guide non-prefix supporting models to use the continued text correctly

* fix(common_utils.py): support converting `prefix: true` for non-prefix supporting models

* fix: reduce LOC in function

* test(test_router.py): add unit tests for new function

* test: add basic unit test

* fix(router.py): ensure return type of fallback stream is compatible with CustomStreamWrapper

prevent client code from breaking

* fix: cleanup

* test: update test

* fix: fix linting error

* fix(router.py): return combined usage

ensures accurate usage tracking on clientside for stream w/ fallbacks
2025-07-31 21:28:06 -07:00
Krish DholakiaandGitHub 78997c2e35 Anthropic - working mid-stream fallbacks (#13149)
* fix(router.py): add acompletion_streaming_iterator inside router

allows router to catch errors mid-stream for fallbacks

Work for https://github.com/BerriAI/litellm/issues/6532

* fix(router.py): working mid-stream fallbacks

* fix(router.py): more iterations

* fix(router.py): working mid-stream fallbacks with fallbacks set on router

* fix(router.py): pass prior content back in new request as assistant prefix message

* fix(router.py): add a system prompt to help guide non-prefix supporting models to use the continued text correctly

* fix(common_utils.py): support converting `prefix: true` for non-prefix supporting models

* fix: reduce LOC in function

* test(test_router.py): add unit tests for new function

* test: add basic unit test

* fix(router.py): ensure return type of fallback stream is compatible with CustomStreamWrapper

prevent client code from breaking

* fix: cleanup

* test: update test

* fix: fix linting error
2025-07-31 21:22:49 -07:00
Krish DholakiaandGitHub c7e4435bdc Fix - using managed files w/ OTEL + UI - add model group alias on UI (#13171)
* fix(router.py): safe deep copy kwargs

OTEL adds a parent_otel_span which cannot be deepcopied

* fix: use safe deep copy in other places as well

* test: add script to check and ban copy.deepcopy of kwargs

enforce safe_deep_copy usage

* build(ui/): new component for adding model group alias on UI

* fix(proxy_server.py): support updating model_group_alias via /config/update

allows ui component to work

* fix(router.py): update model_group_alias in router settings based on db value

* fix: fix code qa error
2025-07-31 21:22:04 -07:00
Ishaan JaffandGitHub 547c46cd02 add When to Use Each Endpoint (#13193) 2025-07-31 17:16:46 -07:00
Ishaan Jaff cc4881eedd ui new build 2025-07-31 17:11:49 -07:00