Commit Graph

28768 Commits

Author SHA1 Message Date
Ishaan Jaffer accebc49a2 TestNvidiaNim 2025-12-13 16:38:11 -08:00
Ishaan Jaffer f6c4ad92e4 async def test_update_team_guardrails_with_org_id(): 2025-12-13 16:24:58 -08:00
Ishaan Jaffer 95e818fdc4 bump litellm-proxy-extras 2025-12-13 16:22:26 -08:00
Ishaan Jaffer d9794f0811 fix bedrock embeddings - validate env 2025-12-13 16:16:30 -08:00
Ishaan Jaffer 92b72fc759 test_runwayml_tts_async 2025-12-13 16:10:48 -08:00
Ishaan Jaffer 2fd8621b38 test recraft 2025-12-13 16:10:34 -08:00
Ishaan Jaffer 050264f7d7 test_recraft_image_edit_api 2025-12-13 16:09:52 -08:00
Ishaan Jaff 14eed8aff7 [Fixes] A2a Gateway - ensure azure foundry agents work (#17943)
* add agents  v2 fixes azure

* fix auth

* get_azure_ad_token fix

* docs foundry
2025-12-13 16:08:03 -08:00
yuneng-jiang 232bb33fec Merge pull request #17942 from BerriAI/litellm_ui_notification
[Feature] Show progress and pause on hover for Notifications
2025-12-13 15:37:55 -08:00
yuneng-jiang 6567e43560 Merge pull request #17940 from BerriAI/litellm_ui_mcp_headers
[Fix] Add extra_headers and allowed_tools to UpdateMCPServerRequest
2025-12-13 15:20:55 -08:00
yuneng-jiang db7454c6ee Show progress and pause on hover for notifications 2025-12-13 15:16:13 -08:00
Alexsander Hamir 6635325629 fix: filter internal params in fallback code and fix test issues (#17941)
- Filter skip_mcp_handler and other internal params in fallback_utils.py before calling acompletion
  Fixes issue where internal parameters were being passed to provider APIs causing errors
- Remove deployment field from GCS bucket logger test metadata
  Fixes model name mismatch where deployment field was overriding the model in logging
- Update Bedrock Titan test to use non-deprecated model (titan-text-express-v1)
  Fixes test failure due to deprecated amazon.titan-text-lite-v1 model
2025-12-13 15:05:26 -08:00
Ishaan Jaff ed356fdfc0 [Docs] Cursor Integration (#17939)
* docs cursor

* remove bloat

* stash changes

* docs fix

* simpler docs

* docs

* docs cursor

* add cursor/chat/completions
2025-12-13 14:44:40 -08:00
yuneng-jiang 61767779f8 Adding tests 2025-12-13 14:44:26 -08:00
yuneng-jiang 5ee2338f9e Adding extra_headers and allowed_tools in UpdateMCPServerRequest 2025-12-13 14:36:37 -08:00
Alexsander Hamir fab1b81b7f fix: add agent_id field to GCS PubSub spend_logs_payload.json test expectation (#17938)
- Add agent_id: null to expected JSON to match actual payload structure
- Fixes test_async_gcs_pub_sub_v1 test failure
- agent_id is an optional field in SpendLogsPayload that is always included (as null when not provided)
2025-12-13 13:35:20 -08:00
yuneng-jiang b681729e0c Merge pull request #17937 from BerriAI/litellm_a2a_doc_fix
[Docs] Add Import Image to A2A Docs
2025-12-13 13:30:06 -08:00
yuneng-jiang 8b0dd58a64 Importing Image in A2A Doc 2025-12-13 13:29:01 -08:00
Alexsander Hamir 425b8400b0 fix: add storage_backend and storage_url columns to schema.prisma files (#17936)
- Updated litellm/proxy/schema.prisma to include storage_backend and storage_url columns
- Updated litellm-proxy-extras/litellm_proxy_extras/schema.prisma to include storage_backend and storage_url columns
- Fixes database schema mismatch causing 'storage_backend column does not exist' errors
- Keeps all schema files in sync with root schema.prisma
2025-12-13 13:28:34 -08:00
yuneng-jiang 1b28ea7728 Merge pull request #17935 from BerriAI/litellm_fix_agent_docs_2
[Docs] Fixing links
2025-12-13 13:10:25 -08:00
yuneng-jiang d18ed525b8 Fixing links 2025-12-13 13:09:39 -08:00
yuneng-jiang af7f50d42b Merge pull request #17934 from BerriAI/litellm_merge_agent_docs
[Docs] Merge Agent Usage with A2A Cost Tracking
2025-12-13 13:05:23 -08:00
yuneng-jiang 773c4d08b4 Merge Agent Usage with A2A Cost Tracking 2025-12-13 13:04:28 -08:00
yuneng-jiang 6745c81800 Merge pull request #17932 from BerriAI/litellm_doc_fix
[Docs] Agent Usage doc fix
2025-12-13 12:54:50 -08:00
yuneng-jiang b692e87836 Agent doc fix 2025-12-13 12:54:00 -08:00
Ishaan Jaff 24d6ec67c7 [QA] Cursor Integration x LiteLLM (#17855)
* fix utils.py

* ValidUserMessageContentTypesLiteral

* add _transform_tool_choice

* _transform_responses_api_content_to_chat_completion_content

* TestContentTypeTransformation

* test_map_tool_choice_string_auto

* fix validate_chat_completion_user_messages

* fix _is_input_item_tool_call_output

* fix LiteLLMCompletionResponsesConfig
2025-12-13 12:49:45 -08:00
yuneng-jiang 2d75875ea6 Merge pull request #17931 from BerriAI/litellm_agent_usage_md
[Docs] Agent Usage Doc
2025-12-13 12:49:06 -08:00
yuneng-jiang 39b8acae55 Agent Usage Doc 2025-12-13 12:46:56 -08:00
Alexsander Hamir 892d7e8d70 [Fix] CI/CD - Fix Bedrock tool calling test failures with non-serializable objects and internal parameters (#17930)
* fix(bedrock): filter non-serializable objects from request params

- Enhanced filter_exceptions_from_params() to filter callable objects (functions) and Logging objects
- Applied filtering in Bedrock's _prepare_request_params() before deepcopy
- Applied filtering to additional_request_params before JSON serialization
- Prevents TypeError during deepcopy (APIConnectionError objects) and JSON serialization (functions, Logging objects)
- Fixes test_bedrock_tool_calling test failures

Root cause: MCP-related functions (handle_chat_completion_with_mcp, completion_callable) and litellm_logging_obj were incorrectly added to optional_params via add_provider_specific_params_to_optional_params(), which then ended up in additional_request_params. These objects should be in litellm_params, not optional_params.

* fix(bedrock): filter internal MCP parameters from API requests

Filter out LiteLLM internal/MCP-related parameters (skip_mcp_handler,
mcp_handler_context, _skip_mcp_handler) from additional_request_params
before sending to Bedrock API to prevent 'extraneous key' errors.

- Added filter_internal_params() helper function in core_helpers.py
- Applied filtering in Bedrock's _prepare_request_params() method
- Fixes test_bedrock_completion.py::test_bedrock_tool_calling

* fix: mypy type error

* fix: add filter_exceptions_from_params to recursive function ignore list

- Add filter_exceptions_from_params to IGNORE_FUNCTIONS in recursive_detector.py
- Function is safe: has max_depth parameter (default 20) to prevent infinite recursion
2025-12-13 12:38:07 -08:00
yuneng-jiang 5a3cf8b171 Merge pull request #17929 from BerriAI/litellm_v18010_doc
[Docs] v1.80.10 draft
2025-12-13 12:05:47 -08:00
yuneng-jiang e8bbb561b9 Adding image 2025-12-13 12:03:24 -08:00
yuneng-jiang 261437623a Agent usage docs WIP 2025-12-13 11:35:04 -08:00
yoshi-p27 a154671320 Regex guardrails update (#17915)
* Update patterns.json

* regex filtering update
2025-12-13 11:12:24 -08:00
yuneng-jiang 952e555ed3 Merge pull request #17928 from BerriAI/litellm_ui_logs_fix
[Fix] UI - Request and Response in Logs
2025-12-13 10:52:02 -08:00
yuneng-jiang 67a9d61e74 Fixing regression on logs 2025-12-13 10:43:04 -08:00
Alexsander Hamir 32fdb9e60e fix: Add headers to Request scope in JWT tests to fix KeyError (#17927)
- Add 'headers': [] to all Request(scope={'type': 'http'}) instances in test_jwt.py
- Fixes KeyError: 'headers' when accessing request.headers in user_api_key_auth
- All 7 previously failing tests now pass:
  - test_allow_access_by_email (2 variants)
  - test_allowed_routes_admin (4 variants)
  - test_team_token_output (2 variants)

The Starlette Request object requires 'headers' key in scope dictionary
when accessing request.headers property.
2025-12-13 10:36:13 -08:00
Alexsander Hamir 1393c76578 [Fix] CI/CD - Fix failing proxy and core integration tests (#17926)
* Fix: Add prisma generate to proxy tests CI job

- Add prisma generate command before pytest in litellm_mapped_tests_proxy job
- Fixes 3 test failures: test_health_liveliness_endpoint, test_health_liveness_endpoint, test_health_readiness
- Matches pattern used in litellm_mapped_enterprise_tests job

* Fix: Add missing prompt_spec parameter to TestCustomPromptManagement

- Add prompt_spec parameter to get_chat_completion_prompt() method signature
- Fixes 2 test failures: test_custom_prompt_management_with_prompt_id and test_custom_prompt_management_with_prompt_id_and_prompt_variables
- Aligns test mock with base class method signature from CustomPromptManagement

* Fix: Handle string datetime values in OpenTelemetry timestamp conversion

- Add _to_timestamp helper to handle datetime, float, and string inputs
- Fixes test_handle_success_spans_and_metrics failure
- Handles string datetime format from JSON deserialization (e.g. '2025-06-22 10:59:08.399523')
- Applied to all timestamp conversions in OpenTelemetry metrics methods

* Fix OpenTelemetry timestamp parsing to handle datetime strings with/without microseconds
2025-12-13 10:11:01 -08:00
Alexsander Hamir 5b6b613561 [Fix] CI/CD - Fix failing proxy unit test and langfuse trace_id test (#17924)
* fix: correct Request headers format in JWT auth test

Fix test_jwt_non_admin_team_route_access by converting headers to bytes
format as required by Starlette's ASGI specification. Headers must be
bytes tuples with lowercase header names.

This allows dict(request.headers) to work correctly and enables the
authorization check to run, producing the expected error message.

* fix: ignore UUID trace_id from standard_logging_object, use litellm_call_id

The issue was that standard_logging_object.trace_id contains a UUID
(from litellm_trace_id default), which was being used instead of
falling back to litellm_call_id. This caused the test to fail because
it expected 'my-unique-call-id' but got a UUID.

Now we properly detect UUIDs (36 chars with 4 hyphens in specific positions)
and ignore them, allowing the fallback to litellm_call_id to work correctly.
This ensures we use litellm_call_id when no explicit trace_id is provided,
which gets stored in the cache and returned by _get_trace_id().

* fix: use existing_trace_id when provided instead of litellm_call_id

When existing_trace_id is provided in metadata, it should be used as the
trace_id to return (and store in cache), not litellm_call_id. This fixes
the test case where existing_trace_id is set and should be returned by
_get_trace_id().
2025-12-13 09:32:43 -08:00
yuneng-jiang 7633d84d51 Merge pull request #17922 from BerriAI/litellm_ui_build_3a
[Infra] UI build
2025-12-13 09:08:46 -08:00
yuneng-jiang 26b8e7f889 UI build 2025-12-13 09:07:43 -08:00
Alexsander Hamir 5de9bfde53 [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920)
* Fix duplicate imports in SAP embedding transformation

* fix: add missing prompt_spec parameter to HumanloopLogger.get_chat_completion_prompt

- Add prompt_spec: Optional[PromptSpec] = None parameter to match base class signature
- Import PromptSpec from litellm.types.prompts.init_prompts
- Pass prompt_spec to super().get_chat_completion_prompt() call
- Fixes mypy type error: Signature incompatible with supertype CustomLogger

* fix: add missing parameters to AnthropicCacheControlHook.async_get_chat_completion_prompt

- Add ignore_prompt_manager_model and ignore_prompt_manager_optional_params parameters
- Change litellm_logging_obj type from Any to LiteLLMLoggingObj using TYPE_CHECKING pattern
- Pass all parameters including prompt_spec to get_chat_completion_prompt call
- Fixes mypy type errors: Signature incompatible with supertype CustomLogger and PromptManagementBase

* fix: add missing parameters to DotpromptManager.async_get_chat_completion_prompt

- Add ignore_prompt_manager_model and ignore_prompt_manager_optional_params parameters
- Change litellm_logging_obj type from Any to LiteLLMLoggingObj using TYPE_CHECKING pattern
- Pass all parameters including ignore flags to PromptManagementBase.async_get_chat_completion_prompt
- Fixes mypy type errors: Signature incompatible with supertype CustomLogger and PromptManagementBase

* fix: document envs

* fix: add missing parameters to LangfusePromptManagement.async_get_chat_completion_prompt

- Add ignore_prompt_manager_model and ignore_prompt_manager_optional_params parameters
- Pass all parameters including prompt_spec and ignore flags to get_chat_completion_prompt
- Fixes mypy type errors: Signature incompatible with supertype CustomLogger and PromptManagementBase

* fix: add missing parameters to prompt management async methods (Category 1)

- vector_store_pre_call_hook: add ignore_prompt_manager_model, ignore_prompt_manager_optional_params, prompt_spec
- gitlab_prompt_manager: add ignore parameters, fix litellm_logging_obj type
- bitbucket_prompt_manager: add ignore parameters, fix litellm_logging_obj type
- proxy/custom_prompt_management: add prompt_spec parameter
- Fixes mypy type errors: Signature incompatible with supertype

* fix: fix arize_phoenix_prompt_manager and custom_prompt_management (Category 2)

- arize_phoenix_prompt_manager: add prompt_spec to all methods, fix prompt_id types, implement async_compile_prompt_helper
- custom_prompt_management: implement async_compile_prompt_helper abstract method
- Fixes mypy type errors: Signature incompatible with supertype and abstract method errors

* fix: fix obvious type errors (Category 3 - Quick Wins)

- langfuse: change 'callable' to 'Callable' type annotation
- presidio: add type narrowing check for Choices vs StreamingChoices
  - StreamingChoices doesn't have .message attribute, only Choices does
  - Add hasattr check before accessing choice.message
- Fixes mypy type errors: callable? not callable and union-attr errors

* fix: handle expires_after None in Azure files handler (Todo 14)

- Extract logic to _prepare_create_file_data helper method
- Remove expires_after from dict if None to match SDK's Omit pattern
- Add type ignore for FileExpiresAfter -> file_create_params.ExpiresAfter mismatch
- Fixes mypy error: Argument expires_after has incompatible type

* fix: change purpose parameter type to OpenAIFilesPurpose (Todo 18)

- Import OpenAIFilesPurpose in storage_backend_service.py
- Change upload_file_to_storage_backend purpose parameter from str to OpenAIFilesPurpose
- Change _create_file_object_with_storage_metadata purpose parameter from str to OpenAIFilesPurpose
- Fixes mypy error: Argument purpose has incompatible type str; expected Literal type
- Purpose is already validated in files_endpoints.py before reaching these functions

* fix: handle UploadFile | str type for expires_after form fields (Todo 19)

- Validate expires_after[anchor] and expires_after[seconds] are strings, not UploadFiles
- Validate anchor equals 'created_at' before using literal in TypedDict
- Use literal 'created_at' (not variable) in FileExpiresAfter to satisfy Literal type
- Add proper error handling for invalid anchor values and int conversion
- Fixes mypy errors: Incompatible types for anchor and seconds in FileExpiresAfter

* fix: add type narrowing for expires_after_seconds_str to fix mypy error

- Add assert statement after UploadFile validation to help mypy narrow type
- Use validated variable with explicit str type annotation
- Fixes: Argument of type 'UploadFile | str' cannot be assigned to int()

* fix: trigger async_success_handler for MCP tool calls to enable cost tracking and logging

- Set call_type to CallTypes.call_mcp_tool.value before calling async_success_handler
- Update mcp_tool_call_metadata with cost info when server is found
- Call async_success_handler to build standard_logging_object and trigger callbacks
- Fixes test_mcp_cost_tracking by ensuring standard_logging_payload is populated

* refactor: use positive isinstance check for safer type narrowing

- Replace assert with positive isinstance(..., str) check
- Matches codebase pattern (see pass_through_endpoints.py)
- Safer than assert: assertions can be disabled with -O flag
- Mypy properly narrows type after positive isinstance check
- More explicit and readable than assert statement

* fix: add missing REDIS_DAILY_AGENT_SPEND_UPDATE_QUEUE to ServiceTypes enum (Todo 17)

- Add REDIS_DAILY_AGENT_SPEND_UPDATE_QUEUE enum value following the pattern of other daily spend queues
- Add corresponding entry to DEFAULT_SERVICE_CONFIGS with GAUGE metrics
- Fixes mypy error: 'type[ServiceTypes]' has no attribute 'REDIS_DAILY_AGENT_SPEND_UPDATE_QUEUE'
- This enum value is already used in redis_update_buffer.py for agent spend tracking
2025-12-13 08:18:43 -08:00
Ishaan Jaff 2f82c223d3 Litellm docs a2a cost tracking (#17913)
* docs - a2a cost tracking

* docs fix

* docs a2a cost trackign

* docs langgraph agents
2025-12-12 18:23:25 -08:00
yuneng-jiang ab9ec11ba8 Merge pull request #17907 from BerriAI/litellm_theme_mermaid_fix
[Infra] bumping docusaurus/theme-mermaid to 3.9.0
2025-12-12 18:06:50 -08:00
Ishaan Jaffer 802a343fdb ui new build 2025-12-12 17:15:40 -08:00
Ishaan Jaffer 17ce970d99 ui fix 2025-12-12 17:10:36 -08:00
Ishaan Jaffer 2027ee7f85 UI new build 2025-12-12 17:04:48 -08:00
Ishaan Jaffer c57f0665db ui buld fix 2025-12-12 16:58:47 -08:00
Ishaan Jaff 3054b6ea60 [Feat] A2A Gateway - allow adding Azure Foundry Agents on UI (#17909)
* add CostConfigFields

* add CostConfigFields

* add output_cost_per_token

* refactor table

* add agent cost view

* add azure foundry fields

* add foundry logo

* fix: clean error

* fix utils

* fix agent edi

* add easter egg

* fix order

* test_handle_streaming_forwards_api_key

* fix forward api key down

* fix a2a send msg

* add A2a comparison on compare playground

* fix chat ui

* fix bedrock agentcore stream
2025-12-12 16:38:04 -08:00
Ishaan Jaff bede40a90d [A2a gateway] Add agent cost tracking on UI (#17899)
* add CostConfigFields

* add CostConfigFields

* add output_cost_per_token

* refactor table

* add agent cost view
2025-12-12 16:37:31 -08:00
YutaSaito b93a5f0ca6 Merge pull request #17908 from BerriAI/litellm_fix-mcp-tool-name-prefix
Litellm fix mcp tool name prefix
2025-12-13 08:23:47 +09:00