Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1609 commits
Select commit Hold shift + click to select a range
d892e96
ui new build
ishaan-jaff Jul 25, 2025
fdb2ebf
bump: version 1.74.8 → 1.74.9
ishaan-jaff Jul 25, 2025
d9d5346
[Feat] Add inpainting support and corresponding tests for Amazon Nova…
SantoshDhaladhuli Jul 25, 2025
650ae0e
Added documentation about metadata exposed over the /v1/models endpoi…
murad-khafizov Jul 25, 2025
6cfaf67
Fix: Shorten Gemini tool_call_id for Azure compatibility (#12941)
tonga54 Jul 25, 2025
3ca65b3
feat: Update model pricing and context window configurations (#12910)
colesmcintosh Jul 25, 2025
eb96fb7
fix(auth_utils): make header comparison case-insensitive (#12950)
understood-the-assignment Jul 25, 2025
0cc320c
GuardrailsAI: use validatedOutput to allow usage of "fix" guards. Pre…
DmitriyAlergant Jul 25, 2025
dd607cd
Show global retry policy on UI (#12969)
Jul 25, 2025
6d3ce76
Guardrails - support model-level guardrails (#12968)
Jul 25, 2025
9c76ccd
docs Health Check Server
ishaan-jaff Jul 25, 2025
7745f61
docs update
ishaan-jaff Jul 25, 2025
ecfafd1
docs update
ishaan-jaff Jul 25, 2025
20450bf
fix mapped test
ishaan-jaff Jul 25, 2025
50574c0
docs - auto routing
ishaan-jaff Jul 25, 2025
7bb48ff
docs auto routing
ishaan-jaff Jul 25, 2025
f2e9834
docs - auto router on litellm proxy
ishaan-jaff Jul 25, 2025
1a15bd4
docs auto router
ishaan-jaff Jul 25, 2025
8f86355
fix ci/cd testing
ishaan-jaff Jul 25, 2025
0f015a2
docs fix link
ishaan-jaff Jul 25, 2025
23d562b
build(github/manual_pypi_publish.yml): manual workflow to publish pip…
Jul 25, 2025
b4da29c
[LLM Translation] Add bytedance/ui-tars-1.5-7b on openrouter (#12882)
jugaldb Jul 25, 2025
c2833e6
clean and verify key before inserting (#12840)
jugaldb Jul 25, 2025
c66b288
[LLM Translation] fix query params for realtime api intent (#12838)
jugaldb Jul 25, 2025
d1b6356
remove features from enterprise (#12988)
jugaldb Jul 25, 2025
e5d68e5
feat(proxy/utils.py): support model level guardrails on stream event
Jul 25, 2025
5ad116a
feat(proxy_server.py): support checking full str on streaming guardra…
Jul 25, 2025
d6423d9
build: update pip package (#12998)
Jul 25, 2025
dc8c14b
Fix issue writing db (#13001)
emerzon Jul 26, 2025
c7774ba
add fix for redaction (#13005)
jugaldb Jul 26, 2025
10595ea
[MCP Gateway] add Litellm mcp alias for prefixing (#12994)
jugaldb Jul 26, 2025
9211158
Fixup ollama model listing (again) (#13008)
matthid Jul 26, 2025
586b1ec
[Vector Store] make vector store permission management OSS (#12990)
jugaldb Jul 26, 2025
4b50566
[FEAT] Model-Guardrails: Add on UI (#13006)
Jul 26, 2025
eed0cf2
UI SSO - fix reset env var when ui_access_mode is updated (#13011)
Jul 26, 2025
b921e22
[MCP Gateway] Litellm mcp multi header propagation (#13003)
jugaldb Jul 26, 2025
2c38dc0
test_router_auto_router
ishaan-jaff Jul 26, 2025
e8a374f
Litellm release notes 07 27 2025 p1 (#13027)
Jul 27, 2025
ff0b40a
test: fix test
Jul 27, 2025
1737cf4
VertexAI - camelcase optional params for image generation + Anthropic…
Jul 27, 2025
94aa6b0
Bulk User Edit - additional improvements - edit all users + set 'no-d…
Jul 27, 2025
1b7f7ba
build: build new ui
Jul 27, 2025
3359464
fix(proxy_settings_endpoints.py): fix clearing SSO settings
Jul 27, 2025
39b7ce5
refactor(create_key_button.tsx): cleanup read only option (confusing)
Jul 27, 2025
8d49dd6
build: update ui build
Jul 27, 2025
2da6d45
test: update logic to fix for unit tests
Jul 28, 2025
8f7d896
fix: add X-Initiator header for GitHub Copilot to reduce premium requ…
ckoehler Jul 28, 2025
d5c61cc
docs - openweb show how to include reasoning content (#13060)
ishaan-jaff Jul 28, 2025
2d697ca
build: bump pip
Jul 28, 2025
deb1efa
[Bug Fix] Pass through logging handler VertexAI - ensure multimodal e…
ishaan-jaff Jul 28, 2025
9459d72
Remove duplicate test case verifying field filtering logic (#13023)
emmanuel-ferdman Jul 28, 2025
47f6984
Properly parse json options for key generation in the UI (#12989)
5731la Jul 28, 2025
31d8edb
fix: correct CompletionRequest messages type to match OpenAI API spec…
restato Jul 28, 2025
3abf7cc
chore: Improve docs for cost tracking (#12976)
RichardoC Jul 28, 2025
75ae43e
feat(langfuse-otel): Add comprehensive metadata support to Langfuse O…
strickvl Jul 28, 2025
33c012a
fix scrolling issue (#13015)
jugaldb Jul 29, 2025
ba95541
[MCP gateway] add url namespacing docs (#13063)
jugaldb Jul 29, 2025
16af2d9
test: skip dbrx claude 3-7 sonnet test - rate limit errors
Jul 29, 2025
0780962
[Bug Fix] The model gemini-2.5-flash with the merge_reasoning_content…
ishaan-jaff Jul 29, 2025
378db1b
test: remove o1-preview
Jul 29, 2025
2ffc781
bump: version 1.74.9 → 1.74.10
Jul 29, 2025
a8371d2
[Feat] Add Google AI Studio Imagen4 model family (#13065)
ishaan-jaff Jul 29, 2025
ec2c5b3
default to 7 days (#12917)
NANDINI-star Jul 29, 2025
51bbd12
Added handling for pwd protected cert files in AOAI CertificateCreden…
Ne0-1 Jul 29, 2025
3a34792
docs: add Qwen Code CLI tutorial (#12915)
colesmcintosh Jul 29, 2025
3351012
docs
ishaan-jaff Jul 29, 2025
039c8a9
Azure `api_version="preview"` support + Bedrock cost tracking via Ant…
Jul 29, 2025
918e46d
Remove extraneous `s` in docs (#13079)
maxrabin Jul 29, 2025
4639be0
Fix list team v2 security check (#13094)
tofarr Jul 29, 2025
ae9a02d
[MCP gateway] add pre and during call hooks init (#13067)
jugaldb Jul 29, 2025
8a4a408
fix: improve MCP server URL validation to support internal/Kubernetes…
colesmcintosh Jul 29, 2025
4878bc6
[Bug Fix] Gemini-CLI - The Gemini Custom API request has an incorrect…
ishaan-jaff Jul 29, 2025
c2f6937
set default value for mcp namespace tool name to prevent duplicate en…
lvuna Jul 29, 2025
a6f7c70
[Feat] Allow using query_params for setting API Key for generateConte…
ishaan-jaff Jul 29, 2025
8352680
add openrouter grok4 (#13018)
jugaldb Jul 29, 2025
b5048e2
docs AZURE_CERTIFICATE_PASSWORD
ishaan-jaff Jul 29, 2025
c44e601
fix mcp dep for litellm (#13102)
ishaan-jaff Jul 29, 2025
f3b1b41
fix: always use choice index=0 for Anthropic streaming responses (#12…
Maximgitman Jul 29, 2025
52f097e
BUGFIX: Jitter should be added not multiplied (#12877) (#12901)
pathikrit Jul 29, 2025
d23a6e3
fix: best practices suggest this to set to true (#12809)
huetterma Jul 29, 2025
f8c09e4
fix: Set user from token user_id for OpenMeter integration (#13029)
betterthanbreakfast Jul 29, 2025
5b50a12
Revert "fix: Set user from token user_id for OpenMeter integration (#…
Jul 29, 2025
1899549
Fix fallback delete (#12606)
phosae Jul 29, 2025
39d59f1
Fix/gemini api key environment variable support (#12507)
sahusiddharth Jul 29, 2025
8de24ba
[MCP Gateway] Add protocol headers (#13062)
jugaldb Jul 29, 2025
b6f15ed
Fix token counter to ignore unsupported keys like prefix (#11791) (#1…
Amit-kr26 Jul 29, 2025
b7c5073
Custom Auth - bubble up custom exceptions (#13093)
Jul 29, 2025
b35d20f
docs(index.md): add rc docker tag
Jul 29, 2025
8e3caf4
docs(index.md): cleanup
Jul 29, 2025
8826e02
feat: Add dot notation support for all JWT fields (#13013)
colesmcintosh Jul 29, 2025
5fa2b00
[Feat] MLFlow Logging - Allow adding tags for ML Flow logging request…
ishaan-jaff Jul 29, 2025
760d747
[LLM translation] Add support for bedrock computer use (#12948)
jugaldb Jul 29, 2025
33f6511
bump: version 1.74.10 → 1.74.11
ishaan-jaff Jul 29, 2025
51a140f
transform_image_generation_response
ishaan-jaff Jul 30, 2025
e938fa9
fix transform_image_generation_response
ishaan-jaff Jul 30, 2025
acd915f
Revert "[MCP Gateway] Add protocol headers (#13062)"
ishaan-jaff Jul 30, 2025
d10a5a6
fix test_mlflow_request_tags_functionality
ishaan-jaff Jul 30, 2025
c408884
After selecting date range show loader on usage cost charts (#13113)
NANDINI-star Jul 30, 2025
50466e0
test_user_api_key_auth
ishaan-jaff Jul 30, 2025
1af0743
Revert "Revert "[MCP Gateway] Add protocol headers (#13062)""
ishaan-jaff Jul 30, 2025
36d46e0
use _safe_get_request_query_params
ishaan-jaff Jul 30, 2025
f544a4e
test: update test
Jul 30, 2025
1c18291
Revert "[LLM translation] Add support for bedrock computer use (#1294…
Jul 30, 2025
7e5bc8a
test: update test
Jul 30, 2025
a34206f
fix(model_checks.py): handle custom values in wildcard model name (e.…
Jul 30, 2025
ea6b4b0
move to use_prisma_migrate by default + resolve team-only models on a…
Jul 30, 2025
ae947e6
test: update test
Jul 30, 2025
97d8958
fix tool aws bedrock call index when the function only have optional …
jnhyperion Jul 30, 2025
8c70025
docs: cleanup
Jul 30, 2025
e324f76
[MCP Gateway] add health check endpoints for MCP (#13106)
jugaldb Jul 30, 2025
5fbe732
[MCP Protocol header] fix issue with clients protocol header (#13112)
jugaldb Jul 30, 2025
0af4520
Added Voyage, Jinai, Deepinfra and VolcEngine providers on the UI (#1…
NANDINI-star Jul 30, 2025
6817768
docs: cleanup
Jul 30, 2025
89daa66
fix object permission for orgs (#13142)
jugaldb Jul 30, 2025
1f0e5ef
New Advanced Date Range Picker Component (#13141)
NANDINI-star Jul 30, 2025
0201c51
[Feat] UI + Backend add a tab for use agent activity (#13146)
ishaan-jaff Jul 30, 2025
840dd2e
[LLM translation] Fix bedrock computer use (#13143)
jugaldb Jul 30, 2025
eb8a338
[MCP Guardrails] move pre and during hooks to ProxyLoggin (#13109)
jugaldb Jul 30, 2025
92cdac2
[Feat] v2 updates - tracking DAU, WAU, MAU for coding tool usage + sh…
ishaan-jaff Jul 30, 2025
3ca99f1
Litellm explore postgres db ci cd (#13156)
Jul 30, 2025
5db4862
[MCP Gateway] Litellm mcp client list fail (#13114)
jugaldb Jul 30, 2025
6da3604
ci: remove bad script
Jul 30, 2025
3bf7411
ci(config.yml): run prisma generate before running enterprise tests
Jul 30, 2025
5aa4a70
fix grype scan
ishaan-jaff Jul 30, 2025
2af5900
build(pyproject.toml): bump version
Jul 30, 2025
88aed06
ci: migrate to db in pipeline
Jul 30, 2025
fa7e203
fix migrations (#13157)
jugaldb Jul 30, 2025
090e2ff
Revert "[LLM translation] Fix bedrock computer use (#13143)"
ishaan-jaff Jul 30, 2025
50b1332
poetry lock
ishaan-jaff Jul 30, 2025
09cc748
test: handle api instability
Jul 30, 2025
2266938
ci(config.yml): remove check
Jul 30, 2025
e3ba350
ci: migrate to postgres in ci/cd
Jul 31, 2025
cf4c639
test fix xai - it goes through base llm tests already
ishaan-jaff Jul 31, 2025
c6a8733
build(config.yml): migrate build_and_test to ci/cd pg db (#13166)
Jul 31, 2025
77f506e
add framework name to UserAgent header in AWS Bedrock API call (#13159)
0x-fang Jul 31, 2025
c35003b
fix: remove obsolete attribute `version` in docker compose (#13172)
kowyo Jul 31, 2025
fad453b
test_chat_completion_ratelimit
ishaan-jaff Jul 31, 2025
65ca4f6
Revert "add framework name to UserAgent header in AWS Bedrock API cal…
ishaan-jaff Jul 31, 2025
79be436
[Feat] Background Health Checks - Allow disabling background health c…
ishaan-jaff Jul 31, 2025
524a1ff
[Proxy Startup]fix db config through envs (#13111)
jugaldb Jul 31, 2025
edd3c3b
UI - new build
ishaan-jaff Jul 31, 2025
212a339
fix: support negative indexes in cache_control_injection_points for A…
AnandKhinvasara Jul 31, 2025
cbb922b
[Bug Fix] Gemini-CLI Integration - ensure tool calling works as expec…
ishaan-jaff Jul 31, 2025
115d248
[Bug Fix] Infra - ensure that stale Prisma clients disconnect DB conn…
ishaan-jaff Jul 31, 2025
ee70d59
[Feat] Allow redacting message / response content for specific loggin…
ishaan-jaff Jul 31, 2025
3acb78d
Litellm fix fallbacks UI (#13191)
ishaan-jaff Aug 1, 2025
56fc0cf
ui polish
ishaan-jaff Aug 1, 2025
0666ede
fix: correct patch path in langfuse test for MAX_LANGFUSE_INITIALIZED…
colesmcintosh Aug 1, 2025
cc4881e
ui new build
ishaan-jaff Aug 1, 2025
547c46c
add When to Use Each Endpoint (#13193)
ishaan-jaff Aug 1, 2025
c7e4435
Fix - using managed files w/ OTEL + UI - add model group alias on UI …
Aug 1, 2025
78997c2
Anthropic - working mid-stream fallbacks (#13149)
Aug 1, 2025
d887a3d
Anthropic - mid stream fallbacks p2 (add token usage across both call…
Aug 1, 2025
74e29ae
[UI QA] QA - Agent Activity Tab (#13203)
ishaan-jaff Aug 1, 2025
04c2994
Fix/panw prisma airs post call hook (#13185)
jroberts2600 Aug 1, 2025
3edb71e
allow helm hooks for migrations job (#13174)
unique-jakub Aug 1, 2025
6e5fe51
add openssl in apk install in runtime stage in dockerfile.non_root (#…
mdiloreto Aug 1, 2025
32da244
bump: version 1.74.12 → 1.74.13
ishaan-jaff Aug 1, 2025
817b139
bump: version 1.74.13 → 1.74.14
ishaan-jaff Aug 1, 2025
fe24c27
Prompt Management - add local dotprompt file support
Aug 1, 2025
9955521
allow redifine base api url in pass trough (#13134)
tyumentsev4 Aug 1, 2025
1e315dc
Fix API Key Being Logged (#12978)
aayush-malviya-acquia Aug 1, 2025
4a66617
build(config.yml): use ci/cd postgres in test
Aug 1, 2025
032cbaf
fix(litellm_logging.py): fix merge error
Aug 1, 2025
952c2b5
test: update test
Aug 1, 2025
461b615
test: update tests
Aug 1, 2025
e3c9fc4
test: update tests
Aug 1, 2025
fedd805
test: loosen check
Aug 1, 2025
278dd52
build(ui/): fix linting errors
Aug 1, 2025
917233f
fix(model_group_alias_settings.tsx): fix check
Aug 1, 2025
72fd4e3
test: remove bad unit tests
Aug 1, 2025
d158a03
test: update unit tests
Aug 1, 2025
3501ee7
docs(index.md): cleanup
Aug 1, 2025
23dfab3
Index.md - cleanup docs (#13215)
Aug 1, 2025
bfabf27
[LLM translation] Fix bedrock computer use #13143 (#13150)
jugaldb Aug 1, 2025
3d02d36
docs(index.md): cleanup
Aug 1, 2025
4a85a91
[QA] Viewing Agent Activity Headers on UI Usage Page (#13212)
ishaan-jaff Aug 1, 2025
1358978
test_recreate_prisma_client_successful_disconnect
ishaan-jaff Aug 1, 2025
b36df94
ui new build
ishaan-jaff Aug 1, 2025
9d6098e
fix vertex deprecated old model
ishaan-jaff Aug 1, 2025
7cf3b46
[Separate Health App] Update Helm Deployment.yaml (#13162)
jugaldb Aug 1, 2025
3867813
[Proxy]fix key mgmt (#13148)
jugaldb Aug 2, 2025
a4c1160
[LLM] fix model reload on model update (#13216)
jugaldb Aug 2, 2025
c125ae4
suppress httpx logging (#13217)
jugaldb Aug 2, 2025
900c7f4
[MCP Gateway] Litellm mcp pre and during guardrails (#13188)
jugaldb Aug 2, 2025
44900e7
testing fixes - vertex ai deprecated claude 3 sonnet models
ishaan-jaff Aug 2, 2025
eb173f9
Add advanced date picker to all the tabs on the usage page (#13221)
NANDINI-star Aug 2, 2025
1e33dc5
add Perplexity citation annotations support (#13225)
kankute-sameer Aug 2, 2025
0ac093b
fix: role chaining and session name with webauthentication for aws be…
RichardoC Aug 2, 2025
c427531
Fix missing extra_headers support for vLLM/openai_like embeddings (#1…
colesmcintosh Aug 2, 2025
825923e
litellm/proxy: preserve model order of /v1/models and /model_group/in…
AlexanderYastrebov Aug 2, 2025
a107a4b
Prompt Management - abstract prompt templates away from model list (e…
Aug 2, 2025
831eeaf
[QA Fixes for MCP] - Ensure MCPs load + don't run a health check ever…
ishaan-jaff Aug 2, 2025
342fd2d
Revert "fix: role chaining and session name with webauthentication fo…
Aug 2, 2025
4cb42f8
fix(proxy_setting_endpoints.py): don't block startup if team doesn't …
Aug 2, 2025
363c303
Prompt Management (2/2) - New `/prompt/list` endpoint + key-based acc…
Aug 2, 2025
cd9c388
truncateUserAgent
ishaan-jaff Aug 2, 2025
b297dff
[UI QA Fixes] Stable release (#13231)
ishaan-jaff Aug 2, 2025
af9031b
Revert "Fix SSO Logout | Create Unified Login Page with SSO and Usern…
ishaan-jaff Aug 2, 2025
2dd9361
Revert "Revert "Fix SSO Logout | Create Unified Login Page with SSO a…
ishaan-jaff Aug 2, 2025
b279ba8
fixes - ui login with SSO
ishaan-jaff Aug 2, 2025
39cb565
doc fix - missing "prompts" in /key endpoint swagger
ishaan-jaff Aug 2, 2025
c663bef
ui new build
ishaan-jaff Aug 2, 2025
c378e20
bump: version 1.74.14 → 1.74.15
ishaan-jaff Aug 2, 2025
ccbc81a
ruff fix
ishaan-jaff Aug 2, 2025
6929767
docs release notes
ishaan-jaff Aug 2, 2025
5dfc884
fixes MCP gateway docs
ishaan-jaff Aug 2, 2025
e306fb6
[docs release notes] (#13237)
ishaan-jaff Aug 2, 2025
8d6b333
docs computer use
ishaan-jaff Aug 2, 2025
9b029c3
docs RC
ishaan-jaff Aug 2, 2025
340b64a
docs - Track Usage for Coding Tools
ishaan-jaff Aug 2, 2025
e32169d
docs cost tracking coding
ishaan-jaff Aug 2, 2025
69a3604
agent 4.png
ishaan-jaff Aug 2, 2025
0f9f5f7
docs fix
ishaan-jaff Aug 2, 2025
06856b4
docs fix
ishaan-jaff Aug 2, 2025
2ee4e84
docs fix
ishaan-jaff Aug 2, 2025
4c217c6
docs User Agent Activity Tracking
ishaan-jaff Aug 3, 2025
b79f55e
UI - Add giving keys prompt access (#13233)
Aug 3, 2025
e47b30a
Prompt Management - Add table + prompt info page to UI (#13232)
Aug 3, 2025
3119064
Prompt Management - add prompts on UI (#13240)
Aug 3, 2025
9aeca96
fix openshift (#13239)
jugaldb Aug 3, 2025
271fce9
build: update poetry
Aug 3, 2025
2ee8513
fix(key_management_endpoints.py): fix check
Aug 3, 2025
98102e2
docs(index.md): cleanup
Aug 3, 2025
36229dc
[LLM Translation] Fix Model Usage not having text tokens (#13234)
jugaldb Aug 4, 2025
b318f55
[UI] Add team deletion check for teams with keys (#12953)
jugaldb Aug 4, 2025
dae7200
[Bug Fix] OpenAI / Azure Responses API - Add `service_tier` , `safety…
ishaan-jaff Aug 4, 2025
f374970
Bug Fix - Responses API raises error with Gemini Tool Calls in `input…
ishaan-jaff Aug 4, 2025
bfecab2
docs(index.md): cleanup tag
Aug 4, 2025
747467c
docs(user_keys.md): add litellm python sdk tab
Aug 4, 2025
779579a
Update model_prices_and_context_window.json (#13244)
bbartels Aug 4, 2025
849f5e0
[Bug Fix] Fix Server root path regression on UI when using "Login" (…
ishaan-jaff Aug 4, 2025
056b60a
Support OCI provider (#13206)
breno-aumo Aug 4, 2025
a17d483
Add GCS bucket caching support (#13122)
pascalwhoop Aug 4, 2025
1c6be9b
Fix: Langfuse reporting "client closed" error due to httpx client TTL…
ZPerling Aug 4, 2025
368c9b7
add correct pricing (#13269)
jugaldb Aug 5, 2025
37cb443
refactor(oci/chat/transformation.py): lazy load package imports
Aug 5, 2025
ba1882f
[Bug Fix] Prometheus - fix for `litellm_input_tokens_metric`, `litell…
ishaan-jaff Aug 5, 2025
d948b47
bump: version 1.74.15 → 1.75.0
ishaan-jaff Aug 5, 2025
8314227
bump: version 1.75.0 → 1.75.1
ishaan-jaff Aug 5, 2025
ad26cba
add litellm-enterprise==0.1.17
ishaan-jaff Aug 5, 2025
de7108b
input cost per token higher than 1 test (#13270)
jugaldb Aug 5, 2025
efd3496
[LLM Translation] Support /v1/models/{model_id} retrieval (#13268)
jugaldb Aug 5, 2025
ec205fe
[UI] - Add ability to set model alias per key/team (#13276)
ishaan-jaff Aug 5, 2025
af67c35
fix OCI linting errors (#13279)
Aug 5, 2025
eb49f98
Ensure disable_llm_api_endpoints works + Add wildcard model support f…
Aug 5, 2025
416da06
fix(main.py): handle tool being a pydantic object (#13274)
Aug 5, 2025
5a02eb4
test_function_calling_with_tool_response
ishaan-jaff Aug 5, 2025
7c42659
Revert "Fix: Langfuse reporting "client closed" error due to httpx cl…
ishaan-jaff Aug 5, 2025
d6b0e41
Merge remote-tracking branch 'upstream/main' into merge-upstream-2025…
DoDoMan-TTT Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion litellm/llms/base_llm/base_model_iterator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ast
import json
from abc import abstractmethod
from typing import List, Optional, Union, cast
Expand Down
1 change: 1 addition & 0 deletions litellm/llms/bedrock/base_aws_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,4 +798,5 @@ def _sign_request(
headers is not None and "Authorization" in headers
): # prevent sigv4 from overwriting the auth header
request_headers_dict["Authorization"] = headers["Authorization"]

return request_headers_dict, request.body
167 changes: 85 additions & 82 deletions tests/llm_translation/base_llm_unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,96 +1200,99 @@ def test_function_calling_with_tool_response(self):
from litellm.utils import supports_function_calling
from litellm import completion
litellm._turn_on_debug()
try:

os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")

base_completion_call_args = self.get_base_completion_call_args()
if not supports_function_calling(base_completion_call_args["model"], None):
print("Model does not support function calling")
pytest.skip("Model does not support function calling")

def get_weather(city: str):
return f"City: {city}, Weather: Sunny with 34 degree Celcius"
base_completion_call_args = self.get_base_completion_call_args()
if not supports_function_calling(base_completion_call_args["model"], None):
print("Model does not support function calling")
pytest.skip("Model does not support function calling")
def get_weather(city: str):
return f"City: {city}, Weather: Sunny with 34 degree Celcius"

TOOLS = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the weather in a city",
"parameters": {
"$id": "https://some/internal/name",
"$schema": "https://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city to get the weather for",
}
TOOLS = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the weather in a city",
"parameters": {
"$id": "https://some/internal/name",
"$schema": "https://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city to get the weather for",
}
},
"required": ["city"],
"additionalProperties": False,
},
"required": ["city"],
"additionalProperties": False,
"strict": True,
},
"strict": True,
},
}
]
}
]


messages = [{ "content": "How is the weather in Mumbai?","role": "user"}]
response, iteration = "", 0
while True:
if response:
break
# Create a streaming response with tool calling enabled
stream = completion(
**base_completion_call_args,
messages=messages,
tools=TOOLS,
stream=True,
)

final_tool_calls = {}
for chunk in stream:
delta = chunk.choices[0].delta
print(delta)
if delta.content:
response += delta.content
elif delta.tool_calls:
for tool_call in chunk.choices[0].delta.tool_calls or []:
index = tool_call.index
if index not in final_tool_calls:
final_tool_calls[index] = tool_call
else:
final_tool_calls[
index
].function.arguments += tool_call.function.arguments
if final_tool_calls:
for tool_call in final_tool_calls.values():
if tool_call.function.name == "get_weather":
city = json.loads(tool_call.function.arguments)["city"]
tool_response = get_weather(city)
messages.append(
{
"role": "assistant",
"tool_calls": [tool_call],
"content": None,
}
)
messages.append(
{
"role": "tool",
"tool_call_id": tool_call.id,
"content": tool_response,
}
)
iteration += 1
if iteration > 2:
print("Something went wrong!")
break
messages = [{ "content": "How is the weather in Mumbai?","role": "user"}]
response, iteration = "", 0
while True:
if response:
break
# Create a streaming response with tool calling enabled
stream = completion(
**base_completion_call_args,
messages=messages,
tools=TOOLS,
stream=True,
)

print(response)
final_tool_calls = {}
for chunk in stream:
delta = chunk.choices[0].delta
print(delta)
if delta.content:
response += delta.content
elif delta.tool_calls:
for tool_call in chunk.choices[0].delta.tool_calls or []:
index = tool_call.index
if index not in final_tool_calls:
final_tool_calls[index] = tool_call
else:
final_tool_calls[
index
].function.arguments += tool_call.function.arguments
if final_tool_calls:
for tool_call in final_tool_calls.values():
if tool_call.function.name == "get_weather":
city = json.loads(tool_call.function.arguments)["city"]
tool_response = get_weather(city)
messages.append(
{
"role": "assistant",
"tool_calls": [tool_call],
"content": None,
}
)
messages.append(
{
"role": "tool",
"tool_call_id": tool_call.id,
"content": tool_response,
}
)
iteration += 1
if iteration > 2:
print("Something went wrong!")
break

print(response)
except litellm.ServiceUnavailableError:
pass

def test_reasoning_effort(self):
"""Test that reasoning_effort is passed correctly to the model"""
Expand Down
Loading