Commit Graph
23118 Commits
Author SHA1 Message Date
Krish DholakiaandGitHub a4c96d5224 Fix return finish_reason = "tool_calls" for gemini tool calling (#10485)
* fix(vertex_and_google_ai_studio.py): fix finish reason to be 'tool_calls' when tool call returned

Vertex returns 'Stop', openai format is 'tool calls'

* test(base_llm_unit_tests.py): bump test to assert tool calls in finish reason
2025-05-01 22:02:56 -07:00
Kevin MontoyaandGitHub 38d1691e20 docs(realtime): yaml config example for realtime model (#10489)
documentation includes outdated example of configuration of realtime
model that does not comply with current healthcheck:
https://github.com/BerriAI/litellm/pull/7453. Provide proper model info
mode in example
2025-05-01 21:43:48 -07:00
Parham AlvaniandGitHub d7632ca56e Update mcp.md (#10493) 2025-05-01 20:54:27 -07:00
Krrish Dholakia 4e44d7f40c ci(test-linting.yml): pin openai version 2025-05-01 18:55:39 -07:00
de7870cb54 Add llamafile as a provider (#10203) (#10482)
* Update docs for OpenAI compatible providers, add Llamafile docs, include Llamafile in the sidebar

* Add Llamafile as an LlmProviders enum

* Add llamafile as a OpenAI compatible provider (in the list of compatible providers)

* Add Llamafile chat config and tests

* Wire up Llamafile

Co-authored-by: Peter Wilson <peter@mozilla.ai>
2025-05-01 18:36:55 -07:00
Krrish Dholakia 66cf75cd5d test: handle internal server errors 2025-05-01 16:47:30 -07:00
Krrish Dholakia cec138c47e test: remove redundant tests 2025-05-01 16:46:21 -07:00
Krrish Dholakia 4ab0ee0b65 test: more testing fixes 2025-05-01 15:36:13 -07:00
Krrish Dholakia 7502a21279 ci(config.yml): bump config 2025-05-01 15:27:16 -07:00
Krrish Dholakia dd5edbc9b6 docs(config_settings.md): document new param 2025-05-01 15:20:33 -07:00
298a3574f4 Add supports_pdf_input: true to Claude 3.7 bedrock models (#9917)
* Add supports_pdf_input: true to Claude 3.7 bedrock models

* update unit test

---------

Co-authored-by: RupertoXTI <rmartinez@xtillion.com>
2025-05-01 14:56:54 -07:00
Ishaan JaffandGitHub eebb725416 [Fixes] Azure OpenAI OIDC - allow using litellm defined params for OIDC Auth (#10394)
* fixes for azure OIDC ad token auth

* fixes for test_azure_common_utils.py

* get_azure_ad_token_from_oidc
2025-05-01 14:46:56 -07:00
Krrish Dholakia 03718b8b76 docs(prod.md): clarify usage on read-only file system 2025-05-01 14:46:02 -07:00
Ishaan JaffandGitHub ba67ca1f84 fix ensure mcp tools are llm api routes (#10473) 2025-05-01 14:37:30 -07:00
Krrish Dholakia c5b2d4a529 docs(document_understanding.md): clarify 'format' param usage 2025-05-01 14:34:16 -07:00
Krish DholakiaandGitHub c0a464e4eb fix(all_keys_table.tsx): fix filtering on key alias across multiple p… (#10455)
* fix(all_keys_table.tsx): fix filtering on key alias across multiple pages

* fix(key_management_endpoints.py): enable global sorting on `/key/list`

* feat(all_keys_table.tsx): support sorting on keys table

* feat(all_keys_table.tsx): enable global sorting

* ci(config.yml): add requests mock
2025-04-30 22:21:41 -07:00
Krish DholakiaandGitHub 6ad483dde7 Litellm dev 04 30 2025 p1 (#10462)
* fix(exception_mapping_utils.py): correctly pass through 504 status code

openai also raises a 504 status code

* build(model_prices_and_context_window.json): add gpt-4o-mini-tts to model cost map

Fixes https://github.com/BerriAI/litellm/issues/9591

* fix(cost_calculator.py): fix input cost calculation for gpt-4o-mini-tts

Fixes https://github.com/BerriAI/litellm/issues/9591

* test: testing updates
2025-04-30 22:11:12 -07:00
Marc AbramowitzandGitHub 596c71c360 Add low-level HTTP client (#10452)
The client provides access to a low-level HTTP client for making direct
requests to the LiteLLM proxy server. This is useful when you need more
control or when working with endpoints that don't yet have a high-level
interface.

```python
In [2]: client.http.request(
   ...:     method="POST",
   ...:     uri="/health/test_connection",
   ...:     json={
   ...:         "litellm_params": {
   ...:             "model": "gpt-4",
   ...:             "custom_llm_provider": "azure_ai",
   ...:             "litellm_credential_name": None,
   ...:             "api_key": "6xxxxxxx",
   ...:             "api_base": "https://litellm8397336933...",
   ...:         },
   ...:         "mode": "chat",
   ...:     },
   ...: )
Out[2]:
{'status': 'error',
 'result': {'model': 'gpt-4',
  'custom_llm_provider': 'azure_ai',
  'litellm_credential_name': None,
  'api_base': 'https://litellm8397336933...',
  ...
```
2025-04-30 21:57:06 -07:00
Ishaan JaffandGitHub be885e4a17 [Feat] Vector Stores/KnowledgeBases - Allow defining Vector Store Configs (#10448)
* init vector store configs

* working kb init

* add vector store endpoints

* use litellm_credential_name

* working CRUD vector stores litellm

* working creds with vector DB

* ui cleanup

* clean up vector store id

* fix delete button

* refactored vector store component

* working selector for KBs

* ui vector stores

* add vector store tool calls usage on chat ui

* fixes for vector stores litellm

* test fix

* docs Knowledge Bases

* fixes for vector stores litellm

* fix linting

* add managed vectorstores

* fix orjson ci/cd test

* fix linting

* add types.tsx file
2025-04-30 21:49:59 -07:00
Ishaan JaffandGitHub 7c679abe85 ui - add nvidia triton models (#10456) 2025-04-30 21:42:15 -07:00
Krish DholakiaandGitHub 711601e22a Add key-level multi-instance tpm/rpm/max parallel request limiting (#10458)
* fix: initial commit of v2 parallel request limiter hook

enables multi-instance rate limiting to work

* fix: subsequent commit with additional refactors

* fix(parallel_request_limiter_v2.py): cleanup initial call hook

simplify it

* fix(parallel_request_limiter_v2.py): working v2 parallel request limiter

* fix: more updates - still not passing testing

* fix(test_parallel_request_limiter_v2.py): update test + add conftest

* fix: fix ruff checks

* fix(parallel_request_limiter_v2.py): use pull via pattern method to load in keys instance wouldn't have seen yet

Fixes issue where redis syncing was not pulling key until instance had seen it

* test: update testing to cover tpm and rpm

* fix(parallel_request_limiter_v2.py): fix ruff errors

* fix(proxy/hooks/__init__.py): feature flag export

* fix(proxy/hooks/__init_.py): fix linting error

* ci(config.yml): add tests/enterprise to ci/cd

* fix: fix ruff check

* test: update testing
2025-04-30 21:32:31 -07:00
Ishaan Jaff 616c1ad666 fix orjson ci/cd test 2025-04-30 19:37:12 -07:00
Marc AbramowitzandGitHub 1e8674b611 New feature: Add Python client library for LiteLLM Proxy (#10445)
* First cut at a Python client module for proxy

* Add UnauthorizedError + add_model method

* Add delete_model method

* Add example model_id to delete_model docstring

* Make delete_model raise NotFoundError

* Add get_model

* Add get_all_model_info

* Rename models.list_models to models.list

* Rename models.get_all_model_info to models.info

* Move ModelsManagementClient.get_all_model_group_info to ModelGroupsManagementClient.info

* Rename get_model to get

* Rename add_model to new

* Rename delete_model to delete

* In client classes, rename base_url attribute to _base_url and api_key attribute to _api_key

* Add ModelsManagementClient.updae method

* Add client.chat.completions (ChatClient)

* ruff format litellm/proxy/client

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

* Add latest changes

* Rename KeysManagementClient.create to KeysManagementClient.generate

* Add new parameters to KeysManagementClient.generate

* Add CredentialsManagementClient

* Remove api_key parameter from KeysManagementClient.generate

* Fix lint errors

* Add litellm/proxy/client/README.md

* README.md: Remove api_key param to client.keys.generate

* Fix mypy errors

* Add requests-mock to tool.poetry.group.dev.dependencies

* Update poetry.lock
2025-04-30 16:27:17 -07:00
Krrish Dholakia eb3d54624e docs: cleanup 2025-04-30 13:13:02 -07:00
669566a05f Contributor PR - Support OPENAI_BASE_URL in addition to OPENAI_API_BASE (#9995) (#10423)
* Support OPENAI_BASE_URL in addition to OPENAI_API_BASE (#9995)

* Support OPENAI_BASE_URL in addition to OPENAI_API_BASE

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

* exact

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

* feedback

* less change

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

---------

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>

* doc fix OPENAI_API_BASE

---------

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
2025-04-29 21:27:37 -07:00
Krish DholakiaandGitHub 9e35ca2010 Embedding caching fixes - handle str -> list cache, set usage tokens for cache hits, combine usage tokens on partial cache hits (#10424)
* build(model_prices_and_context_window.json): add fireworks ai new 0-4b pricing tier

* build(model_prices_and_context_window.json): add more fireworks ai models

* test: update testing

* fix(caching_handler.py): handle str + list cache

Fixes issue on cache hits for embedding when initial cached input was str

* test(test_caching.py): add e2e test on caching with individual item and then list

* fix(caching_handler.py): set usage tokens for cache hits

enables token counting to work

* fix(caching_handler.py): combine usage between cached result and embedding response

Handles case of new input to embedding response

* fix: cleanup

* test: move to gpt-4o-new-test

* test: update test
2025-04-29 21:21:28 -07:00
290e2528cd Schedule budget resets at expectable times (#10331) (#10333)
* Schedule budget resets at expectable times (#10331)

* Enhance budget reset functionality with timezone support and standardized reset times

- Added `get_next_standardized_reset_time` function to calculate budget reset times based on specified durations and timezones.
- Introduced `timezone_utils.py` to manage timezone retrieval and budget reset time calculations.
- Updated budget reset logic in `reset_budget_job.py`, `internal_user_endpoints.py`, `key_management_endpoints.py`, and `team_endpoints.py` to utilize the new timezone-aware reset time calculations.
- Added unit tests for the new reset time functionality in `test_duration_parser.py`.
- Updated `.gitignore` to include `test.py` and made minor formatting adjustments in `docker-compose.yml` for consistency.

* Fixed linting

* Fix for mypy

* Fixed testcase for reset

* fix(duration_parser.py): move off zoneinfo - doesn't work with python 3.8

* test: update test

* refactor: improve budget reset time calculation and update related tests for accuracy

* clean up imports in team_endpoints.py

* test: update budget remaining hours assertions to reflect new reset time logic

* build(model_prices_and_context_window.json): update model

---------

Co-authored-by: Prathamesh Saraf <pratamesh1867@gmail.com>
2025-04-29 20:59:44 -07:00
Krish DholakiaandGitHub d783190e04 Update fireworks ai pricing (#10425)
* build(model_prices_and_context_window.json): add fireworks ai new 0-4b pricing tier

* build(model_prices_and_context_window.json): add more fireworks ai models

* test: update testing

* test: testing updates

* test: update test

* test: update test
2025-04-29 20:58:05 -07:00
Krish DholakiaandGitHub 839878f4f5 Support x-litellm-api-key header param + allow key at max budget to call non-llm api endpoints (#10392)
* fix(user_api_key_auth.py): fix passing `x-litellm-api-key` to user api key auth

Support using this when given, or bearer token when given

 Fixes issue with auth on vertex passthrough

* test(test_user_api_key_auth.py): use new fastapi.security check

* fix(user_api_key_auth.py): allow key at budget, to still call non-llm api endpoints

Fixes issue where key at budget, couldn't call `/key/info`
v1.67.5-nightly
2025-04-29 18:57:57 -07:00
Krish DholakiaandGitHub 70accb754e fix(langsmith.py): respect langsmith batch size param (#10411)
* fix(langsmith.py): respect langsmith batch size param

* build(model_prices_and_context_window.json): add missing tgai  models

Fixes https://github.com/BerriAI/litellm/issues/8921

Fixes https://github.com/BerriAI/litellm/issues/8278
2025-04-29 18:55:22 -07:00
Krrish Dholakia cd27185e2c test: override flaky test 2025-04-29 18:54:49 -07:00
Ishaan JaffandGitHub e06e7078da [New model] Add openai/computer-use-preview cost tracking / pricing (#10422)
* add computer-use-preview

* fix computer-use-preview
2025-04-29 17:49:11 -07:00
Udi OronandGitHub f1d6ac4af6 fix google studio url (#10095) 2025-04-29 17:34:58 -07:00
Ishaan JaffandGitHub 25c726ed61 Revert "build(deps): bump axios, @docusaurus/core, @docusaurus/plugin-google-…" (#10421)
This reverts commit a01cd87f4d.
2025-04-29 17:33:47 -07:00
Ishaan JaffandGitHub f30871ef13 [Feat] Add support for using Bedrock Knowledge Bases with LiteLLM /chat/completions requests (#10413)
* add make_bedrock_kb_retrieve_request

* working bedrock KB hook

* working bedrock KB hook

* test_openai_with_knowledge_base_mock_openai

* fix linting

* fix BedrockKnowledgeBaseHook

* docs using bedrock kb with litellm

* docs kb with litellm

* fix bedrock kb test

* DynamicPromptManagementParamLiteral

* fix _should_run_prompt_management_hooks_without_prompt_id

* test_init_custom_logger_compatible_class_as_callback
2025-04-29 17:29:02 -07:00
Ishaan JaffandGitHub 36264d4764 [Feat Security] - Allow blocking web crawlers (#10420)
* security add robots.txt settings to security

* block web crawlers

* test_enterprise_routes.py

* docs proxy enterprise
2025-04-29 17:28:08 -07:00
user202729andGitHub 00605e3611 docs: Improve documentation of phoenix logging (#10416) 2025-04-29 17:24:47 -07:00
user202729andGitHub b482618456 docs: Fix link formatting in GitHub PR template (#10417) 2025-04-29 17:23:53 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a01cd87f4d build(deps): bump axios, @docusaurus/core, @docusaurus/plugin-google-gtag, @docusaurus/plugin-ideal-image and @docusaurus/preset-classic (#10419)
Removes [axios](https://github.com/axios/axios). It's no longer used after updating ancestor dependencies [axios](https://github.com/axios/axios), [@docusaurus/core](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus), [@docusaurus/plugin-google-gtag](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-plugin-google-gtag), [@docusaurus/plugin-ideal-image](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-plugin-ideal-image) and [@docusaurus/preset-classic](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-preset-classic). These dependencies need to be updated together.


Removes `axios`

Updates `@docusaurus/core` from 2.4.1 to 3.7.0
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v3.7.0/packages/docusaurus)

Updates `@docusaurus/plugin-google-gtag` from 2.4.3 to 3.7.0
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v3.7.0/packages/docusaurus-plugin-google-gtag)

Updates `@docusaurus/plugin-ideal-image` from 2.4.3 to 3.7.0
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v3.7.0/packages/docusaurus-plugin-ideal-image)

Updates `@docusaurus/preset-classic` from 2.4.1 to 3.7.0
- [Release notes](https://github.com/facebook/docusaurus/releases)
- [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/docusaurus/commits/v3.7.0/packages/docusaurus-preset-classic)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 
  dependency-type: indirect
- dependency-name: "@docusaurus/core"
  dependency-version: 3.7.0
  dependency-type: direct:production
- dependency-name: "@docusaurus/plugin-google-gtag"
  dependency-version: 3.7.0
  dependency-type: direct:production
- dependency-name: "@docusaurus/plugin-ideal-image"
  dependency-version: 3.7.0
  dependency-type: direct:production
- dependency-name: "@docusaurus/preset-classic"
  dependency-version: 3.7.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-29 17:23:07 -07:00
Ishaan JaffandGitHub a69fa1dc1e [Bug Fix] Responses API - fix for handling multiturn responses API sessions (#10415)
* fix for handling previous_response_id id sessions on responses API

* fix test_decode_previous_response_id_to_original_previous_response_id
2025-04-29 17:22:47 -07:00
Krrish Dholakia 08ba839c31 bump: version 1.67.4 → 1.67.5 2025-04-29 16:20:31 -07:00
Krrish Dholakia 37bdf7c042 test: add more debug logs 2025-04-29 15:40:18 -07:00
Ishaan Jaff 1ef17c2f0e fix test_openai_moderation_error_raising 2025-04-29 07:26:41 -07:00
Krrish Dholakia ae7eecaa40 test: mark flaky test 2025-04-29 06:40:26 -07:00
Ishaan JaffandGitHub f984089b01 [Reliability fix] Redis transaction buffer - ensure all redis queues are periodically flushed (#10393)
* test_e2e_size_of_redis_buffer

* fix store_in_memory_spend_updates_in_redis

* _commit_spend_updates_to_db_with_redis

* daily_tag_spend_update_transactions

* pip install fakeredis==2.28.1
2025-04-28 21:36:54 -07:00
Ishaan Jaff 72de453cc0 fix gemini/gemini-2.5-pro-exp-03-25 2025-04-28 20:24:40 -07:00
Ishaan JaffandGitHub 34cdefbb77 [Feat] Add logging callback support for /moderations API (#10390)
* add OpenAIModerationResponse as a type

* Add typing for litellm.moderation response obj

* Add typing for litellm.moderation response obj

* test_moderations_api_logging

* add assertions for logged slp object

* test_moderations_api_logging

* refactor moderations api usage

* Revert "test_moderations_api_logging"

This reverts commit 5a9001f04c592b063f016d2bb854416255ec6cdf.

* Revert "refactor moderations api usage"

This reverts commit b076d3174ca14251ee3fc28bd4744e25685c1e5f.

* test_moderations_api_logging
2025-04-28 20:24:17 -07:00
Krrish Dholakia 25213f6087 docs: fix docs 2025-04-28 15:36:56 -07:00
Krrish Dholakia a38e2f052e docs: fix docs 2025-04-28 15:36:31 -07:00
Krish DholakiaandGitHub bf9382a182 Handle more gemini tool calling edge cases + support bedrock 'stable-image-core' (#10351)
* test(test_amazing_vertex_completion.py): try to repro https://github.com/BerriAI/litellm/issues/10319

* fix(common_utils.py): handle edge case on tools

Fixes https://github.com/BerriAI/litellm/issues/10319

* test: add unit testing for infinite loops

* fix(amazon_stability3_transformation.py): support 'stable-image-core' transformation

Fixes https://github.com/BerriAI/litellm/issues/8488

* test: add unit testing for stable image core model

* test: update test
2025-04-28 14:22:29 -07:00