Skip to content

chore: move scripts and runtime sources under litellm - #51006

Merged
yassin-berriai merged 1 commit into
litellm_chore_move_packagesfrom
litellm_chore_move_scripts_runtime
Nov 12, 2026
Merged

yassin-berriai merged 1 commit into
litellm_chore_move_packagesfrom
litellm_chore_move_scripts_runtime

Conversation

@yassin-berriai

@yassin-berriai yassin-berriai commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

[insert handwritten description here]

Details

TLDR

Problem this solves:

  • scripts/, backend/, migrations/ and schema.prisma still sit at the repo root

How it solves it:

  • The kept helpers move to litellm/scripts/, the backend and migration runner sources move to litellm/runtime/, and the canonical schema moves to litellm/schema.prisma
  • scripts/quickstart.sh and scripts/quickstart.ps1 move to litellm/scripts/ with their URL readers updated. scripts/ci_cd/baseline_db.py is deleted

The schema compatibility check accepts historical schemas at either location. The trusted-checkout guards try the new path first and fall back to the older layouts, because they run scripts from the base commit. The gateway sources move under litellm/runtime/gateway. The Docker runtime copies them to /app/gateway, so worker imports retain their standalone namespace and cheap startup. The gateway launcher still imports the original litellm_cli.main lazy entrypoint.

Linear ticket

Resolves LIT-10616

Screenshots / Proof of Fix

Restacked at 5df7e1cc1351eeddbf1649d32bf7658cd58d68d8 onto main 801e139c35af5eca132e8761cb11be19621218c4. Original authorship and one commit per layer are preserved. The only manual conflict resolution carries the new dashboard logo into its moved directory. Main content and existing path adaptations are retained. Focused cost-map and spend-log tests at the top tip passed 115 tests. The fresh top checkout has 14 root entries and all three required JSON files. Required CI remains with the separate CI session.

E2E exception at 6ce00fc. Prior proof below was run at 6a6593c61619d960383fbf956f7fd61ae188f930. Later changes carry main content into moved paths and preserve original CLI imports. Required CI on the restacked tip is still pending. The diff is path moves, deletions and reader updates. uv lock --check resolves 480 packages, import litellm works and the coverage census is OK. The focused helper tests pass 94 and 112, and actionlint adds no diagnostics over the base. The broader focused run also had failures that reproduce on the parent commit. The three lint-base-count tests need a GitHub origin in the checkout. The gateway isolation failure is fixed in the layer below. I didn't run distribution or deploy checks.

The focused type-discipline helper and gate checks pass 145 tests. Actionlint reports no diagnostics for the image scan and root limit workflows.

Current reader verification at 26609921e9f0b69f0a8aa66003cca845a3362a0b. The approval guard watches litellm/schema.prisma and retains historical paths. Its focused suite passes 29 tests, including spend-log changes in every schema copy. The health-check examples use the moved paths. Both quickstart scripts are preserved under litellm/scripts rather than deleted, and their self-download URLs and migration guide agree. Shell syntax validation and the original saved updater fetch and refresh checks pass. PowerShell execution was not checked.

Type

🧹 Refactoring

Caveats (if any)

Medium

  • Cached quickstart commands need the documented one-time URL overrides

Link to Devin session: https://app.devin.ai/sessions/294f6aba393343d998baaa7978294638
Open in Devin Desktop: https://app.devin.ai/desktop/session/294f6aba393343d998baaa7978294638?variant=devin
Requested by: @yassin-berriai


Note

Medium Risk
Touches CI, Docker entrypoints, schema sync, and path fallbacks across the repo; miswired paths could break installs or image builds until caches and saved quickstart scripts are updated.

Overview
Relocates repository tooling and componentized runtime code into the litellm package tree and makes litellm/schema.prisma the canonical Prisma schema. Root-level scripts/, backend/, migrations/, and schema.prisma give way to litellm/scripts/, litellm/runtime/ (backend, migrations, gateway), and litellm/schema.prisma, with docs, Makefile, AGENTS.md, and helper paths updated to match.

CI and local dev follow the new layout: GitHub Actions, path filters, and guards (cost map, spend logs, schema sync, lint gates) call litellm/scripts/..., often with legacy fallbacks until main has the move. setup-uv-with-retries runs .github/scripts/setup_rust_environment.sh (toolchain from litellm/rust/rust-toolchain.toml). Rust workflows and Makefile exports align RUSTUP_TOOLCHAIN / SQLX_OFFLINE with that. Some .agents/skills guides are removed, and AGENTS.md drops the database-access skill reference.

