Commit Graph

37005 Commits

Author SHA1 Message Date
Ishaan Jaffer
c3dbd782f4
style: black format llm_http_handler.py 2026-04-15 18:18:18 -07:00
Ishaan Jaffer
6126b47c86
fix(mcp): set instructions=None in test_add_update_server_without_alias mock 2026-04-14 12:42:48 -07:00
Ishaan Jaffer
2b5eb794fc
fix(mcp): set instructions=None in test_add_update_server_with_alias mock 2026-04-14 12:40:55 -07:00
Ishaan Jaffer
92a5ed4c3d
fix(mcp): set instructions=None in test_add_update_server_fallback_to_server_id mock 2026-04-14 12:15:54 -07:00
Ishaan Jaffer
8c505634bd
chore: sync uv.lock with pyproject.toml (v1.83.6 -> v1.83.7) 2026-04-14 11:05:25 -07:00
Ishaan Jaffer
e20c114811
fix(mcp): set instructions=None in SigV4BuildFromTable test mocks
New MCPServer.instructions field requires a str; MagicMock attributes
not explicitly set return a MagicMock object, which fails Pydantic
validation.
2026-04-14 11:05:22 -07:00
ishaan-berri
693c846617
Merge pull request #25674 from BerriAI/litellm_anthropic-messages-thinking-signature-retry
feat(anthropic): retry /v1/messages after invalid thinking signature
2026-04-14 10:10:43 -07:00
ishaan-berri
9810a1b3b7
Merge pull request #25344 from BerriAI/litellm_Sameerlite/healthcheck-max-tokens
feat(health-check): add BACKGROUND_HEALTH_CHECK_MAX_TOKENS env var
2026-04-14 10:04:50 -07:00
ishaan-berri
f6058bd0ca
Merge pull request #25673 from michelligabriele/fix/responses-api-cache-key
fix(caching): add Responses API params to cache key allow-list
2026-04-14 09:53:05 -07:00
ishaan-berri
d479234f0e
Merge pull request #25694 from milan-berri/feat/mcp-initialize-instructions
feat(mcp): expose per-server InitializeResult.instructions from gateway
2026-04-14 09:51:07 -07:00
ishaan-berri
15ef3fa8ca
Merge pull request #25679 from michelligabriele/fix/azure-passthrough-standard-logging-object
fix(azure/passthrough): populate standard_logging_object via logging hook
2026-04-14 09:38:33 -07:00
Milan
e7c630ed19
refactor: inline get_upstream_initialize_instructions
Remove the trivial one-line wrapper and access the dict directly.

Made-with: Cursor
2026-04-14 15:59:00 +03:00
Milan
7e656f4329
test: add unit tests for MCP initialize instructions feature
Extend existing test modules with coverage for the instructions merge
logic, upstream cache, ContextVar-based injection, and client-side
capture — following each file's established patterns.

Made-with: Cursor
2026-04-14 15:54:27 +03:00
Milan
8c2ebee4de
refactor(mcp): reuse existing sessions for initialize instructions
Remove the gateway-specific initialize fetch path and reuse instructions captured during existing MCP calls (list_tools/health_check/call_tool), while keeping YAML/DB instructions as immediate overrides.

Made-with: Cursor
2026-04-14 14:46:06 +03:00
Milan
96ed00e184
feat(mcp): gateway InitializeResult.instructions from upstream or YAML
- Add optional instructions on MCPServer (config/DB/types) and Prisma migration.
- MCPClient: fetch_upstream_initialize_instructions() for one-shot initialize.
- Gateway merges per-request instructions: YAML/API overrides; otherwise fetch
  upstream initialize instructions (skip spec_path/OpenAPI-only servers).
- Pass auth headers into instruction merge; ContextVar for gateway Server.
- REST: wire instructions on connection-test MCPServer payloads.

Made-with: Cursor
2026-04-14 14:19:31 +03:00
michelligabriele
63281e8330
fix(azure/passthrough): populate standard_logging_object via logging hook 2026-04-14 08:10:39 +02:00
Sameer Kankute
5670f6c7d4
fix(anthropic): tighten thinking-signature retry (Greptile)
- Omit messages whose list content is empty after stripping thinking blocks
- Retry only on HTTP 400 plus invalid-signature body match
- Return response inline from retry loop; drop unreachable None guard
- Tests: thinking-only turn dropped, non-400 no retry

Made-with: Cursor
2026-04-14 10:03:10 +05:30
Sameer Kankute
0f453cc59d
Fic code qa 2026-04-14 10:00:27 +05:30
Sameer Kankute
c7f7708d27
feat(anthropic): retry /v1/messages after invalid thinking signature
Strip thinking blocks from the request body and retry once when Anthropic returns an invalid thinking signature error (e.g. after credential or deployment change). Applies to all BaseAnthropicMessagesConfig providers (direct Anthropic, Bedrock, Vertex, Azure AI).

Made-with: Cursor
2026-04-14 09:39:39 +05:30
michelligabriele
85497740ff
fix(caching): add Responses API params to cache key allow-list 2026-04-14 05:40:42 +02:00
yuneng-jiang
e64d98f725
Merge pull request #25590 from BerriAI/litellm_add_model_e2e_tests
[Test] UI - Models: Add E2E tests for Add Model flow
2026-04-13 19:03:39 -07:00
Yuneng Jiang
9b74ff3ef7
remove unnecessary cleanup helper
The database is freshly seeded on every test run via seed.sql,
so per-test cleanup is not needed.
2026-04-13 17:29:49 -07:00
Yuneng Jiang
cce7163348
fix CI: replace data-testid selectors with text/role-based selectors
The data-testid attributes added to React components are not present
in the CI-built UI output. Switch to using getByRole and getByText
selectors which work with the rendered DOM regardless of build cache.
2026-04-13 17:29:49 -07:00
Yuneng Jiang
5e07c1cbc9
address greptile review feedback (greploop iteration 1)
Add cleanup helper to delete models created during tests, preventing
stale data accumulation across repeated test runs.
2026-04-13 17:29:49 -07:00
Yuneng Jiang
4f364a8138
[Test] UI - Models: Add E2E tests for Add Model flow
Add E2E tests covering:
- Test connection with bad credentials shows failure modal
- Adding a specific model and verifying it appears in All Models table
- Adding a wildcard route and verifying it appears in All Models table
- Verifying model dropdown shows provider-specific models (existing test updated)

Added data-testid attributes to UI components to support stable test selectors.

Tests verified passing 3/3 consecutive runs with zero flakiness.
2026-04-13 17:29:49 -07:00
yuneng-jiang
8427534f13
Merge pull request #25647 from BerriAI/litellm_yj_apr_11
[Infra] Merge dev branch with main
2026-04-13 17:28:38 -07:00
yuneng-jiang
c25b4b2ce8
Merge pull request #25398 from BerriAI/litellm_team_settings_router
[Feature] UI - Teams: Allow Editing Router Settings After Team Creation
2026-04-13 17:27:15 -07:00
yuneng-jiang
a306092d47
Merge pull request #25463 from BerriAI/litellm_oss_staging_04_09_2026
Litellm oss staging 04 09 2026
2026-04-13 17:25:53 -07:00
ryan-crabbe-berri
87b6b5145f
Merge pull request #25658 from BerriAI/litellm_e2e-edit-team-model-test
test(e2e): add edit team model TPM/RPM limits test
2026-04-13 17:15:56 -07:00
Ryan Crabbe
152d6898ab
test(e2e): drop cleanup from edit team model test
Reviewer flagged that cleanup failures were silently swallowed and
suggested asserting `delete.ok()`. While thinking through the fix, the
actual question turned out to be "does the cleanup matter at all?" —
and the answer is no.

The e2e runner (`run_e2e.sh`) spins up a fresh postgres container per
invocation and tears it down at the end, so every local and CI run
starts with an empty DB. Playwright retries share the same DB but each
attempt creates a new model with a unique `Date.now()` name and only
queries its own model, so orphans from failed attempts never collide
with later attempts or other tests. Nothing else in the suite reads
the all-models table.

Keeping the cleanup would also turn every write test into an implicit
delete test, coupling responsibilities and inflating runtime — which
is probably why `teams.spec.ts` (create a team), `keys.spec.ts`
(update key limits), etc. all leave their entities in place. Matching
that convention, drop the try/finally block and the `createdModelId`
tracking. 12 lines removed, no behavior change.
2026-04-13 17:05:42 -07:00
ryan-crabbe-berri
c08fb82cae
Merge pull request #25657 from BerriAI/litellm_chore-e2e-tests
chore: remove deprecated tests/ui_e2e_tests/ suite
2026-04-13 16:51:22 -07:00
Ryan Crabbe
44614c43c6
test(e2e): add edit team model TPM/RPM limits test
Covers the full write-path flow for team-scoped models on the Models +
Endpoints page: create via /model/new, click the row to open the detail
view, click Edit Settings, change TPM/RPM, click Save Changes, assert
the new values render back. Cleans up via /model/delete in finally so
reruns stay deterministic.

