Commit Graph
32496 Commits
Author SHA1 Message Date
Vincent KocGitHubgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
0dcc744f7e fix(proxy): handle missing DATABASE_URL in append_query_params (#21239)
* fix: handle missing database url in append_query_params

* Update litellm/proxy/proxy_cli.py

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 09:03:10 -08:00
Krrish Dholakia 89e95f779f fix(index.md): cleanup str 2026-02-16 08:59:17 -08:00
Atharva JaiswalandGitHub 7bcef1490b Fix: Exclude tool params for models without function calling support (#21125) (#21244)
* Fix tool params reported as supported for models without function calling (#21125)

JSON-configured providers (e.g. PublicAI) inherited all OpenAI params
including tools, tool_choice, function_call, and functions — even for
models that don't support function calling. This caused an inconsistency
where get_supported_openai_params included "tools" but
supports_function_calling returned False.

The fix checks supports_function_calling in the dynamic config's
get_supported_openai_params and removes tool-related params when the
model doesn't support it. Follows the same pattern used by OVHCloud
and Fireworks AI providers.

* Style: move verbose_logger to module-level import, remove redundant try/except

Address review feedback from Greptile bot:
- Move verbose_logger import to top-level (matches project convention)
- Remove redundant try/except around supports_function_calling() since it
  already handles exceptions internally via _supports_factory()
2026-02-16 08:36:32 -08:00
Sameer KankuteandGitHub 351e834802 Merge pull request #21320 from BerriAI/litellm_anthropic_doc_beta_header
Litellm anthropic doc beta header
2026-02-16 22:03:18 +05:30
Sameer Kankute 452f481fa0 correct the time 2026-02-16 21:59:54 +05:30
Sameer Kankute e67641cdb3 Add blog fffor Managing Anthropic Beta Headers 2026-02-16 21:46:12 +05:30
Sameer Kankute 2ad648a083 Add blog fffor Managing Anthropic Beta Headers 2026-02-16 21:45:01 +05:30
jquinterandGitHub bf93ce8841 Merge pull request #21284 from BerriAI/fix/mcp-server-test-mocks
fix(test): add cleanup fixture and no_parallel mark for MCP tests
2026-02-16 12:12:58 -03:00
jquinterGitHubgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
c3fb5e1ea5 Update tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 12:12:48 -03:00
jquinterandGitHub d84336bd07 Merge pull request #21283 from BerriAI/fix/video-generation-logging-mock
fix(test): correct async mock for video generation logging test
2026-02-16 12:12:20 -03:00
jquinterandGitHub 87861549d8 Merge pull request #21282 from BerriAI/fix/cost-calculation-log-test-parallel
fix(test): replace caplog with custom handler for parallel execution
2026-02-16 12:11:48 -03:00
jquinterandGitHub a2ce7fc99d Merge pull request #21280 from BerriAI/fix/add-pytest-postgresql-dependency
fix(deps): add pytest-postgresql for db schema migration tests
2026-02-16 12:09:55 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 af9b6f6e0d Merge main into fix/add-pytest-postgresql-dependency
Resolved poetry.lock conflict by regenerating with Poetry 2.3.2.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 12:03:20 -03:00
Harshit JainandGitHub 1308a2cd76 Merge pull request #20314 from Harshit28j/fix/sso_PKCE_deployments
fix: SSO PKCE support fails in multi-pod Kubernetes deployments
litellm_sso-dev-v1.81.13
2026-02-16 19:40:44 +05:30
Harshit JainandGitHub dd2111e664 Merge pull request #20321 from Harshit28j/litellm_fix-virtual-key-grace-period
fix: virutal key grace period from env/UI
2026-02-16 19:36:18 +05:30
Sameer KankuteandGitHub 86a254a215 Merge pull request #21307 from BerriAI/litellm_oss_staging_02_14_20262
Litellm oss staging 02 14 20262
2026-02-16 19:10:59 +05:30
Sameer KankuteandGitHub 0f2b0869ae Merge pull request #21311 from BerriAI/litellm_add_agents_sdk_openai
Add doc for OpenAI Agents SDK with LiteLLM
2026-02-16 19:06:27 +05:30
Sameer Kankute 6ceebdcfe2 fix mypy 2026-02-16 19:05:06 +05:30
Sameer KankuteGitHubgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
be9df253dd Update docs/my-website/sidebars.js
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 19:03:15 +05:30
Sameer Kankute 5b6e232da6 Add doc for OpenAI Agents SDK with LiteLLM 2026-02-16 19:00:53 +05:30
Sameer Kankute a38b4c8924 Add doc for OpenAI Agents SDK with LiteLLM 2026-02-16 18:59:39 +05:30
Sameer Kankute 4548d9fbe9 fix mypy 2026-02-16 18:55:21 +05:30
Sameer Kankute ac2f17a514 fix: proxy/batches_endpoints/endpoints.py:309:11: PLR0915 Too many statements (54 > 50) 2026-02-16 18:41:06 +05:30
Sameer KankuteandGitHub 27890dd46e Merge pull request #21306 from mjkam/fix/bedrock-min-budget-tokens
fix(bedrock): clamp thinking.budget_tokens to minimum 1024
2026-02-16 18:31:28 +05:30
Sameer KankuteandGitHub 72a1bd66c7 Merge pull request #21157 from Point72/ephrimstanley/s3-logger-skip-missing-standard-logging-object
Managed batches - Misc bug fixes
2026-02-16 18:29:59 +05:30
Emerson GomesandSameer Kankute 06e7bfce2e perf(spend): avoid duplicate daily agent transaction computation (#21187) 2026-02-16 18:28:34 +05:30
ConstantineandSameer Kankute 7ef9083812 fix(aiohttp): prevent closing shared ClientSession in AiohttpTransport (#21117)
When a shared ClientSession is passed to LiteLLMAiohttpTransport,
calling aclose() on the transport would close the shared session,
breaking other clients still using it.

Add owns_session parameter (default True for backwards compatibility)
to AiohttpTransport and LiteLLMAiohttpTransport. When a shared session
is provided in http_handler.py, owns_session=False is set to prevent
the transport from closing a session it does not own.

This aligns AiohttpTransport with the ownership pattern already used
in AiohttpHandler (aiohttp_handler.py).
2026-02-16 18:28:28 +05:30
Kristoffer ArlindandSameer Kankute 51b1b0339c Allow effort="max" for Claude Opus 4.6 (#21112) 2026-02-16 18:28:22 +05:30
Ephrim Stanley a3762e7d49 Addressed greptile comments to extract common helpers and return 404 2026-02-16 07:58:04 -05:00
FlyandSameer Kankute 9c71d8b61b feat(s3): add support for virtual-hosted-style URLs (#21094)
Add s3_use_virtual_hosted_style parameter to support AWS S3 virtual-hosted-style URL format (bucket.endpoint/key) alongside the existing path-style format (endpoint/bucket/key).

This enables compatibility with S3-compatible services like MinIO and aligns with AWS S3 official terminology.
2026-02-16 18:26:44 +05:30
jquinterandSameer Kankute 43f9a588d9 fix: improve Langfuse test isolation to prevent flaky failures (#21093)
The test was creating fresh mocks but not fully isolating from setUp state,
causing intermittent CI failures with 'Expected generation to be called once.
Called 0 times.'

Instead of creating fresh mocks, properly reset the existing setUp mocks to
ensure clean state while maintaining proper mock chain configuration.
2026-02-16 18:26:37 +05:30
Sameer KankuteandGitHub 70a49a4b35 Merge pull request #21295 from BerriAI/litellm_correct_converse_usage
Fix converse anthropic usage object according to v1/messages specs
2026-02-16 18:22:30 +05:30
Sameer KankuteandGitHub 4976029ee6 Merge pull request #21302 from BerriAI/litellm_kilo_ai
Add routing based on if reasoning is supported or not
2026-02-16 18:20:25 +05:30
mjkamandClaude Opus 4.6 37da38fdaa fix(bedrock): clamp thinking.budget_tokens to minimum 1024
Bedrock rejects thinking.budget_tokens values below 1024 with a 400
error. This adds automatic clamping in the LiteLLM transformation
layer so callers (e.g. router with reasoning_effort="low") don't
need to know about the provider-specific minimum.

Fixes #21297

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 21:49:41 +09:00
Sameer KankuteandGitHub 3347fabe6b Merge pull request #21209 from jayy-77/fix/21193-chatgpt-codex-unsupported-params
Fix/21193 chatgpt codex unsupported params
2026-02-16 18:13:10 +05:30
Ephrim Stanley cc4e022176 Removed stray .md file 2026-02-16 07:14:42 -05:00
Sameer Kankute c00c5a6e29 add fireworks_ai/accounts/fireworks/models/kimi-k2p5 in model map 2026-02-16 17:39:04 +05:30
Sameer Kankute ee9e997755 Add routing based on if reasoning is supported or not 2026-02-16 17:02:34 +05:30
Sameer Kankute 01cdec5771 Fix converse anthropic usage object according to v1/messages specs 2026-02-16 14:03:31 +05:30
Julio Quinteros ProandClaude Sonnet 4.5 f2b6c38c86 Remove redundant import inside test method
The module litellm.videos.main is already imported at the top of
the file (line 21), so the import inside the test method is redundant.

Addresses Greptile feedback (minor style issue).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 21:15:52 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 fe691cac08 Remove unused pytest import and add trailing newline
- Removed unused pytest import (caplog fixture was removed)
- Added missing trailing newline at end of file

Addresses Greptile feedback (minor style issues).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 21:15:12 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 1deb4456e0 Regenerate poetry.lock with Poetry 2.3.2
Updated lock file to use Poetry 2.3.2 (matching main branch standard).
This addresses Greptile feedback about Poetry version mismatch.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 21:12:22 -03:00
jquinterandGitHub 44bb1dafdb Merge pull request #21286 from BerriAI/fix/proxy-config-callback-validation
fix(test): mock environment variables for callback validation test
2026-02-15 21:11:12 -03:00
jquinterandGitHub 49fd1b5de4 Merge pull request #21279 from BerriAI/fix/tokenizer-cache-test-isolation
fix(test): clear tokenizer LRU cache for test isolation
2026-02-15 21:05:38 -03:00
jquinterandGitHub 5be76dc6e0 Merge pull request #21281 from BerriAI/fix/add-fakeredis-dependency
fix(deps): add fakeredis for pod lock manager tests
2026-02-15 21:04:54 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 2d41b03f8b fix(test): mock environment variables for callback validation test
The test test_proxy_config_state_post_init_callback_call was failing with:
```
ValidationError: 2 validation errors for TeamCallbackMetadata
callback_vars.langfuse_public_key
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
```

Root cause: The test uses environment variable references like
"os.environ/LANGFUSE_PUBLIC_KEY" which get resolved at runtime. In
parallel execution with --dist=loadscope, these environment variables
may not be set in all worker processes, causing the resolution to
return None, which fails Pydantic validation expecting strings.

Solution: Use monkeypatch to set the required environment variables
before the test runs. This ensures consistent behavior across all
test execution environments (local, CI, parallel workers).

Fixes test failure exposed by PR #21277.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:44:17 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 cc2dff0581 fix(test): add cleanup fixture and no_parallel mark for MCP tests
Two MCP server tests were failing when run with pytest-xdist parallel
execution (--dist=loadscope):
- test_mcp_routing_with_conflicting_alias_and_group_name
- test_oauth2_headers_passed_to_mcp_client

Both tests showed assertion failures where mocks weren't being called
(0 times instead of expected 1 time).

Root cause: These tests rely on global_mcp_server_manager singleton
state and complex async mocking that doesn't work reliably with
parallel execution. Each worker process can have different state
and patches may not apply correctly.

Solution:
1. Added autouse fixture to clean up global_mcp_server_manager registry
   before and after each test for better isolation
2. Added @pytest.mark.no_parallel to these specific tests to ensure
   they run sequentially, avoiding parallel execution issues

This approach maintains test reliability while allowing other tests
in the file to still benefit from parallelization.

Fixes test failures exposed by PR #21277.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:42:03 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 8ea0c93d67 fix(test): correct async mock for video generation logging test
The test was failing with AuthenticationError because the mock wasn't
intercepting the actual HTTP handler calls. This caused real API calls
with no API key, resulting in 401 errors.

Root cause: The test was patching the wrong target using string path
'litellm.videos.main.base_llm_http_handler' instead of using patch.object
on the actual handler instance. Additionally, it was mocking the sync
method instead of async_video_generation_handler.

Solution: Use patch.object with side_effect pattern on the correct
async handler method, following the same pattern used in
test_video_generation_async().

Fixes test failure in PR #21277 when running with --dist=loadscope.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:40:43 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 4f2c7d3040 fix(test): replace caplog with custom handler for parallel execution
The cost calculation log level tests were failing when run with pytest-xdist
parallel execution because caplog doesn't work reliably across worker processes.
This causes "ValueError: I/O operation on closed file" errors.

Solution: Replace caplog fixture with a custom LogRecordHandler that directly
attaches to the logger. This approach works correctly in parallel execution
because each worker process has its own handler instance.

Fixes test failures in PR #21277 when running with --dist=loadscope.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:39:24 -03:00
Julio Quinteros ProandClaude Sonnet 4.5 706792ba96 refactor: simplify cache clearing to avoid over-engineering
Based on Greptile feedback:
- Removed autouse fixture (applied too broadly to unrelated tests)
- Removed setUpClass (redundant since setUp runs before every test)
- Kept module-level clear and setUp() method (sufficient for test isolation)
- Added blank line for proper formatting

The simplified approach still ensures test isolation under --dist=loadscope
while avoiding unnecessary complexity.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:36:24 -03:00