Docker and packaging keep compatibility: the image still exposes /app/schema.prisma and /app/gateway while building from litellm/runtime. The backend entry becomes litellm.runtime.backend.main. litellm-core packaging excludes scripts, runtime, and schema from wheels. quickstart URLs and one-time overrides point at litellm/scripts/.

Reviewed by Cursor Bugbot for commit 312bcd9. Bugbot is set up for automated code reviews on this repo. Configure here.

Current reader fixes

Gateway child environments include the moved runtime, source tests and checkout before the effective inherited or explicit PYTHONPATH. The 105 process and gateway tests pass. Branch installer examples and autoroute error text now use litellm/scripts. The 26 autoroute command tests pass. Image scan paths include the packaging backend helpers.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

CLAassistant commented Nov 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@veria-ai

veria-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch from a988d44 to 6a6593c Compare November 10, 2026 19:40
@devin-ai-integration
devin-ai-integration Bot requested a review from a team November 10, 2026 19:40
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/scripts/check_schema_compatibility.py 0.00% 2 Missing ⚠️
litellm/scripts/ci_cd/run_migration.py 0.00% 2 Missing ⚠️
litellm/scripts/type_discipline_gate.py 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch 2 times, most recently from 0854308 to 2a80ccd Compare November 10, 2026 20:00
@codspeed

codspeed Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 43 untouched benchmarks


Comparing litellm_chore_move_scripts_runtime (312bcd9) with litellm_chore_move_packages (1450a37)

Open in CodSpeed

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch from 7e4a80b to 6f23f88 Compare November 10, 2026 20:33
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch 2 times, most recently from 2e6cea3 to bf7afaa Compare November 11, 2026 20:10
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch 2 times, most recently from 51be626 to 372cdae Compare November 11, 2026 20:28
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch from 372cdae to 6ce00fc Compare November 11, 2026 20:32
@devin-ai-integration

Copy link
Copy Markdown
Contributor

bugbot run

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_chore_move_scripts_runtime branch from b1a06eb to 312bcd9 Compare November 12, 2026 03:55
@yassin-berriai

Copy link
Copy Markdown
Contributor Author

@greptileai

@yassin-berriai

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 312bcd9. Configure here.

@yassin-berriai
yassin-berriai merged commit adc4c01 into main Nov 12, 2026
142 of 148 checks passed
@yassin-berriai
yassin-berriai deleted the litellm_chore_move_scripts_runtime branch November 12, 2026 04:20
shudonglin added a commit to rayward-external/litellm that referenced this pull request Nov 12, 2026
…oving (#380)

cost-map-guard.yml runs this script from the PR's base-branch tip for
tamper-resistance, so an in-flight sync PR that relocates
ci_cd/cost_map_pins.json under litellm/ (upstream's own restructuring,
BerriAI#51006) gets evaluated by this unaware, pre-move copy and reports the
pins file missing even though it only moved. Backports upstream's own
multi-path fallback for the cost map, its backup, and the pins file so
this script finds them wherever a later sync puts them, landing this
fix on main first so the in-flight sync PR's base picks it up without
needing a chicken-and-egg workaround.

Co-authored-by: Claude <noreply@anthropic.com>
@adamsiemion

adamsiemion commented Nov 13, 2026 •

Copy link
Copy Markdown

@moe-berri

Copy link
Copy Markdown
Contributor

Hey @adamsiemion thanks for flagging this, should be fixed now

mateo-berri added a commit that referenced this pull request Nov 24, 2026
* ci(lint): run lint scripts from the paths the PR head has

The lint workflow checks out the PR head but runs main's steps, so every PR branched before #51006 failed on litellm/scripts and .github/linters paths its head does not have. The steps now pick litellm/scripts or scripts, and the old or new ruff-tests.toml and Claude Code version resolver, from what the head carries

* ci(lint): keep the merge-ref code-quality job on main's script path

The code-quality job checks out the PR merge ref, which always carries litellm/scripts, so only the python job that checks out the PR head needs the fallback

* ci(lint): run the lint tools from the paths the PR head carries

The python and typecheck jobs check out the PR head, so a head branched before the 2026-11-12 move of scripts/ to litellm/scripts and of ruff-tests.toml to .github/linters could not open the gate scripts and failed lint passed until it merged main

* test(ci): run the lint jobs that check out the PR head on old and current tool layouts

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants