Commit Graph

93 Commits

Author SHA1 Message Date
Ishaan Jaffer 83dc158a2a test fix 2026-03-30 18:08:57 -07:00
Ishaan Jaffer 6c3de43fcf test_enterprise_custom_auth_returns_string 2026-03-30 17:43:58 -07:00
Krrish Dholakia bc829d51f2 test: test 2026-03-28 19:17:38 -07:00
Sameer Kankute 22b333cae6 Fix downloading vertex ai files 2026-03-16 12:08:06 +05:30
Harshit28j f18f4e3bbd feat: allow multiple calls from tags 2026-03-07 11:24:18 +05:30
Harshit28j d661419109 fix: support list of modes in Mode.default for tag-based guardrails 2026-03-04 01:50:28 +05:30
Ephrim Stanley b16397ae1a Managed batches fixes for Gemini/Vertex 2026-02-28 20:45:16 -05:00
yuneng-jiang 0e1428b59d remove orphan comment from test file
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-26 16:51:18 -08:00
Shivam Rawat d448682291 fix: prevent double-counting of litellm_proxy_total_requests_metric (#21159)
* fixed double counting

* Update litellm/proxy/utils.py

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

* reverse prev commit

* Update litellm/proxy/utils.py

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

* removed else branch

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 09:10:49 -08:00
Shivam Rawat 1321cd276b removed /models and v1/models from llm api routes (#20988) 2026-02-13 18:32:41 +05:30
Sameer Kankute cdab87dec0 Merge pull request #20838 from BerriAI/litellm_managed_error_file
Add support managed error file
2026-02-10 18:20:26 +05:30
Sameer Kankute 63eedc26b0 Fix test_async_post_call_success_hook_for_unified_finetuning_job 2026-02-10 18:08:23 +05:30
Shivam Rawat 90cd6538d4 added functionality to propagate bedrock guardrail errors down to litellm (#20395) 2026-02-10 16:12:13 +05:30
Sameer Kankute 45c8edbe25 Fix: Bug: Batch Rate Limiter Cannot Access User Files 2026-02-10 12:25:26 +05:30
Sameer Kankute 9bdb163269 Add error file ids as managed files 2026-02-10 12:06:40 +05:30
Harshit Jain 37aee120a0 fixes content blocked by bedrock (#20606) 2026-02-07 11:02:12 -08:00
Sameer Kankute 8b563a7641 Merge pull request #20402 from BerriAI/litellm_responses_tools_file_ids
Add mapping for responses tools in file ids
2026-02-04 18:09:39 +05:30
Sameer Kankute 8b3213ce5c Add mapping for responses tools in file ids 2026-02-04 13:12:45 +05:30
Harshit Jain 04c348e7bb fixes failure metrics labels (#20152)
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-02-02 19:20:14 -08:00
Ishaan Jaffer 3759ea2de8 test_increment_top_level_request_and_spend_metrics 2026-01-31 11:10:28 -08:00
shin-bot-litellm 2780e2f81e litellm_fix(test): update Prometheus metric test assertions with new labels (#20162)
This fixes the failing litellm_mapped_enterprise_tests (metrics/logging) job.

Recent commits added new labels to several Prometheus metrics (model_id, client_ip, user_agent)
but the test assertions weren't fully updated to expect these new labels.

Tests fixed:
- test_async_post_call_failure_hook
- test_async_log_failure_event
- test_increment_token_metrics
- test_log_failure_fallback_event
- test_set_latency_metrics
- test_set_llm_deployment_success_metrics

Labels added to test assertions:
- model_id for token metrics (litellm_tokens_metric, litellm_input_tokens_metric, litellm_output_tokens_metric)
- model_id for latency metrics (litellm_llm_api_latency_metric)
- model_id for remaining requests/tokens metrics
- model_id for fallback metrics
- model_id for overhead latency metric
- client_ip and user_agent for deployment failure/total/success responses
- client_ip and user_agent for proxy failed/total requests metrics
2026-01-31 10:09:35 -08:00
Sameer Kankute fa2b065238 Add tests for user level permissions on file and batch access 2026-01-29 12:29:10 +05:30
Sameer Kankute 70684ca86f Fix File access permissions for .retreive and .delete 2026-01-29 11:19:24 +05:30
Sameer Kankute f5e5569e40 Merge pull request #19636 from BerriAI/litellm_langfuse_callback
Add litellm_callback_logging_failures_metric for Langfuse, Langfuse Otel and other Otel providers
2026-01-28 18:02:17 +05:30
Sameer Kankute 42a0d576f3 Merge pull request #19910 from BerriAI/main
merge 01 27
2026-01-28 08:30:47 +05:30
michelligabriele fc7a9b4cb0 fix(enterprise): correct error message for DISABLE_ADMIN_ENDPOINTS (#19861)
The error message for DISABLE_ADMIN_ENDPOINTS incorrectly said
"DISABLING LLM API ENDPOINTS is an Enterprise feature" instead of
"DISABLING ADMIN ENDPOINTS is an Enterprise feature".

This was a copy-paste bug from the is_llm_api_route_disabled() function.

Added regression tests to verify both error messages are correct.
2026-01-27 09:34:30 -08:00
Sameer Kankute f98eba24d4 Merge pull request #19040 from Point72/ephrimstanley/batch-list
Fix /batches to return encoded ids (from managed objects table)
2026-01-27 13:02:05 +05:30
Krish Dholakia 6a54dcfa93 feat: Add model_id label to Prometheus metrics (#18048) (#19678)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-26 20:32:08 -08:00
Ephrim Stanley 88280d9cca Fix batch creation to return the input file's expires_at attribute 2026-01-26 12:02:35 -05:00
Ephrim Stanley caa2c57619 Fix /batches to return encoded ids (from managed objects table) 2026-01-26 10:36:43 -05:00
Sameer Kankute 2820a51950 Add otel providers and langfuse for litellm_callback_logging_failures_metric_total 2026-01-23 19:40:15 +05:30
yuneng-jiang dbe6f66baf updating promethus tests 2026-01-22 11:01:01 -08:00
yuneng-jiang f92f231954 Merge remote-tracking branch 'origin' into litellm_user_promethus_metrics 2026-01-13 16:27:08 -08:00
Sameer Kankute a727aa9980 Merge pull request #18340 from Point72/ephrimstanley/fix-batch
Fix batch deletion and retrieve
2026-01-13 08:13:43 +05:30
Ishaan Jaffer 69aaad5e69 Revert "added extraction of top level metadata for custom lables in prometheus callbacks (#18087)"
This reverts commit 14a4a9c031.
2026-01-10 14:00:54 -08:00
yuneng-jiang 1d06cb90e2 Fixing test 2026-01-09 11:51:07 -08:00
Sameer Kankute 386ea1354a fix: async def test_bedrock_apply_guardrail_blocked() 2026-01-06 14:15:06 +05:30
Ephrim Stanley 103633c794 Fix linter errors: remove unused imports and variables 2025-12-23 12:59:22 -05:00
Ephrim Stanley 479e40672e Add end to end integration tests for batches 2025-12-23 12:55:09 -05:00
Shivam Rawat 14a4a9c031 added extraction of top level metadata for custom lables in prometheus callbacks (#18087) 2025-12-17 11:17:12 +05:30
Vinnie Giarrusso 78012ad9a9 fix(prometheus): add 'exception_status' to prometheus logger (#17847)
* fix(prometheus): add 'exception_status' to prometheus logger

* use existing prometheuslogger

* remove unneeded test
2025-12-12 03:57:46 -08:00
Alexsander Hamir 655e04f16c Fix: apply_guardrail method and improve test isolation (#17555)
* Fix Bedrock guardrail apply_guardrail method and test mocks

Fixed 4 failing tests in the guardrail test suite:

1. BedrockGuardrail.apply_guardrail now returns original texts when guardrail
   allows content but doesn't provide output/outputs fields. Previously returned
   empty list, causing test_bedrock_apply_guardrail_success to fail.

2. Updated test mocks to use correct Bedrock API response format:
   - Changed from 'content' field to 'output' field
   - Fixed nested structure from {'text': {'text': '...'}} to {'text': '...'}
   - Added missing 'output' field in filter test

3. Fixed endpoint test mocks to return GenericGuardrailAPIInputs format:
   - Changed from tuple (List[str], Optional[List[str]]) to dict {'texts': [...]}
   - Updated method call assertions to use 'inputs' parameter correctly

All 12 guardrail tests now pass successfully.

* fix: remove python3-dev from Dockerfile.build_from_pip to avoid Python version conflict

The base image cgr.dev/chainguard/python:latest-dev already includes Python 3.14
and its development tools. Installing python3-dev pulls Python 3.13 packages
which conflict with the existing Python 3.14 installation, causing file
ownership errors during apk install.

* fix: disable callbacks in vertex fine-tuning tests to prevent Datadog logging interference

The test was failing because Datadog logging was making an HTTP POST request
that was being caught by the mock, causing assert_called_once() to fail.
By disabling callbacks during the test, we prevent Datadog from making any
HTTP calls, allowing the mock to only see the Vertex AI API call.

* fix: ensure test isolation in test_logging_non_streaming_request

Add proper cleanup to restore original litellm.callbacks after test execution.
This prevents test interference when running as part of a larger test suite,
where global state pollution was causing async_log_success_event to be
called multiple times instead of once.

Fixes test failure where the test expected async_log_success_event to be
called once but was being called twice due to callbacks from previous tests
not being cleaned up.
2025-12-05 12:59:35 -08:00
Krish Dholakia 32013f63a0 Guardrail API - support tool call checks on OpenAI /chat/completions, OpenAI /responses, Anthropic /v1/messages (#17459)
* fix(unified_guardrail.py): correctly map a v1/messages call to the anthropic unified guardrail

* fix: add more rigorous call type checks

* fix(anthropic_endpoints/endpoints.py): initialize logging object at the beginning of endpoint

ensures call id + trace id are emitted to guardrail api

* feat(anthropic/chat/guardrail_translation): support streaming guardrails

sample on every 5 chunks

* fix(openai/chat/guardrail_translation): support openai streaming guardrails

* fix: initial commit fixing output guardrails for responses api

* feat(openai/responses/guardrail_translation): handler.py - fix output checks on responses api

* fix(openai/responses/guardrail_translation/handler.py): ensure responses api guardrails work on streaming

* test: update tests

* test: update tests

* fix: support multiple kinds of input to the guardrail api

* feat(guardrail_translation/handler.py): support extracting tool calls from openai chat completions for guardrail api's

* feat(generic_guardrail_api.py): support extracting + returning modified tool calls on generic_guardrails_api

allows guardrail api to analyze tool call being sent to provider - to run any analysis on it

* fix(guardrails.py): support anthropic /v1/messages tool calls

* feat(responses_api/): extract tool calls for guardrail processing

* docs(generic_guardrail_api.md): document tools param support

* docs: generic_guardrail_api.md

improve documentation
2025-12-03 21:20:39 -08:00
Krish Dholakia 8edcc4ecc3 Guardrails API - add streaming support (#17400)
* fix(initial-commit): adding a way to get the right response type based on the api route

* feat(unified_guardrail.py): support streaming guardrails

* test: update tests

* fix: fix linting errors

* test: update tests
2025-12-02 22:52:09 -08:00
YutaSaito da5b81c1ff feat: add experimental latest-user filtering for Bedrock (#17282)
* feat: add experimental latest-user filtering for Bedrock

* doc: add experimental bedrock latest-message flag
2025-12-01 20:02:28 -08:00
Sameer Kankute 7cebc151b0 Add managed files support for responses API (#16733)
* Fix responses api with managed files

* fix litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py mypy

* fix litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py mypy

* fix mypy errors
2025-11-17 18:41:26 -08:00
Krish Dholakia 586f126395 Prometheus - make OSS (#16689)
* refactor: remove enterprise license from prometheus metrics

* refactor: complete refactoring imports

* refactor: complete prometheus refactoring

* bump: version 1.80.0 → 1.80.1

* bump: version 1.80.1 → 1.80.2

* build: update litellm lock file

* docs(enterprise.md): cleanup enterprise docs

* docs: more docs cleanup

* docs: doc cleanup

* fix: fix imports

* fix: fix linting error
2025-11-15 11:06:34 -08:00
Sameer Kankute bb86c94df4 Add Prometheus metric to track callback logging failures in S3 (#16209)
* Add v1 cut of container api

* fix lint errors

* Add proxy support to container apis & logging support (#16049)

* Add proxy support to container apis

* Add logging support

* Add cost tracking support for containers and documentation

* Add new constant documentation

* Add container cost in model map

* fix failing azure tests

* Update tests based on model map changes

* fix model map tests

* fix model map tests

* Container modeshould be container

* Container tests fix

* Merge branch 'main' into litellm_sameer_oct_staging_2

* Add Prometheus metric to track callback logging failures in S3 (#16102)

* Add proxy support to container apis

* Add logging support

* prometheus metric  measures how often s3_v2 is failing

* remove not needed files

* remove not needed files

* remove not needed files

* fix mypy errors

* Use logging_callback_manager to get all the callbacks

---------

Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
2025-11-03 18:46:52 -08:00
Ishaan Jaffer b0a2e08a60 fixes test 2025-10-28 17:43:04 -07:00
Ishaan Jaffer 74e4d3f6da fixes for mock tests 2025-10-28 17:31:54 -07:00