Commit Graph

8164 Commits

Author SHA1 Message Date
Yuneng Jiang 8a0ddd46d5 [Test] UI - Add Playwright E2E tests with local PostgreSQL
Add a self-contained Playwright E2E test suite that runs against a local
PostgreSQL database instead of Neon. Tests cover role-based access for all
5 user roles (proxy admin, admin viewer, internal user, internal viewer,
team admin) and authentication flows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:47:17 -07:00
yuneng-jiang 7250cba3db Merge pull request #24905 from BerriAI/litellm_pin_pip_2
[Infra] Pin All Docker Build Dependencies
2026-04-01 15:05:25 -07:00
Yuneng Jiang 85f72c9d24 [Fix] Remove unused aioboto3 dependency and botocore conflict workarounds
aioboto3 was listed as a dependency for async sagemaker calls but is not
imported anywhere in the codebase — async calls use httpx + botocore SigV4
instead. Removing it eliminates the unresolvable botocore version conflict
between boto3 and aiobotocore, along with all grep -v / --no-deps workarounds
across Dockerfiles and CI.

Also addresses Greptile review feedback: collapse redundant grpcio
python-version markers, bump pyproject.toml cryptography to 46.0.5 to
match Docker (GHSA-r6ph-v2qm-q3c2), and fix misleading .npmrc comment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 14:25:44 -07:00
Yuneng Jiang 9c6d5f2b60 [Fix] Add aioitertools and wrapt to authorized licenses
Both are transitive deps of aiobotocore, added to requirements.txt in
the previous commit. aioitertools is MIT, wrapt is BSD.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:01:10 -07:00
ishaan-berri e4442a4d98 test fix us.anthropic.claude-haiku-4-5-20251001-v1:0 (#24931)
* test fix us.anthropic.claude-haiku-4-5-20251001-v1:0

* ignore mypy cache files

---------

Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
Co-authored-by: David Chen <clfhhc@gmail.com>
2026-04-01 11:01:03 -07:00
Yuneng Jiang 6a2b03a850 [Infra] Merge main and resolve dependency pin conflicts
Resolve conflicts between pinned versions and main's caret ranges,
keeping exact pins. Add pytest-cov==5.0.0 from main. Regenerate
poetry.lock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:55:13 -07:00
Yuneng Jiang 7bd6fa8509 [Fix] Add hf-xet to authorized packages in license check
hf-xet is Apache 2.0 licensed but PyPI metadata doesn't expose the
license string, so the automated checker can't determine it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:51:29 -07:00
Yuneng Jiang 7b277d36cd [Fix] Fix test failures and Docker build from pinned dependency upgrade
pytest-asyncio 1.x no longer provides an implicit event loop in sync
fixtures/tests. Make async-dependent fixtures and tests async, and
replace deprecated asyncio.get_event_loop() in tests. Switch
Dockerfile.build_from_pip from Alpine to Debian slim since
pyroscope-io 0.8.x has no musl wheels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:43:33 -07:00
michelligabriele 283375f4d6 fix(proxy): eliminate race condition in streaming guardrail_information logging (#24592)
asyncio.create_task in CSW.__anext__ scheduled the deferred logging
callback as an independent task that raced with unified_guardrail's
end-of-stream block. For short-stream providers (Vertex AI, Azure,
Anthropic), the logging fired before guardrail_information was written,
causing post_call guardrail entries to be missing from
StandardLoggingPayload.

Move the deferred callback trigger from CSW.__anext__ to
ProxyLogging.async_post_call_streaming_iterator_hook (after the full
streaming pipeline completes). CSW now stores the assembled response
args; the outer consumer fires the callback after all guardrail
end-of-stream blocks finish. Also skip apply_guardrail guardrails in
_run_deferred_stream_guardrails to eliminate duplicate API calls.
2026-04-01 08:06:56 -07:00
ryan-crabbe-berri 2f1cfb0548 Merge pull request #24751 from BerriAI/litellm_ryan-march-28
litellm ryan march 28
2026-03-31 17:25:30 -07:00
ishaan-berri 94e0f44798 Merge pull request #24882 from BerriAI/worktree-piped-exploring-patterson
docs: JWT → Virtual Key Mapping guide
2026-03-31 16:34:47 -07:00
stuxf 7066c895f6 chore: harden npm supply chain — pin overrides, enforce npm ci, add ignore-scripts (#24838)
* chore: harden npm supply chain — pin overrides, enforce npm ci, add ignore-scripts

Replace open-ended >= version overrides with exact pins matching lockfile
versions across all 6 package.json files. Remove dead overrides for packages
not present in lockfiles. Switch CI and devcontainer from npm install to
npm ci for deterministic lockfile-based installs.

Add .npmrc to all 7 JS project directories with ignore-scripts=true (blocks
postinstall RAT vectors like the axios@1.14.1 supply chain attack) and
min-release-age=3d (refuses packages published <3 days ago, requires npm
>=11.10). Remove Yarn-only resolutions field from docs/my-website.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: bump sharp to 0.33.5 in docs, add docs .npmrc

sharp 0.32.x uses postinstall to download native binaries, which breaks
with ignore-scripts=true. sharp 0.33+ distributes via optionalDependencies
instead, making it compatible with the new .npmrc hardening.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: remove docs .npmrc to fix Vercel deploy

Vercel's build for docs/my-website uses npm install which needs
sharp 0.32.6's postinstall script. Since we don't control Vercel's
build process, remove the .npmrc from docs rather than fight it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: Dockerfile npm ci + nvm checksum verification

- Replace npm install with npm ci in Dockerfile.non_root,
  Dockerfile.custom_ui, and spend-logs/Dockerfile for deterministic
  lockfile-based installs
- Replace curl-pipe-bash nvm install with download-then-verify pattern
  in build_admin_ui.sh, build_ui.sh, and build_ui_custom_path.sh
- Update nvm from v0.38.0 (2021) to v0.40.4 (Jan 2026) with SHA256
  checksum verification before execution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: macOS sha256sum compat + clarify min-release-age scope

- Use shasum -a 256 fallback on macOS where sha256sum is unavailable
- Clarify in .npmrc comments that min-release-age only protects local
  npm install, not npm ci (used in CI)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 13:41:37 -07:00
Ishaan Jaffer 4b5ca49cd2 fix: map file_url -> file_id in Responses->Completions translation 2026-03-31 12:59:01 -07:00
Ishaan Jaffer 0ea05469bc test_completion_azure 2026-03-30 21:54:27 -07:00
ishaan-berri 77e6546e55 Merge pull request #24837 from BerriAI/lllm_build_and_test_fail
[Test] Move test_add_and_delete_model to Mock Test
2026-03-30 21:41:28 -07:00
Yuneng Jiang e014dfb8e0 fix: mock encrypt_value_helper in lifecycle test
CI fails because LITELLM_MASTER_KEY is not set, causing
encrypt_value_helper to error on NoneType.encode(). Patch it
to pass through values unencrypted in the test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:36:40 -07:00
Ishaan Jaffer 823e7b2a9d test_completion_azure 2026-03-30 21:36:35 -07:00
Ishaan Jaffer 3034ac26f7 fix 2026-03-30 21:33:47 -07:00
Yuneng Jiang b48c037712 test: replace test_add_and_delete_models integration test with mock
Skip the integration test that requires a live proxy and OPENAI_API_KEY
(removed from CI/CD). Add deterministic mock test covering the same
add → delete → double-delete-fails lifecycle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:30:57 -07:00
Ishaan Jaffer 669d2a6d8b test_router_init_azure_service_principal_with_secret_with_environment_variables 2026-03-30 21:15:53 -07:00
Ishaan Jaffer 8c6a67dae1 test_bedrock_embedding_cohere 2026-03-30 21:08:51 -07:00
Ishaan Jaffer a7bfe0c540 test_completion_azure 2026-03-30 21:07:49 -07:00
Ishaan Jaffer 9b46d88371 test_completion_azure 2026-03-30 21:07:41 -07:00
Ishaan Jaffer f636c3b3b7 pin axios 2026-03-30 20:20:23 -07:00
Ishaan Jaffer 81028b9682 use mock tests for assembly AI 2026-03-30 19:59:32 -07:00
Krrish Dholakia 5d6c76aa1a Merge pull request #24823 from jaydns/fixes
chore: fixes
2026-03-30 19:35:40 -07:00
Krrish Dholakia 0cf4b05991 test: remove bad e2e tests - e2e failing due to low rate limits on ci/cd 2026-03-30 19:18:10 -07:00
Krrish Dholakia c6f1f8b6b3 fix: move to new vertex credentials 2026-03-30 19:16:05 -07:00
jayden 9ca1560501 chore: fix test 2026-03-30 19:14:01 -07:00
Krrish Dholakia 40074fffe1 Merge pull request #24824 from BerriAI/litellm_fix_test_redis_and_azure_mock
[Fix] Use correct Redis env vars and fix Azure AD token test mocking
2026-03-30 19:12:45 -07:00
Ishaan Jaffer 7954d1a11f test_azure_ai_model_router_streaming_cost_with_stream_options 2026-03-30 19:12:01 -07:00
Krrish Dholakia 89091e4f29 test: fix assemblyai passthrough transcription request format
Switch the passthrough e2e helper to direct HTTP transcript create/poll/delete calls so the request includes required speech_models and remains compatible with current AssemblyAI API behavior.

Made-with: Cursor
2026-03-30 18:49:04 -07:00
Yuneng Jiang e69dfbc07d Merge main and resolve conflict in test_router_client_init.py
Keep both AZURE_AI_API_KEY (renamed on main) and AZURE_OPENAI_API_KEY
(added in this branch) env var cleanup.
2026-03-30 18:44:33 -07:00
Ishaan Jaffer 7e93256da4 test_bedrock_document_understanding 2026-03-30 18:39:20 -07:00
jayden 57c05459ae chore: fixes 2026-03-30 18:36:58 -07:00
Yuneng Jiang 05ecfa3470 [Fix] Use correct Redis env vars and fix Azure AD token test mocking
- test_caching_router: Use REDIS_HOST/PORT/PASSWORD/SSL instead of
  non-existent REDIS_HOST_2 variants
- test_router_init_azure_service_principal: Use monkeypatch.setenv instead
  of patching the os module in only one file, so both common_utils._resolve_env_var
  and get_azure_ad_token_provider see the mocked credentials. Also clear
  AZURE_OPENAI_API_KEY to prevent it from short-circuiting the token provider path.
2026-03-30 18:32:04 -07:00
ishaan-berri 7cc997bd75 Merge pull request #24822 from BerriAI/litellm_/romantic-galileo
[Test] Move Snowflake Mocked Tests to Unit Test Directory
2026-03-30 18:25:03 -07:00
Ishaan Jaffer 0298c1f58d test_basic_s3_v2_logging 2026-03-30 18:17:52 -07:00
Krrish Dholakia e17acd6b69 test: make tests smarter 2026-03-30 18:14:44 -07:00
Ishaan Jaffer 83dc158a2a test fix 2026-03-30 18:08:57 -07:00
Krrish Dholakia 74008e3220 test: cleanup test impacted by deployment name change 2026-03-30 18:07:50 -07:00
Yuneng Jiang 2b374a2abf Merge main and resolve Snowflake test conflict
Main rewrote the same tests we moved. Resolution: keep the tests only
in the unit test directory, adopting main's improved patterns (AsyncMock,
assert_called_once, stronger content assertions on streaming).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:06:37 -07:00
Yuneng Jiang 19f8b58046 [Test] Move mocked Snowflake chat completion tests to unit test directory
Move test_chat_completion_snowflake and test_chat_completion_snowflake_stream
from tests/llm_translation/ to tests/test_litellm/llms/snowflake/chat/ so
they run as part of `make test-unit` without requiring API credentials.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:03:00 -07:00
Krrish Dholakia 949a395b01 test: use env var azure model router api base 2026-03-30 18:02:43 -07:00
Ishaan Jaffer facb230fee test_create_vertex_fine_tune_jobs_mocked 2026-03-30 18:01:23 -07:00
Krrish Dholakia 5596728cae Merge pull request #24753 from BerriAI/litellm_dev_03_27_2026_p1
Fix returned model when batch completions is used - return picked model, not comma-separated list
2026-03-30 17:53:48 -07:00
Ishaan Jaffer 7844571d36 test GCS BUCKET 2026-03-30 17:53:26 -07:00
Krrish Dholakia ee4ded4c44 Merge pull request #24445 from quora/fix/missing-content-part-added
fix(responses): emit content_part.added event for non-OpenAI models
2026-03-30 17:52:40 -07:00
Ishaan Jaffer 9d4090bc5a test fix - remove tests that were skipped 2026-03-30 17:48:54 -07:00
Krrish Dholakia 13b7c2e602 test: update testing 2026-03-30 17:48:25 -07:00