Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9968499
fix(ui): fix Router Settings Loadbalancing tab save (LIT-4057)
ryan-crabbe-berri Jun 30, 2026
30141f8
test(ui): make router settings save tests resilient to async timing
ryan-crabbe-berri Jun 30, 2026
540c860
test(ui): add typed e2e for Router Settings Loadbalancing save (LIT-4…
ryan-crabbe-berri Jun 30, 2026
3971469
test(ui): harden Router Settings e2e and make its typing a real CI gate
ryan-crabbe-berri Jun 30, 2026
4f41a9e
test(ui): drop the e2e typecheck CI gate, keep the typed import for t…
ryan-crabbe-berri Jun 30, 2026
ae8084d
ci(codspeed): pin benchmark runner to ubuntu-24.04 (#31746)
yuneng-berri Jun 30, 2026
a7d8c6f
test(pass-through): de-flake vertex spend-log test by routing through…
mateo-berri Jun 30, 2026
41f9d8d
fix(proxy): extend banned-params + admin-clear lists for NVIDIA Riva …
yucheng-berri Jun 30, 2026
776b272
Merge pull request #31735 from BerriAI/litellm_lit_4057_router_settin…
yuneng-berri Jun 30, 2026
833406a
fix(ui): rotate model credentials in a dedicated modal so a normal sa…
ryan-crabbe-berri Jul 1, 2026
2860dad
feat(proxy): audit default user settings updates (#31753)
yucheng-berri Jul 1, 2026
ada9ef8
fix(websearch): websearch_interception agentic loop fixes for chat co…
krrish-berri-2 Jul 1, 2026
6c21029
feat(sandbox): reuse e2b container across requests when metadata.sess…
krrish-berri-2 Jul 1, 2026
846dbec
feat(proxy): support object_permission in default_key_generate_params…
krrish-berri-2 Jul 1, 2026
50b936c
feat(guardrails/headroom): add CCR (compress-cache-retrieve) via agen…
krrish-berri-2 Jul 1, 2026
23af784
feat: add cache control injection support for v1/messages endpoint (#…
devin-ai-integration[bot] Jul 1, 2026
bfb8ffc
feat(proxy): audit remaining system-wide settings updates (#31754)
yucheng-berri Jul 1, 2026
c4a77bd
fix(prometheus): expose project_alias in custom metadata labels (LIT-…
devin-ai-integration[bot] Jul 1, 2026
cca71a0
feat(mcp): add mcp_tool_search virtual tools for large tool catalogs …
krrish-berri-2 Jul 1, 2026
13b590c
fix(proxy): hydrate MCP server registry from DB on startup when store…
tin-berri Jul 1, 2026
e141596
refactor(lint): collapse type/lint budgets to a single per-rule limit…
mateo-berri Jul 1, 2026
3e0bd71
feat(ui): disclaim that the Update API Key modal only rotates api_key…
ryan-crabbe-berri Jul 1, 2026
1fe76dc
Revert "chore: remove _experimental/out (#31546)"
yuneng-berri Jul 1, 2026
34039df
Merge pull request #31904 from BerriAI/litellm_/competent-mestorf-165751
yuneng-berri Jul 1, 2026
ae6dbb4
fix(scripts): resolve worktree root before relative_to in type_check_…
yuneng-berri Jul 1, 2026
7e99344
feat(bedrock_mantle): add xai.grok-4.3 to model cost map for SigV4 au…
devin-ai-integration[bot] Jul 1, 2026
700afbb
chore: make CLAUDE.md rules more concise (#31892)
mateo-berri Jul 1, 2026
a2f5bb1
fix(proxy): authorize /health/test_connection against loaded deployme…
yucheng-berri Jul 2, 2026
99c65ea
fix(proxy): admin-gate `permissions` on /key/update and /key/regenera…
yucheng-berri Jul 2, 2026
0b0fd6a
feat(github_copilot): route /v1/messages to Copilot native Anthropic …
mateo-berri Jul 2, 2026
fde4c7c
feat(gdc): implement Google Distributed Cloud (GDC) Gemini provider (…
mateo-berri Jul 2, 2026
6e023f7
fix(model_prices): apply claude-sonnet-5 introductory pricing through…
mateo-berri Jul 2, 2026
68a8fc2
feat(s3_v2): send Content-MD5 on PUT and optional server-side encryption
Jul 2, 2026
8ce6b4d
fix(proxy): tighten role gating on /get/config/callbacks response (#3…
yucheng-berri Jul 2, 2026
e542be1
fix(s3_v2): pass usedforsecurity=False to hashlib.md5 for FIPS envs
Jul 2, 2026
29cc4e3
fix: allow S3 Content-MD5 on FIPS hosts
cursoragent Jul 2, 2026
bd9db36
chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, no…
mateo-berri Jul 2, 2026
85f9241
fix(bedrock/converse): drop toolSpec.strict for Opus 4.7/4.8 (#31582)…
mateo-berri Jul 2, 2026
c4f28ce
fix(bedrock): trigger Nova Sonic generation on response.create so rea…
mateo-berri Jul 2, 2026
2a9dbc4
chore(ui): remove unused dep, delete dead file, and unblock knip (#31…
ryan-crabbe-berri Jul 2, 2026
3d644e1
refactor(ui): colocate users page into route-level _components (#31897)
ryan-crabbe-berri Jul 2, 2026
912ca62
test(bedrock): switch image gen live test off EOL Titan to Nova Canva…
devin-ai-integration[bot] Jul 2, 2026
a2a951a
feat(vertex_ai): pass full imageConfig dict for Gemini image generati…
Sameerlite Jul 2, 2026
64dc508
fix(bedrock): drop strict/additionalProperties from toolSpec for Clau…
Sameerlite Jul 2, 2026
85db18e
feat(prometheus): expose MCP tool metadata in Prometheus metrics (#31…
devin-ai-integration[bot] Jul 2, 2026
b96f1aa
fix(mcp): byom visibility, preview UX, and admin settings gating (#31…
Sameerlite Jul 2, 2026
a16d9c6
test(e2e): add live batches suite across providers and routing scenar…
Sameerlite Jul 2, 2026
8d0dc92
fix(logging): resolve model_map_value for proxy custom pricing (#31940)
Sameerlite Jul 2, 2026
fabe5c2
fix(mcp): roll up MCP tool spend to user counters and usage UI (#31576)
Sameerlite Jul 2, 2026
6d796d0
feat(proxy): track cost for unmanaged Vertex AI batch jobs (#31442)
Sameerlite Jul 2, 2026
f5f8ba9
fix(mcp): tighten role-based visibility on /v1/mcp/server/submissions…
yucheng-berri Jul 2, 2026
c370503
fix(mcp): gate OAuth authorize/token/register/discovery on auth_type=…
tin-berri Jul 2, 2026
bea8c93
refactor(ui): drive cache settings form from a typed frontend schema …
yuneng-berri Jul 2, 2026
d40021c
fix: merge metadata.tags into litellm_metadata on /v1/responses route…
devin-ai-integration[bot] Jul 2, 2026
8e6098a
fix(proxy): restore admin key/team callback_vars.turn_off_message_log…
yucheng-berri Jul 2, 2026
58de920
feat(mcp): bound outbound tool-call concurrency per MCP server (#31641)
tin-berri Jul 2, 2026
b38c290
fix(release): make Create Release reliable for stable maintenance cut…
yuneng-berri Jul 2, 2026
9b6d0b0
Merge pull request #31928 from BerriAI/litellm_s3_v2_content_md5
mubashir1osmani Jul 2, 2026
1543725
fix(bedrock): honor ttl for tool_config cache injection points (#31929)
shivamrawat1 Jul 2, 2026
ef03023
test(e2e): add vertex_ai passthrough spend-log coverage (#31781)
mubashir1osmani Jul 3, 2026
b9df7fa
fix(mcp): surface tools/list 401 auth failures as a challenge on sing…
tin-berri Jul 3, 2026
8bb4e62
feat(tencent): add Tencent TokenHub as a provider (#31903)
mateo-berri Jul 3, 2026
138a69b
fix(bedrock): map guardrailConfig to InvokeModel guardrail headers (#…
mateo-berri Jul 3, 2026
27069bd
feat(ui): shadcn migration foundation: Tailwind v4, shadcn init, antd…
ryan-crabbe-berri Jul 3, 2026
a86dc4c
chore(e2e): untrack gateway config and document e2e test location (#3…
mubashir1osmani Jul 3, 2026
cf6fdac
perf(lint): skip and cache base gate passes, parallelize make lint, s…
mateo-berri Jul 3, 2026
2633e8f
fix(ui): include cache token columns in usage export (#32015)
mateo-berri Jul 3, 2026
30ddef7
fix(a2a): record agent cost_per_query and input tokens on native send…
michelligabriele Jul 3, 2026
321345d
feat: litellm oss staging (#31935)
Sameerlite Jul 3, 2026
cbe23d6
fix(a2a): populate response usage in a2a chat transformation (#31980)
michelligabriele Jul 3, 2026
dfbbda4
fix(auth): deny model access for teamless keys with all-team-models (…
devin-ai-integration[bot] Jul 3, 2026
6dcbac8
fix(proxy): admin-gate `permissions` on /user/new and /user/update (L…
yucheng-berri Jul 3, 2026
b426925
fix(proxy): admin-gate `allowed_routes` presence on /key/update and /…
yucheng-berri Jul 3, 2026
b61fae3
fix(proxy): admin-gate `permissions` on _process_single_key_update (L…
yucheng-berri Jul 3, 2026
ae356cf
fix(azure_ai): preserve content, tables, and keyValuePairs in doc-int…
mateo-berri Jul 3, 2026
4e53ae9
bump: litellm-proxy-extras 0.4.74 -> 0.4.75, litellm-enterprise 0.1.4…
yuneng-berri Jul 3, 2026
d0e7851
feat(tinyfish): make search provider permissive, attribute errors (#3…
tin-berri Jul 3, 2026
b59ad21
feat(ui): add token endpoint auth method selector to MCP OAuth forms …
tin-berri Jul 3, 2026
15ff389
fix(mcp): persist DCR client_id so interactive OAuth token refresh wo…
tin-berri Jul 3, 2026
93cdcca
fix(azure_sentinel): resolve audit stream from AZURE_SENTINEL_AUDIT_S…
yucheng-berri Jul 3, 2026
3235f4a
fix(mcp): persist DCR client_id from on-create MCP OAuth Authorize & …
tin-berri Jul 3, 2026
70785b9
fix(e2e): define SpendTagsResponse/TagSpend so spend suite collects
mubashir1osmani Jul 3, 2026
28ddad2
feat(proxy): add key-level budget_fallbacks to reroute requests when …
krrish-berri-2 Jul 3, 2026
e06adb5
feat(ui): re-add chat UI, allow simple UI for MCP OBO auth (#31893)
krrish-berri-2 Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
7edf3a9cb55548b143df1692f4ed7c4681d7fcf7

# style: reformat litellm/ with ruff format (#31317)
430b5b8f1b12dc261a49fda99ac5d1b22381a428
17bfd415aeb5a57fb646b5cc67da1c730aa7c50b

# style: unify ruff format width on 120 (#31518)
3dfbeabe626d203ac9de86024519d9a96c484ce4
48b5a5a0cc5a694a11219416ee0b6eb6e620e74e
4 changes: 1 addition & 3 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- main
- litellm_internal_staging
pull_request:
branches:
- main
- litellm_internal_staging
# Allow CodSpeed to trigger backtest performance analysis
# in order to generate initial data
workflow_dispatch:
Expand All @@ -23,7 +21,7 @@ concurrency:

jobs:
benchmarks:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,28 @@ jobs:
makeLatest = (!latestVersion || isAtLeast(newVersion, latestVersion)) ? "true" : "false";
}

try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${tag}`,
sha: commitHash,
});
} catch (error) {
if (error.status !== 422) throw error;
const existing = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tag}`,
});
if (existing.data.object.sha !== commitHash) {
throw new Error(`Tag ${tag} already exists at ${existing.data.object.sha}, expected ${commitHash}`);
}
}

const response = await github.rest.repos.createRelease({
draft: true,
generate_release_notes: true,
target_commitish: commitHash,
name: tag,
owner: context.repo.owner,
prerelease: isPrerelease,
Expand All @@ -138,11 +156,21 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
release_id: response.data.id,
tag_name: tag,
body: updatedBody,
draft: false,
make_latest: makeLatest,
});

if (!isPrerelease) {
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: response.data.id,
tag_name: tag,
make_latest: makeLatest,
});
}

} catch (error) {
core.setFailed(error.message);
}
Expand Down
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ litellm/proxy/tests/package-lock.json
ui/litellm-dashboard/.next
ui/litellm-dashboard/node_modules
ui/litellm-dashboard/next-env.d.ts
ui/litellm-dashboard/package.json
ui/litellm-dashboard/package-lock.json
deploy/charts/litellm/*.tgz
deploy/charts/litellm/charts/*
deploy/charts/*.tgz
Expand Down Expand Up @@ -85,12 +87,17 @@ litellm/proxy/db/migrations/*
litellm/proxy/migrations/*config.yaml
litellm/proxy/migrations/*
litellm/proxy/to_delete_loadtest_work/*
config.yaml
tests/litellm/litellm_core_utils/llm_cost_calc/log.txt
tests/test_custom_dir/*
test.py

litellm_config.yaml
!.github/observatory/litellm_config.yaml
.cursor
litellm/proxy/to_delete_loadtest_work/*
update_model_cost_map.py
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py
scripts/test_vertex_ai_search.py
LAZY_LOADING_IMPROVEMENTS.md
STABILIZATION_TODO.md
Expand Down Expand Up @@ -124,6 +131,4 @@ crash.*.log
# pytest coverage data
.coverage

# _experimental/out UI build output
# (both componentized and non-componentized build the UI on project release)
litellm/proxy/_experimental/out/
ui/litellm-dashboard/out/
9 changes: 7 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Same thing for bug fixes. The tests should make it so that this specific bug can

`tests/test_litellm/` mirrors `litellm/` in a parallel path (see `tests/test_litellm/readme.md`). Name tests `test_<filename>.py`, but always match the existing test file in the directory you touch — many provider dirs use longer descriptive names (e.g. `test_anthropic_chat_transformation.py`) to avoid ambiguity across sibling folders. For bug fixes, extend the existing mapped test file rather than creating a new one. Only create a new test file for a new feature (provider, endpoint, or transformation module) that has no mapped test yet, following that directory's naming convention (or `test_<filename>.py` if you're the first test there). One focused regression test beats many shallow ones

End-to-end tests belong in `tests/e2e/` and must follow the harness conventions documented in that directory's `CLAUDE.md`

When creating PRs, don't set base to `main`. `litellm_internal_staging` serves that purpose

Always use @.github/pull_request_template.md as a guide for your PR body
Expand All @@ -33,9 +35,11 @@ If you ever make public-facing PR descriptions, comments, issues, commit message

Don't hesitate to use values in .env to get needed API keys and other secrets, as long as you never add them to conversation history, commit them, or include them in GitHub issues / PRs

Run tests before you commit. Also, run `make pre-commit` right before each commit, which generates types (as needed) and formats/lints your code. Any errors found must be fixed
Python max line length is 120, not 88

Run tests before you commit. Also, run `make pre-commit` right before each commit, which generates types (as needed) and formats/lints your code. Any errors found must be fixed. It only runs when there are staged frontend and/or backend changes and calculates violations, generates types, etc. based on the worktree, so stage what you need or stash/delete unwanted files in litellm/ or ui/ (where backend and frontend lint run, respectively) before running it. If it fails because dashboard api types are stale, it already regenerated them for you. You just need to stage the schema.d.ts, re-run `make pre-commit` to confirm it passes, and commit

When you fix violations gated by `ruff-strict-budget.json` or `basedpyright-code-budget.json`, run `make lint-budget-update` and commit the lowered baselines so the ceilings ratchet down instead of leaving stale headroom
When you fix violations gated by `ruff-strict-budget.json`, `type-discipline-budget.json`, or `basedpyright-code-budget.json`, run `make lint-budget-update` and commit the lowered limits so the ceilings ratchet down instead of leaving stale headroom. It measures the working tree, so it must contain exactly the fixes you're committing

If you're trying to create a new function that relies on untyped stuff, instead of adding more Any's and pushing `reportAny` / `reportExplicitAny` closer to their basedpyright ceilings, just validate it in the caller with Pydantic (a model or `TypeAdapter` that returns the typed thing or raises will do) and then pass the now typed variable in

Expand Down Expand Up @@ -69,6 +73,7 @@ Follow these coding conventions for new/updated code (a three-line fix in a lega
- No monster files or god objects
- No file sprawl: deliberate file and folder structure
- Standard over hand-rolled: use the official SDK or a library where one exists; where none does, follow industry standards instead of inventing local conventions
- API-fragmentation-aware: when logic must branch on which API surface produced or consumes data (e.g. chat completions vs Anthropic Messages vs Responses API shapes), proactively look for an existing shared helper (e.g. `litellm_core_utils/prompt_templates/factory.py`) before writing per-surface parsing in the new module; if none exists, add one there instead of duplicating the same format-detection logic in every new guardrail/integration

Follow conventional commits for commit names and PR titles

Expand Down
58 changes: 36 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.PHONY: help test test-unit test-unit-llms test-unit-proxy-guardrails test-unit-proxy-core test-unit-proxy-misc \
test-unit-integrations test-unit-core-utils test-unit-other test-unit-root \
test-proxy-unit-a test-proxy-unit-b test-integration test-unit-helm \
info lint lint-dev format \
lint-basedpyright lint-basedpyright-budget-update \
info lint lint-dev lint-checks format \
lint-basedpyright lint-basedpyright-budget-update lint-type-discipline lint-type-discipline-budget-update \
lint-ruff-budget lint-ruff-budget-update lint-budget-update lint-gate \
install-dev install-proxy-dev install-test-deps install-hooks \
install-helm-unittest check-circular-imports check-import-safety pre-commit \
Expand All @@ -27,12 +27,12 @@ help:
@echo " make lint - Run all linting (Ruff, basedpyright, format check, circular imports, import safety)"
@echo " make lint-ruff - Run Ruff linting only"
@echo " make lint-basedpyright - Run basedpyright strict, gated by per-rule error counts"
@echo " make lint-basedpyright-budget-update - Re-capture the basedpyright per-rule budget (ratchet)"
@echo " make lint-basedpyright-budget-update - Ratchet basedpyright limits down by what this branch fixed"
@echo " make lint-format - Check ruff format formatting (matches CI)"
@echo " make lint-ruff-budget - Gate the codebase total of each strict ruff rule against its ceiling"
@echo " make lint-ruff-budget - Gate the codebase total of each strict ruff rule against its limit"
@echo " make lint-gate - Strict ruff gate in CI-parity mode (fetches staging, simulates the merge)"
@echo " make lint-ruff-budget-update - Re-capture per-rule baselines in ruff-strict-budget.json (ratchet)"
@echo " make lint-budget-update - Re-capture all ratchet budgets (ruff + basedpyright)"
@echo " make lint-ruff-budget-update - Ratchet ruff-strict-budget.json limits down by what this branch fixed"
@echo " make lint-budget-update - Ratchet all budgets down (ruff + type-discipline + basedpyright)"
@echo " make check-circular-imports - Check for circular imports"
@echo " make check-import-safety - Check import safety"
@echo " make test - Run all tests"
Expand All @@ -53,6 +53,11 @@ help:
UV := uv
UV_RUN := $(UV) run --no-sync

LINT_DEP_INSTALL ?= install-dev
LINT_DEP_BASE ?= lint-fetch-base
LINT_JOBS := $(shell sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)
LINT_OUTPUT_SYNC := $(if $(filter output-sync,$(.FEATURES)),--output-sync=target,)

# Show info
info:
@echo "UV: $(UV)"
Expand Down Expand Up @@ -88,7 +93,7 @@ install-hooks:

# Formatting
# Wrap width is ruff.toml's single source of truth (line-length = 120), shared by the
# formatter, E501, and the import sorter so there's no 88-vs-120 split to reconcile.
# formatter and the import sorter so there's no 88-vs-120 split to reconcile.
format: install-dev
cd litellm && $(UV_RUN) ruff format --exclude '/enterprise/' . && cd ..

Expand All @@ -107,12 +112,12 @@ lint-fetch-base:
# running proxy need.
lint-install:
$(UV) sync --inexact --frozen --group proxy-dev
$(UV_RUN) prisma generate --schema litellm/proxy/schema.prisma
$(UV_RUN) python scripts/prisma_generate_if_needed.py

# Diff-scoped format check, identical to test-linting.yml's "Check ruff format" step:
# only the litellm Python files changed vs the base are checked, so a pre-existing
# format issue elsewhere doesn't block an unrelated commit.
lint-format-check-changed: install-dev lint-fetch-base
lint-format-check-changed: $(LINT_DEP_INSTALL) $(LINT_DEP_BASE)
@files=$$(git diff --name-only origin/litellm_internal_staging...HEAD -- 'litellm/**/*.py' | grep -v '^litellm/enterprise/' || true); \
if [ -z "$$files" ]; then \
echo "No changed litellm Python files to format-check."; \
Expand All @@ -121,7 +126,7 @@ lint-format-check-changed: install-dev lint-fetch-base
fi

# Linting targets
lint-ruff: install-dev
lint-ruff: $(LINT_DEP_INSTALL)
cd litellm && $(UV_RUN) ruff check . && cd ..

# faster linter for developing ...
Expand Down Expand Up @@ -156,15 +161,17 @@ lint-ruff-FULL-dev: install-dev
if [ -n "$$files" ]; then echo "$$files" | xargs $(UV_RUN) ruff check; \
else echo "No changed .py files to check."; fi

lint-basedpyright: install-dev lint-fetch-base
lint-basedpyright: $(LINT_DEP_INSTALL) $(LINT_DEP_BASE)
($(UV_RUN) basedpyright --outputjson || true) | $(UV_RUN) python scripts/type_check_gate.py --base origin/litellm_internal_staging

# Type-discipline budget (mutable collections / casts / type guards / kwargs /
# unexplained suppressions), the test-linting.yml step `make lint` used to omit.
lint-type-discipline: install-dev lint-fetch-base
lint-type-discipline: $(LINT_DEP_INSTALL) $(LINT_DEP_BASE)
$(UV_RUN) python scripts/type_discipline_gate.py --base origin/litellm_internal_staging

lint-basedpyright-budget-update: install-dev
# --update lowers each limit by what this branch fixed since its branch point, so
# it needs the base ref fetched to resolve the merge-base.
lint-basedpyright-budget-update: install-dev lint-fetch-base
($(UV_RUN) basedpyright --outputjson || true) | $(UV_RUN) python scripts/type_check_gate.py --update

lint-format: format-check
Expand All @@ -174,29 +181,36 @@ lint-ruff-budget: install-dev

# Strict gate, invoked the same way CI does in test-linting.yml so a local pass
# means the CI check will pass too.
lint-gate: install-dev lint-fetch-base
lint-gate: $(LINT_DEP_INSTALL) $(LINT_DEP_BASE)
$(UV_RUN) python scripts/ruff_strict_gate.py --base origin/litellm_internal_staging

lint-ruff-budget-update: install-dev
lint-ruff-budget-update: install-dev lint-fetch-base
$(UV_RUN) python scripts/ruff_strict_gate.py --update

# Ratchet all budgets in one shot (ruff strict + basedpyright)
lint-budget-update: lint-ruff-budget-update lint-basedpyright-budget-update
lint-type-discipline-budget-update: install-dev lint-fetch-base
$(UV_RUN) python scripts/type_discipline_gate.py --update

check-circular-imports: install-dev
# Ratchet all budgets in one shot (ruff strict + type-discipline + basedpyright)
lint-budget-update: lint-ruff-budget-update lint-type-discipline-budget-update lint-basedpyright-budget-update

check-circular-imports: $(LINT_DEP_INSTALL)
cd litellm && $(UV_RUN) python ../tests/documentation_tests/test_circular_imports.py && cd ..

check-import-safety: install-dev
check-import-safety: $(LINT_DEP_INSTALL)
@$(UV_RUN) python -c "from litellm import *; print('[from litellm import *] OK! no issues!');" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1)

# Combined linting, isomorphic to test-linting.yml's lint job so a local pass means a
# green CI lint: it installs the same env (proxy-dev + generated Prisma client) and then
# runs the diff-scoped ruff format check, whole-tree ruff check, the strict-rule /
# type-discipline / basedpyright budgets as a delta vs the base, then the circular-import
# and import-safety checks. Steps that compare against the base resolve it the same way CI
# does (merge-base with origin/litellm_internal_staging). lint-install is first so the
# Prisma client exists before basedpyright runs.
lint: lint-install lint-format-check-changed lint-ruff lint-gate lint-type-discipline lint-basedpyright check-circular-imports check-import-safety
# does (merge-base with origin/litellm_internal_staging). Setup (env sync, Prisma client,
# base fetch) runs once up front; the checks themselves are independent, so a sub-make
# fans them out with -j and the fast ones finish under basedpyright's shadow.
lint: lint-install lint-fetch-base
$(MAKE) -j $(LINT_JOBS) $(LINT_OUTPUT_SYNC) LINT_DEP_INSTALL= LINT_DEP_BASE= lint-checks

lint-checks: lint-format-check-changed lint-ruff lint-gate lint-type-discipline lint-basedpyright check-circular-imports check-import-safety

# Faster linting for local development (only checks changed code)
lint-dev: lint-format-changed check-circular-imports check-import-safety
Expand Down
Loading
Loading