Commit Graph

22 Commits

Author SHA1 Message Date
Ishaan Jaff c23e4b87dc [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612)
* init PolicyMatcher

* TestPolicyMatcherGetMatchingPolicies

* TestPolicyMatcherGetMatchingPolicies

* feat: init PolicyResolver

* init resolver types

* init policy from config

* inint PolicyValidator

* validate policy

* init Architecture Diagram

* test_add_guardrails_from_policy_engine

* init _init_policy_engine

* test updates

* test fixws

* new attachment config

* simplify types

* TestPolicyResolverInheritance

* fix policy resolver

* fix policies

* fix applied policy

* docs fix

* docs fix

* fix linting + QA checks

* fix linting + QA fixes

* test fixes
2026-01-22 19:49:53 -08:00
YutaSaito eec4ed640b Revert "Stabilise mock tests" 2026-01-17 06:26:18 +09:00
yuneng-jiang 6a7edd8f2b Merge pull request #18785 from BerriAI/litellm_user_promethus_metrics
[Feature] User Metrics for Promethus
2026-01-15 15:51:02 -08:00
Sameer Kankute f28d951202 Fix: tests/test_litellm/proxy/test_litellm_pre_call_utils.py::test_embedding_header_forwarding_with_model_group 2026-01-15 19:41:16 +05:30
yuneng-jiang 567f723214 Merge remote-tracking branch 'origin' into litellm_user_promethus_metrics 2026-01-12 15:59:16 -08:00
Sameer Kankute dbec9c7084 Fix: Header forwarding for embeddings endpoint 2026-01-12 18:00:48 +05:30
yuneng-jiang d01c48ec5e User metrics for promethus 2026-01-07 15:05:09 -08:00
yuneng-jiang 7225fc066f Fix key model alias (#16896) 2025-11-20 16:05:49 -08:00
Ishaan Jaff 5c375b23ae [Fix] Guardrails - Ensure Key Guardrails are applied (#16025)
* _add_guardrails_from_key_or_team_metadata

* test_team_guardrails_append_to_key_guardrails

* fix move_guardrails_to_metadata

* fix _add_guardrails_from_key_or_team_metadata
2025-10-28 16:40:49 -07:00
Ishaan Jaff 02df4c6b30 [Fix] DD logging - ensure key's metadata + guardrail is logged on DD (#15980)
* fix get_sanitized_user_information_from_key

* test_get_sanitized_user_information_from_key_includes_guardrails_metadata
2025-10-27 13:45:09 -07:00
Boopesh Shanmugam 8b338a4d8c User Headers X LiteLLM Users Mapping feature (#14485)
* Draft commit.

* user header mapping feature with backward compatibility with user_header_name field.

* user header mapping feature with backward compatibility with user_header_name field optimizations.

* Added unit tests.
2025-09-12 11:49:37 -07:00
Ishaan Jaff 128d9a3488 [Feature]: Add header support for spend_logs_metadata (#14186)
* fix: allow settings spend_logs_metadata

* fix add_litellm_data_for_backend_llm_call

* fix: add add_litellm_metadata_from_request_headers

* fix add_litellm_metadata_from_request_headers

* test_add_litellm_metadata_from_request_headers

* add_litellm_metadata_from_request_headers

* docs Tracking Spend with custom metadata

* add_litellm_metadata_from_request_headers

* add_litellm_metadata_from_request_headers
2025-09-02 15:13:15 -07:00
Krrish Dholakia 2e16f2cb13 test: add unit tests 2025-08-18 21:19:43 -07:00
Krish Dholakia 5b50a12329 Revert "fix: Set user from token user_id for OpenMeter integration (#13029)" (#13107)
This reverts commit f8c09e44f6.
2025-07-29 15:49:20 -07:00
Better than breakfast. f8c09e44f6 fix: Set user from token user_id for OpenMeter integration (#13029) 2025-07-29 15:41:50 -07:00
Krish Dholakia d26f74ade5 Request Headers - support x-litellm-num-retries + Usage - support usage by model group (#12890)
* feat(litellm_pre_call_utils.py): add num_retries to litellm data for backend call

allow user to pass in num retries via request headers

* test(test_litellm_pre_call_utils.py): add unit test

* docs(request_headers.md): document new request header

* fix(common_daily_activity.py): show spend breakdown by model group

Partial fix for https://github.com/BerriAI/litellm/issues/12887

* feat(new_usage.tsx): new tab switcher for viewing usage by model group vs. received model

Closes https://github.com/BerriAI/litellm/issues/12887
2025-07-22 23:09:36 -07:00
Ishaan Jaff b41ce5c92f [Feat] - Track cost + add tags for health checks done by LiteLLM Proxy (#12880)
* refactor to use add_user_api_key_auth_to_request_metadata

* add get_litellm_internal_health_check_user_api_key_auth

* add get_litellm_internal_health_check_user_api_key_auth

* add _update_model_params_with_health_check_tracking_information

* add HealthCheckHelpers

* refactor to use clean helpers

* test_update_model_params_with_health_check_tracking_information

* test_get_litellm_internal_health_check_user_api_key_auth

* test_add_user_api_key_auth_to_request_metadata

* fix _update_model_params_with_health_check_tracking_information
2025-07-22 18:45:57 -07:00
Jugal D. Bhatt b443817a56 [Key Access] Litellm disabled callbacks for UI (#12769)
* add disabled callbacks to ui

* added body

* update edit settings

* add tests
2025-07-19 14:32:05 -07:00
Ishaan Jaff eef0623443 [Feat] Add Arize Team Based Logging (#12264)
* working KeyAndTeamLoggingSettings

* add arize_space_id to StandardCallbackDynamicParams

* add construct_dynamic_arize_headers

* add construct_dynamic_arize_headers to

* update otel arize logging

* fix imports

* test_construct_dynamic_arize_headers

* dynamic key/team settings

* test_get_dynamic_logging_metadata_with_arize_team_logging
2025-07-02 17:15:35 -07:00
Krish Dholakia 7f8b2579a2 Minor Fixes (#11868)
* fix(litellm_pre_call_utils.py): add user agent tags to spend logs in standard logging payload logic

avoid clash when tag based routing is enabled

* test: remove redundant test

* test: rename oidc test to run earlier

quicker debuging

* fix(azure.py): return more detailed error message

* fix(azure/common_utils.py): use default scope, if scope is none

fixes oidc test

* fix: always default to cognitiveservices.azure.com

* test: update test
2025-06-18 14:12:59 -07:00
Krish Dholakia 87ae2cf3d7 SSO - Allow passing additional headers + Spend Tags - automatically track spend by user agent (allows cost tracking for claude code) (#11781)
* feat(ui_sso.py): allow admin to specify additional headers for sso provider

some sso providers require special headers to return a json response

* test(test_ui_sso.py): add unit tests to ensure custom headers are respect3ed

* docs(config_settings.md): document new header param

* fix(litellm_pre_call_utils.py): add spend tag tracking by user agent

allows checking spend for cli tools like claude code

* feat(litellm_pre_call_utils.py): track spend by user agent part if user agent contains "/"

allows tracking spend across user agent versions

Better cost tracking for claude cod

* test(test_litellm_pre_call_utils.py): add testing for pre call utils, user agent parsing

* fix: fix linting check
2025-06-16 21:53:40 -07:00
Krish Dholakia ef42461c1e Litellm fix GitHub action testing (#11163)
* test: add __init__.py files

* refactor: rename test folder to avoid naming conflict

* test: update workflows

* test: update tests

* test: update imports

* test: update tests

* test: remove unused import

* ci(test-litellm.yml): add pytest retry to github workflow

* test: fix test
2025-05-26 14:41:42 -07:00