Requires store_model_in_db: true in the fixture general_settings so the
proxy accepts /model/new and /model/delete. No existing test in the
dashboard e2e suite reads the all-models table or hits the model CRUD
endpoints, so enabling the flag has no cross-test impact.
2026-04-13 16:27:39 -07:00
Ryan Crabbe
004964f421
chore: remove deprecated tests/ui_e2e_tests/ suite
The suite was superseded by ui/litellm-dashboard/e2e_tests/ on 2026-04-08
and is no longer referenced by CircleCI, docs, or Makefile targets. Drop
the directory wholesale and remove the orphaned e2e:psql npm script that
pointed at its runner.
2026-04-13 15:40:34 -07:00
ishaan-berri
548225ef31
Merge pull request #25586 from BerriAI/litellm_ishaan_april11
Litellm ishaan april11
2026-04-13 14:55:50 -07:00
ryan-crabbe-berri
65d9fadf45
Merge pull request #25575 from BerriAI/litellm_feat-per-guardrail-opt-out-for-global-guardrails
feat(guardrails): per-team opt-out for specific global guardrails
2026-04-13 13:31:23 -07:00
ishaan-berri
6e6ed4fa66
Merge pull request #25452 from mubashir1osmani/readme
docs: week 2 checklist
2026-04-13 13:23:48 -07:00
Ryan Crabbe
2d14e4a4ed
test(ui/team): fix guardrails overview test for new component
Updates the expected header text to "Guardrails Settings" to match
GuardrailSettingsView's rendering, and moves the mock guardrails
from team_info.guardrails (legacy top-level path that nothing
reads) to team_info.metadata.guardrails where the component
actually looks. Also tightens the assertion to verify the
individual guardrail names appear, not just the section header.
2026-04-13 12:20:30 -07:00
Yuneng Jiang
df75e79615
raise ValueError on os.environ/ references in request-supplied callback params
Previously these were silently dropped with a verbose warning, which
could break observability integrations without surfacing a clear error.
Now raises ValueError with remediation steps (configure server-side
or pass the resolved value) so callers get immediate, actionable feedback.
2026-04-13 12:00:25 -07:00
Ryan Crabbe
842523a918
chore(ui): use antd in GuardrailSettingsView and document the rule
Converts GuardrailSettingsView from @tremor/react (Badge, Text) to
antd (Tag, plain spans) as part of the Tremor migration. Also
captures the "no new Tremor imports" rule in CLAUDE.md and expands
the existing note in AGENTS.md with the specific antd equivalents
and the yellow→gold gotcha.
2026-04-13 11:49:39 -07:00
Ryan Crabbe
84d7816bc9
refactor(ui/team): extract GuardrailSettingsView and reuse across team views
Pulls the Global / Team-specific subsection rendering out of
TeamInfo.tsx into a shared GuardrailSettingsView component with
card and inline variants, used on both the team Overview tab
(inside the existing Tremor Card) and the Team Settings tab read
view. The Global subsection header now carries a GlobalOutlined
icon, and since the icon is load-bearing the edit-form chip
coloring is simplified to a single blue instead of green/blue.
2026-04-13 11:38:23 -07:00
yuneng-jiang
26c35aa8eb
Merge pull request #25594 from BerriAI/litellm_spend_logs_user_scoping
[Fix] /spend/logs: align filter handling with user scoping
2026-04-13 11:31:27 -07:00
Ryan Crabbe
1dcccfc1d1
feat(ui/team): show guardrails in team settings read view
The Team Settings tab's read view listed every team field except
guardrails. Adds a Guardrails entry after Status with the same
Global / Team-specific subsections used on the Overview tab, so
the kill switch state and per-section membership are visible
without entering edit mode.
2026-04-13 11:08:39 -07:00
Ryan Crabbe
6ae693b85c
refactor(ui/team): split team read view guardrails into Global and Team-specific sections
Replaces the flat guardrails list with two subsections under the
Guardrails card, so the global vs. team-specific distinction is
carried by the section headers instead of per-badge markers. The
kill-switch state now renders in place of the Global subsection as
"Bypassed for this team", and the separate "Disable Global
Guardrails" field with its confusing "Disabled - Global guardrails
active" badge is removed.
2026-04-13 10:57:10 -07:00
Ryan Crabbe
1f57292363
fix(ui/team): add GlobalOutlined icon to global guardrail markers
Addresses a11y feedback — global vs. non-global guardrails were
distinguished only by color (green vs. blue). Adds GlobalOutlined
next to global guardrails in (1) the selected-chip tagRender, (2)
the dropdown OptGroup label, and (3) the team info read view badge.
2026-04-13 10:55:09 -07:00
Krrish Dholakia
d319cd8cc6
fix: blog dark mode - text invisible on dark background (#25620)
The blog CSS selectors for dark mode used descendant selectors like
[data-theme='dark'] .blog-wrapper which never matched because both
data-theme and .blog-wrapper are applied to the same <html> element
by Docusaurus. Fixed by using compound selectors (no space):
[data-theme='dark'].blog-wrapper.

Also added missing dark-mode overrides for:
- pre/code blocks in blog posts
- link colors in blog posts
- marquee items, separators, and labels on blog list page
- pagination links on blog list page
- meta text and author separators on blog list page

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-04-13 09:08:57 -07:00
michelligabriele
0eae9f101e
fix(auth): gate post-custom-auth DB lookups behind opt-in flag (#25634) 2026-04-13 08:02:16 -07:00
Sameer Kankute
5e80e075c7
Merge pull request #25397 from BerriAI/litellm_oss_staging_04_08_2026
Litellm oss staging 04 08 2026
2026-04-13 09:12:40 +05:30
Sameer Kankute
fa605d85c0
Merge pull request #25616 from BerriAI/main
merge main
2026-04-13 08:43:43 +05:30
Yuneng Jiang
d3331f855b
refactor: rename filter var to satisfy mypy 2026-04-11 23:40:59 -07:00
Yuneng Jiang
4617d230f8
fix: hash sk- api_key in /spend/logs date-range path and add filter tests
Brings the date-range branch in line with the non-date-range branch which
already hashes sk- prefixed tokens before querying. Adds coverage for
filter-combination behavior in view_spend_logs.
2026-04-11 23:33:15 -07:00