Commit graph

33248 commits

Author SHA1 Message Date
Julio Quinteros Pro
fb839d5dd3 chore: regenerate poetry.lock after rebase with main
After rebasing with main, pyproject.toml contains dependency changes from
PR #21394 (removed pytest-retry, added pytest-xdist). Running `poetry lock`
to sync the lock file with the updated pyproject.toml.

This resolves the CI error:
'pyproject.toml changed significantly since poetry.lock was last generated'
2026-02-17 19:01:02 -03:00
Julio Quinteros Pro
26f8e1ac0a fix(tests): resolve test isolation issue in http_handler tests
Fix isinstance() checks failing due to module reload in conftest.py.

The conftest.py fixture reloads the litellm module between test modules,
which causes class references imported at module-level to become stale.
When AsyncHTTPHandler is imported at the top of the file and then litellm
is reloaded by the fixture, the isinstance() check fails because the
returned instance is of the NEW AsyncHTTPHandler class while the test
is checking against the OLD class reference.

Solution: Import AsyncHTTPHandler locally within each test function that
uses isinstance() checks. This ensures we get the fresh class reference
after the module reload.

Fixed tests:
- test_session_reuse_integration
- test_get_async_httpx_client_with_shared_session
- test_get_async_httpx_client_without_shared_session

This resolves intermittent CI failures where parallel test execution
triggers the module reload behavior.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 19:01:02 -03:00
jquinter
7f1cb90228
Merge pull request #21412 from BerriAI/fix/remove-unused-asyncio-imports
fix: remove unused asyncio imports (linting errors)
2026-02-17 18:55:00 -03:00
Julio Quinteros Pro
9b5eddda17 fix: remove unused asyncio imports (F401)
Remove `asyncio` imported but unused in:
- litellm/integrations/custom_guardrail.py
- litellm/proxy/common_utils/performance_utils.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-17 18:54:18 -03:00
Ishaan Jaff
cea1279afe
Add EU AI Act Article 5 template to policy templates UI (#21414)
* Add EU AI Act Article 5 template to policy templates

Adds the EU AI Act Article 5 - Prohibited Practices template to the policy templates JSON that the UI reads from.

The template uses the eu_ai_act_article5_prohibited_practices category that was added in PR #21342. Blocks prompts requesting:
- Social scoring systems
- Emotion recognition in workplace/education
- Biometric categorization for sensitive attributes
- Predictive profiling and manipulation

Shows up in the UI under EU region filter with High complexity.

* Update policy templates backup with EU AI Act template

Syncs the backup file with the main policy_templates.json to include the EU AI Act Article 5 template.
2026-02-17 13:49:52 -08:00
jquinter
63bb27ef62
Merge pull request #21396 from BerriAI/fix/conftest-deprecation-warnings
fix(tests): improve conftest isolation and remove deprecation warnings
2026-02-17 18:21:41 -03:00
Julio Quinteros Pro
890cc08a3a fix: resolve merge conflict and Greptile feedback
- Remove pytest-retry config from pyproject.toml (fixes merge conflict with main)
- Fix asymmetric callback restoration in isolate_litellm_state fixture
  - Now properly saves and restores all callback lists
  - Prevents test pollution from callback state leakage
- Add cache flush after module reload in setup_and_teardown
  - Prevents stale client instances after importlib.reload
- Remove unused imports (curr_dir, Router)

This addresses:
1. Merge conflict in pyproject.toml (CONFLICTING status)
2. Greptile's feedback about asymmetric callback handling
3. Missing cache flush after module reload
4. Code cleanliness (unused variables)
2026-02-17 18:20:44 -03:00
Julio Quinteros Pro
480974e0f9 fix: complete asyncio.iscoroutinefunction deprecation fix across codebase
Replace all asyncio.iscoroutinefunction() calls with inspect.iscoroutinefunction()
to fix Python 3.16 deprecation warnings throughout the entire codebase.

Files updated:
- litellm/litellm_core_utils/logging_utils.py
- litellm/proxy/common_utils/performance_utils.py
- litellm/proxy/management_endpoints/key_management_endpoints.py (2 occurrences)
- litellm/proxy/management_endpoints/ui_sso.py
- litellm/litellm_core_utils/redact_messages.py
- litellm/integrations/custom_guardrail.py
- tests/proxy_unit_tests/test_response_polling_handler.py

This addresses Greptile's feedback about incomplete deprecation fixes.
All instances now use the standard library inspect.iscoroutinefunction()
which is the recommended approach and won't be deprecated.
2026-02-17 18:20:44 -03:00
Julio Quinteros Pro
6678b2bd1d fix: replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction
- asyncio.iscoroutinefunction() is deprecated in Python 3.16
- Use inspect.iscoroutinefunction() instead (standard library function)
- Removes deprecation warning in track_llm_api_timing decorator

This is part of the broader effort to remove Python 3.16 deprecation warnings.
2026-02-17 18:20:44 -03:00
Julio Quinteros Pro
e37befd5b4 fix: address Greptile feedback - remove duplicates and fix deprecations
- Remove duplicate @pytest.fixture decorator on setup_and_teardown
- Delete conftest_improved.py (duplicate file, pytest only loads conftest.py)
- Remove deprecated event_loop fixture override
- Add asyncio_default_fixture_loop_scope config in pyproject.toml (modern approach)

This fixes pytest-asyncio >=0.22 deprecation warnings while maintaining
session-scoped event loop behavior.
2026-02-17 18:20:43 -03:00
Harshit Jain
5da5a1478e
Merge branch 'litellm_prompt_registry_fix' of https://github.com/Harshit28j/litellm into litellm_prompt_registry_fix 2026-02-18 02:50:29 +05:30
Julio Quinteros Pro
53d9cad8f5 fix(tests): restore autouse=True to setup_and_teardown fixture
Critical fix for Greptile feedback: The setup_and_teardown fixture was
missing the autouse=True parameter, causing the module reload logic to
never execute. This would result in test pollution as callbacks would
chain across modules.

Changes:
- Add autouse=True to setup_and_teardown fixture in conftest.py
- Add autouse=True to setup_and_teardown fixture in conftest_improved.py

Note: conftest_improved.py is intentionally kept as a reference
implementation showing the recommended improvements. It demonstrates
better patterns for test isolation that can be adopted later.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 18:20:23 -03:00
Julio Quinteros Pro
3b176a0970 fix(tests): remove asyncio.get_event_loop_policy deprecation warning
- Replace asyncio.get_event_loop_policy() with asyncio.new_event_loop()
- Use asyncio.set_event_loop() to set the event loop
- Fixes deprecation warning in Python 3.16
- Updated both conftest.py and conftest_improved.py

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 18:20:23 -03:00
Julio Quinteros Pro
f9ea565b3b fix(tests): improve test isolation in conftest.py
- Move cache flushing to function scope
  - Disable module reload in parallel mode
  - Remove manual event loop creation
2026-02-17 18:20:23 -03:00
Harshit Jain
d061ae9370
fix docs and format 2026-02-18 02:49:52 +05:30
Harshit Jain
2efe4ba165
Update cookbook/mock_prompt_management_server/mock_prompt_management_server.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-18 02:31:27 +05:30
Harshit Jain
d7b2ce92ba
Merge remote-tracking branch 'upstream/main' into litellm_prompt_registry_fix 2026-02-18 02:26:34 +05:30
jquinter
ee83d477a4
Merge pull request #21394 from BerriAI/fix/ci-test-improvements
fix(ci): reduce parallelism and add retry logic to improve test stability
2026-02-17 17:13:34 -03:00
Ishaan Jaff
dc1775d41b
Day 0 Support: Claude Sonnet 4.6 (#21401)
* docs: add Day 0 Sonnet 4.6 support blog post

Add concise blog post announcing Day 0 support for Claude Sonnet 4.6 with Docker image and usage examples across:
- Anthropic API
- Azure AI
- Vertex AI
- Bedrock

Includes both LiteLLM Proxy and SDK usage for all providers.

* docs: add Sonnet 4.6 blog post to sidebar navigation

Add link to Claude Sonnet 4.6 Day 0 support blog post in the Blog section of the documentation sidebar.
2026-02-17 12:12:05 -08:00
Julio Quinteros Pro
ab912e5c8d refactor: move logging_utils.py deprecation fix to PR #21396
- Remove asyncio.iscoroutinefunction deprecation fix from this PR
- This change is better suited for PR #21396 (deprecation warnings)
- Keeps PR #21394 focused on CI test reliability improvements
2026-02-17 17:11:59 -03:00
Harshit Jain
b07e4a34c4
update latest upstream main 2026-02-18 01:39:56 +05:30
Julio Quinteros Pro
48105e650b fix: remove pytest-retry to avoid conflicting retry plugins
- Remove pytest-retry from dev dependencies in pyproject.toml
- Add pytest-xdist as proper dev dependency (was only in pip install)
- Update CI workflow to reflect proper dependency management
- Prevents conflict between pytest-retry and pytest-rerunfailures

Having both pytest-retry and pytest-rerunfailures installed simultaneously
causes unpredictable behavior and excessive retries.
2026-02-17 16:55:37 -03:00
superpoussin22
c7fbab4549
add default version for opus 4.6 (#21397) 2026-02-17 11:46:44 -08:00
Ishaan Jaff
1e8ade2237
Add Claude Sonnet 4.6 pricing (#21395)
* add Claude Sonnet 4.6 pricing across all platforms

* fix: correct Bedrock model names and add to BEDROCK_CONVERSE_MODELS

- Remove -v1 suffix from Bedrock Sonnet 4.6 entries per official docs
- Add anthropic.claude-sonnet-4-6 to BEDROCK_CONVERSE_MODELS

* fix: address Greptile and maintainer review feedback

- Update max_output_tokens from 8192 to 64000 (docs confirm 64K limit)
- Add search_context_cost_per_query to vertex_ai/claude-sonnet-4-6 for consistency
- Add vertex_ai/claude-sonnet-4-6@default variant per Vertex AI naming convention
2026-02-17 11:46:24 -08:00
Julio Quinteros Pro
02126c5aac fix: remove pytest-retry configuration to eliminate duplicate retries
- Remove retries=20 and retry_delay=5 from pytest.ini_options
- These settings are for pytest-retry plugin (different from pytest-rerunfailures)
- Having both pytest-retry + pytest-rerunfailures causes excessive retries
- CI workflow now uses only pytest-rerunfailures with --reruns flag
2026-02-17 16:08:40 -03:00
Julio Quinteros Pro
bf157acccc fix: restore pytest-xdist to CI workflow
- Add pytest-xdist back to pip install line (required for -n flag)
- Was accidentally removed when removing pytest-retry
- Without pytest-xdist, all CI jobs fail with 'unrecognized option -n'
2026-02-17 16:08:24 -03:00
Harshit Jain
82f9ad1061
fix silent skip prompt id 2026-02-18 00:35:50 +05:30
Harshit Jain
56fab12fbe
fix: prompt registry 2026-02-18 00:34:54 +05:30
Julio Quinteros Pro
bd9b239ed7 fix(ci): address Greptile review feedback
- Remove pytest-retry to avoid duplicate retry mechanisms (only use pytest-rerunfailures)
- Remove --dist loadgroup flag (no tests use xdist_group marker)
- Remove unused LITELLM_CI environment variable
- Remove sequential test step with error masking
- Simplify workflow for clarity

This fixes the issue where tests could be retried 60+ times due to
duplicate retry plugins (pytest-retry with retries=20 + pytest-rerunfailures
with --reruns 2-3).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 15:58:33 -03:00
Julio Quinteros Pro
e9929d2798 fix: replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction
- Replace asyncio.iscoroutinefunction() with inspect.iscoroutinefunction()
- Add inspect import
- Fixes deprecation warning in Python 3.16

The asyncio.iscoroutinefunction is deprecated and will be removed in Python 3.16.
Using inspect.iscoroutinefunction is the recommended approach.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 15:48:09 -03:00
Julio Quinteros Pro
7a097ae97f fix(ci): reduce parallelism and add retry logic
- Reduce workers from 4 to 2 to avoid race conditions
  - Add --reruns with 2-3 retries per test group
  - Increase timeout from 15 to 20 minutes
  - Add better test isolation
2026-02-17 15:43:43 -03:00
Krrish Dholakia
4930babace docs(release_cycle.md): document enterprise support 2026-02-17 10:15:17 -08:00
Krrish Dholakia
bf824dec55 docs: remove references to unused var 2026-02-17 10:15:17 -08:00
Krrish Dholakia
e936f88f15 refactor: remove old doc 2026-02-17 10:15:17 -08:00
jquinter
cd20dde199
Merge pull request #21390 from BerriAI/fix/lint-too-many-statements-route-llm
fix(lint): suppress PLR0915 too many statements in route_request
2026-02-17 14:41:25 -03:00
Julio Quinteros Pro
289341d948 fix(lint): suppress PLR0915 in route_request function
Add noqa comment for "too many statements" lint error in route_request().
The function has 60 statements (limit is 50) but refactoring it properly
would be a significant undertaking requiring careful testing.

The function handles routing for 50+ different request types and contains
complex logic that should be addressed in a dedicated refactoring effort,
not as part of a lint fix.

Error: proxy/route_llm_request.py:145:11: PLR0915 Too many statements (60 > 50)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 14:38:17 -03:00
Sameer Kankute
126cf36dc4 move e2e to llm translation 2026-02-17 22:33:13 +05:30
Sameer Kankute
809838042e
Merge pull request #21382 from BerriAI/litellm_vllm_e2e_testing
Add vllm e2e test for embedding
2026-02-17 22:32:42 +05:30
Sameer Kankute
811ffff0b8 move e2e to llm translation 2026-02-17 21:14:44 +05:30
Sameer Kankute
181a1c3a89 Fix test conifg 2026-02-17 21:09:01 +05:30
Sameer Kankute
ec573ee2b0
Merge pull request #21375 from BerriAI/litellm_evals_api
[feat] Add support for Openai Evals API
2026-02-17 21:01:36 +05:30
Sameer Kankute
1c9cee0630 Fix doc 2026-02-17 20:57:38 +05:30
Sameer Kankute
842d5a0762 Fix mypy issues 2026-02-17 20:51:51 +05:30
Sameer Kankute
3af90d6e81
Merge pull request #21383 from BerriAI/litellm_fix_mock_tests
Update poetry.lock
2026-02-17 20:40:38 +05:30
Sameer Kankute
791cef6d99 fix test_chat_completion 2026-02-17 20:26:28 +05:30
Sameer Kankute
288f7b860c fix test_allow_access_by_email 2026-02-17 20:19:39 +05:30
Sameer Kankute
1ced47c612 fix tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py 2026-02-17 20:14:56 +05:30
Sameer Kankute
550bb621f7 fix llm tests 2026-02-17 20:13:23 +05:30
Sameer Kankute
fe20e66a1d Fix : test_exception_without_scanners 2026-02-17 20:12:02 +05:30
Sameer Kankute
8374b4d939 Fix : test_exception_without_scanners 2026-02-17 20:11:20 +05:30