Commit Graph
23118 Commits
Author SHA1 Message Date
user202729andGitHub 044f5f973b Add documentation on in-memory and disk caching (#10522) 2025-05-14 23:07:13 -07:00
Marc AbramowitzandGitHub 322b67833b Add models import command (#10581)
* Add --only-models-matching-regex option

to `models import` which only processes models where
`litelllm_params.model` matches the regex

* Add test_models_import_only_models_matching_regex

* Print each model we're importing

* Add --only-access-groups-matching-regex option

to `models import` which only processes models where at least one item
in `model_info.access_groups` matches the regex. Add a unit test.

* Add `models import` examples to README.md

Add `models import` examples to proxy/client/cli/README.md

* ruff format litellm/proxy/client/cli/commands/models.py

* Make `models import` display tabular output

* models import refactoring

* Fix failing tests in test_models_commands.py

* Refactor import_models to make it shorter and more readable

* Extract from `import_models` a function called `get_model_list_from_yaml_file`

* Fix mypy error

* Add more specific typing

for better understandability and Intellisense

* More import_models refactoring

* More refactoring

* More refactoring

* Write unit tests for format_iso_datetime_str

* Add more unit tests

* ruff format tests/litellm/proxy/client/cli/test_models_commands.py

* ruff format litellm/proxy/client/cli/commands/models.py

* Make test_format_timestamp use UTC time
2025-05-14 23:05:07 -07:00
Camille FarineauandGitHub b88e56ebde Fix/issue 10113 embeddings use non default tokenizer (#10629)
* fix(embeddings): use non default tokenizer when passing list of lists of tokens (int)

* feat(embeddings): allow for passthrough of list of lists of tokens to hosted_vllm models

* Revert "fix(embeddings): use non default tokenizer when passing list of lists of tokens (int)"

This reverts commit a48acd95f860c4fc85853e20668eabffff07cae7.

* refactor(embeddings): use a list to verify if provider accept as input a list of tokens

* fix(embeddings): verify the model name before validating if provider accept a arrays of tokens as input

When passing a list of tokens as input, verify the provider of the model by going through the list of models (`llm_model_list`). First, it check for model name then get the provider and verify if it accept or not arrays of tokens. If yes, then pass, else decode.
Previously, it was verifying provider and model name at the same time resulting in decoding even if the current model checked was not the target one (looping onto `llm_model_list`)

* test(embedding): add unit test to bypass decode for some providers with input as array of tokens

Ref: https://github.com/BerriAI/litellm/issues/10113
2025-05-14 22:55:49 -07:00
PacandGitHub 41374bfa46 fix: bedrock-sonnet-caching-cost (#10752) 2025-05-14 22:50:45 -07:00
Iguchi TomokatsuandGitHub d8a5bd9e0f AttributeError: 'Message' object has no attribute 'audio' (#10814) 2025-05-14 22:45:14 -07:00
Krish DholakiaandGitHub 5146b2903f Anthropic unified web search + tool cost tracking support (#10846)
* fix(duration_parser.py): support `mo` unit

* test(test_key_management_endpoints.py): add test confirming generate_key_helper_fn uses predictable budgets

Closes https://github.com/BerriAI/litellm/issues/10800

* fix(anthropic/chat/transformation.py): add tool use cost tracking

* fix(anthropic/): refactor how hosted tool usage tracking is done

keep it separate from prompt / completion token details

* fix(anthropic/): add web search tool cost tracking

accurate cost tracking

* feat(anthropic/chat/transformation.py): map openai 'web_search_options' param to anthropic hosted tool

Allows calling anthropic web search in same format as openai

* feat(anthropic/chat/transformation.py): support unified anthropic 'web_search_options' param

Allows calling anthropic's web search tool in the openai format

* feat(anthropic/chat/transformation.py): map openai 'search_context_size' to anthropic 'max_uses' param

Translate search effort across both providers

* fix: mark web_search_options param as supported by openai + azure

* fix: fix linting error

* fix: fix linting errors

* fix: fix linting error

* fix: check if usage hasattr

* fix: pass web search options param
2025-05-14 22:41:12 -07:00
Dima-MediatorandGitHub 11740ce144 Capture Gemini reasoning tokens usage in streaming mode - fix (#10789) 2025-05-14 22:23:54 -07:00
Ishaan Jaff 75e4d27885 test: test_embedding_performance v1.69.3-nightly 2025-05-14 21:31:07 -07:00
Jugal D. BhattandGitHub ca4390a166 fix failing test typo (#10843) 2025-05-14 20:46:52 -07:00
Ishaan Jaff a5a4453c77 test: fix groq/gemma2-9b-it 2025-05-14 19:24:20 -07:00
Ishaan Jaff 24cae5aca1 groq/llama3-70b-8192 2025-05-14 19:12:33 -07:00
Ishaan Jaff 80c4b981ec fix groq/llama3-8b-8192 2025-05-14 19:02:20 -07:00
Ishaan Jaff 4a0d711bed ui: fix render error on test key page 2025-05-14 18:57:51 -07:00
Ishaan Jaff 2ebd750289 test: test supports tool I 2025-05-14 18:49:27 -07:00
Ishaan Jaff 85601a69e5 fix groq/llama3-70b-8192 2025-05-14 18:39:25 -07:00
Ishaan Jaff fc8d28f7df docs - DEFAULT_MAX_RECURSE_DEPTH_SENSITIVE_DATA_MASKER 2025-05-14 18:29:31 -07:00
Ishaan Jaff 9e06c42f72 test: fix litellm_mapped_tests 2025-05-14 18:29:01 -07:00
Ishaan Jaff abe7b71e6a Revert "Revert "[Fix] Allow overriding all constants using a .env variable (#10803)""
This reverts commit cf4b2ebda4.
2025-05-14 18:27:43 -07:00
Jugal D. BhattandGitHub a754a25828 Feat add retention config (#10815)
* add function to check config flag

* added unit tests

* convert to seconds support

* added in settings.md

* Updated config_settings.md

* remove extra point

* change config var

* resolve conflict
2025-05-14 18:16:25 -07:00
Ishaan Jaff 235ae79037 ui new build 2025-05-14 18:01:48 -07:00
Ishaan Jaff 91f32cd227 ui linting fixes 2025-05-14 18:00:50 -07:00
Ishaan Jaff be18923250 fix code qa check for OTEL env vars 2025-05-14 17:56:27 -07:00
Ishaan Jaff 19b2d70732 bump litellm_enterprise-0.1.3.tar.gz 2025-05-14 17:55:03 -07:00
Ishaan Jaff a30c574f9a bump litellm_proxy_extras-0.1.21.tar.gz 2025-05-14 17:53:34 -07:00
Ishaan JaffandGitHub 526e6aaaca patch: validate_team_org_change (#10835)
* fix: validate_team_org_change

* test: test_validate_team_org_change_same_org_id
2025-05-14 17:50:41 -07:00
Ishaan JaffandGitHub 2a994d7016 [Feat] Presidio Improvements - Allow adding presidio api base on UI, Test presidio on Test Key, fixes for running presidio hook (#10840)
* feat: add GuardrailProviderSpecificParams

* feat: add add apply_guardrail helper for presidio

* ui cleanup

* fixes pii config on ui

* fixes for adding presidio pii

* refactor: InitializeGuardrails

* feat: init guardrails from DB

* allow running guardrails from test key pg

* fix: running a request with guardrails on UI

* fix: types/guardrails.py

* test: test_presidio_pre_call_hook_with_different_call_types

* test: test_initialize_presidio_guardrail

* test: fix custom guardrail tests
2025-05-14 17:41:33 -07:00
Damien PontifexandGitHub 63a4287bff Supper OTLP standard environment variables for configuration (#10813)
- Environment variables outlined at https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
- Default to OTLP standard, but fallback to existing so as to not break backwards compatibility
2025-05-14 17:40:28 -07:00
Ishaan JaffandGitHub 9ac47cd05a [UI] Fixes for bulk invite users - add validation for bad inputs (#10836)
* fixes for bulk invite users

* add validation for bulk import
2025-05-14 17:36:30 -07:00
Ishaan Jaff 652b5693cc build: add guardrails table 2025-05-14 14:23:07 -07:00
Ishaan JaffandGitHub b9c3a3835c [Feat UI] Add Guardrails on LiteLLM UI (#10834)
* feat: add DB Add, Edit, Delete for Guardrails

* feat: endpoints for guardrail management

* add guardrail info helpers

* add presidio logo

* add createGuardrailCall

* basic add guardrails on UI

* fix cleanup form

* feat: working add guardrails

* ui view guardrails

* allow viweing list of guardrails

* fix: show created_at and updated_at for guardrails on UI

* cleanup guardrail view

* use 1 file for guardrail table

* docs adding guardrails

* fix: expose endpoint to show allowed modes, entities, actions

* fix allow adding entity configs for PII

* fixes guardrails

* fix adding guardrails on UI

* feat: add PII_ENTITY_CATEGORIES_MAP

* use categories for pii

* use step based form

* fixes pii configs

* fix pii config

* refactor pii config on ui

* clear form on submit

* add ability to create guardrails

* fix linting error
2025-05-14 14:21:35 -07:00
Ishaan JaffandGitHub ee1557afcd [Feat] Add endpoints for adding, deleting, editing guardrails in DB (#10833)
* feat: add DB Add, Edit, Delete for Guardrails

* feat: endpoints for guardrail management

* add guardrail info helpers

* add presidio logo

* add createGuardrailCall
2025-05-14 14:19:51 -07:00
naliotopierandGitHub 007524a972 Update Groq models on model_prices_and_context_window.json (#10077)
* Update Groq models on model_prices_and_context_window.json

Add support for 6 new models; add deprecations dates to 12 model; and update context-windows/max-tokens for 3 models

* Round model costs to 8 decimal places
2025-05-14 13:08:03 -07:00
tanjiroandGitHub 1fc5320e9f Team id + Status filter on logs (#10831)
* added team_id filter

* improve hook

* pagination fixed

* fix pagination for team id filter

* minor

* added status filter

* fixed pagination
2025-05-14 13:06:42 -07:00
Jugal D. BhattandGitHub 468b881ec5 add support to parse metadata (#10832)
* add support to parse metadata

* add safe loads

* remove depth checks
2025-05-14 12:03:49 -07:00
Ishaan Jaff d558c223b3 bump resource_class: xlarge 2025-05-14 08:31:53 -07:00
Ishaan Jaff 98bed9b698 update resource_class for litellm_mapped_tests 2025-05-14 07:43:56 -07:00
Krish DholakiaandGitHub 340a0453d3 Migrate cohere to /v2/embed - adds support for output_dimensions param (#10809)
* feat(cohere/embed): v2 embed api support

adds output_dimensions param support

* fix(cohere/embed): migrate to v2 embedding

Adds output dimension support

* fix: maintain /v1/embedding compatibility for bedrock cohere

Bedrock cohere is still using /v1 endpoints

* fix: fix linting error

* fix: fix passing extra headers

* test: update tests
2025-05-13 23:06:56 -07:00
Krish DholakiaandGitHub a421316e56 fix(litellm_logging.py): log custom headers in requester metadata (#10818)
* fix(litellm_logging.py): log custom headers in requester metadata

allows passing along custom headers from client to logging integration - e.g. `x-correlation-id`

* refactor: move enterprise code out of OSS package

work towards simplified CE version of docker image

* test: update test

* fix: fix linting error
2025-05-13 23:04:37 -07:00
Ishaan Jaff cf4b2ebda4 Revert "[Fix] Allow overriding all constants using a .env variable (#10803)"
This reverts commit de901bbf24.
2025-05-13 21:27:44 -07:00
Ishaan Jaff 741ea6e149 ci/cd: remove n -4 change 2025-05-13 21:21:37 -07:00
Ishaan Jaff 6b6794a926 fix mapped tests 2025-05-13 21:17:41 -07:00
Andy DaiandGitHub cab57b2d2f Fix: Separate Sync/Async Azure Client Cache to Prevent Type Mismatches (#10781)
* fix: Fix issues when mix sync and async call in AzureOpen

* misc: Keep original format

* misc: Add back missing file
2025-05-13 21:13:46 -07:00
Ishaan Jaff 19ca5f7307 test - increase duration of litellm mapped test 2025-05-13 20:56:48 -07:00
Ishaan Jaff 33f11f1479 fix arize config tests 2025-05-13 20:21:14 -07:00
Ishaan Jaff 18a51a9849 bump: version 1.69.2 → 1.69.3 2025-05-13 19:55:53 -07:00
Ishaan JaffandGitHub 5e7869a778 [Bedrock] Fixes to only allow accepted fields for tool json schema (#10062)
* add test_function_calling_with_tool_response to base llm tests

* run test suite for nova

* update test_function_calling_with_tool_response

* allowed ToolJsonSchemaBlock keys

* fix ToolJsonSchemaBlock

* add back pytest fixture

* test: test_prompt_caching
2025-05-13 19:49:30 -07:00
Ishaan JaffandGitHub 8142c20c98 [Feat] Allow specifying PII Entities Config when using Presidio Guardrails (#10810)
* refactor: use analyze_text, anonymize_text

* feat: allow defining pii_entities_config for presidio

* feat: use entities config for presidio analyze request

* feat: add test_presidio_pii.py

* testing: add guardrails testing job

* feat: allow blocking specific entities pii

* test: use 1 file for presidio guard tests

* fix: presidio pii tests

* test: presidio blocked entity

* clean up docs

* docs presidio pii parsing

* fix: raise_exception_if_blocked_entities_detected

* fix: linting errors
2025-05-13 19:48:56 -07:00
Ishaan Jaff c5277b6714 test fixes: TestArizePhoenixConfig 2025-05-13 17:27:05 -07:00
Ishaan JaffandGitHub b5e864be2e fixes for presidio checks (#10197) 2025-05-13 17:19:55 -07:00
Ishaan JaffandGitHub 5fbcd22604 [Fix] Allow overriding all constants using a .env variable (#10803)
* fix: bump: DEFAULT_MAX_RECURSE_DEPTH

* fix: bump: DEFAULT_MAX_RECURSE_DEPTH

* test: test_vertex_ai_complex_response_schema

* fix: allow all constants to be overriden

* fix: allow all numeric constants to be overriden with env vars

* fix: remove dup DEFAULT_MAX_TOKENS in constants.py

* document all constants env vars

* docs - DEFAULT_PROMPT_INJECTION_SIMILARITY_THRESHOLD
2025-05-13 16:10:55 -07:00