From b63f384a7762b0138b85a26c0918f43cf041bbde Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:53:37 +0000 Subject: [PATCH] fix(proxy): move gateway manifest into crate --- .github/scripts/verify_linux_native_wheel.py | 4 +++- .github/workflows/test-unit.yml | 2 +- Dockerfile | 2 +- docker/Dockerfile.database | 2 +- docker/Dockerfile.non_root | 2 +- litellm-rust/{ => crates/gateway}/pyproject.toml | 13 +++++++------ pyproject.toml | 2 +- uv.lock | 4 ++-- 8 files changed, 17 insertions(+), 14 deletions(-) rename litellm-rust/{ => crates/gateway}/pyproject.toml (67%) diff --git a/.github/scripts/verify_linux_native_wheel.py b/.github/scripts/verify_linux_native_wheel.py index 428326ea40a..83111b95ca5 100644 --- a/.github/scripts/verify_linux_native_wheel.py +++ b/.github/scripts/verify_linux_native_wheel.py @@ -167,7 +167,9 @@ def main( capture_output=True, text=True, ).stdout.strip() - project_directory: Final = Path(__file__).parents[2] / ("litellm-rust" if gateway else ".") + project_directory: Final = Path(__file__).parents[2] / ( + "litellm-rust/crates/gateway" if gateway else "." + ) pyproject: Final = (project_directory / "pyproject.toml").read_text() maturin_match: Final = re.search(r'"maturin==([^";]+)', pyproject) if maturin_match is None: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index d6756a96796..b91ce565c97 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -42,7 +42,7 @@ jobs: id: rust-bridge-key if: steps.changes.outputs.decision != 'skip' env: - RUST_BRIDGE_CACHE_KEY: ${{ runner.os }}-rust-bridge-editable-${{ hashFiles('litellm-rust/Cargo.lock', 'litellm-rust/Cargo.toml', 'litellm-rust/pyproject.toml', 'litellm-rust/crates/**', 'pyproject.toml') }} + RUST_BRIDGE_CACHE_KEY: ${{ runner.os }}-rust-bridge-editable-${{ hashFiles('litellm-rust/Cargo.lock', 'litellm-rust/Cargo.toml', 'litellm-rust/crates/gateway/pyproject.toml', 'litellm-rust/crates/**', 'pyproject.toml') }} run: echo "key=$RUST_BRIDGE_CACHE_KEY" >> "$GITHUB_OUTPUT" - name: Set up Python diff --git a/Dockerfile b/Dockerfile index 326785fa120..fe18b6ba71d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/.venv \ COPY pyproject.toml uv.lock ./ COPY enterprise/pyproject.toml enterprise/ COPY litellm-proxy-extras/pyproject.toml litellm-proxy-extras/ -COPY litellm-rust/pyproject.toml litellm-rust/ +COPY litellm-rust/crates/gateway/pyproject.toml litellm-rust/crates/gateway/ # Install third-party dependencies (cached unless pyproject.toml/uv.lock change) RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-groups --no-editable \ diff --git a/docker/Dockerfile.database b/docker/Dockerfile.database index 047d146d93b..5a535f9e023 100644 --- a/docker/Dockerfile.database +++ b/docker/Dockerfile.database @@ -75,7 +75,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/.venv \ COPY pyproject.toml uv.lock ./ COPY enterprise/pyproject.toml enterprise/ COPY litellm-proxy-extras/pyproject.toml litellm-proxy-extras/ -COPY litellm-rust/pyproject.toml litellm-rust/ +COPY litellm-rust/crates/gateway/pyproject.toml litellm-rust/crates/gateway/ # Install third-party dependencies (cached unless pyproject.toml/uv.lock change) RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-groups --no-editable \ diff --git a/docker/Dockerfile.non_root b/docker/Dockerfile.non_root index c2ee8661504..dc69e3d8073 100644 --- a/docker/Dockerfile.non_root +++ b/docker/Dockerfile.non_root @@ -77,7 +77,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/.venv \ COPY pyproject.toml uv.lock ./ COPY enterprise/pyproject.toml enterprise/ COPY litellm-proxy-extras/pyproject.toml litellm-proxy-extras/ -COPY litellm-rust/pyproject.toml litellm-rust/ +COPY litellm-rust/crates/gateway/pyproject.toml litellm-rust/crates/gateway/ # Install third-party dependencies (cached unless pyproject.toml/uv.lock change) RUN --mount=type=cache,target=/app/.cache/uv,id=litellm-uv-cache \ diff --git a/litellm-rust/pyproject.toml b/litellm-rust/crates/gateway/pyproject.toml similarity index 67% rename from litellm-rust/pyproject.toml rename to litellm-rust/crates/gateway/pyproject.toml index ebb1fef81fe..cb7301834cd 100644 --- a/litellm-rust/pyproject.toml +++ b/litellm-rust/crates/gateway/pyproject.toml @@ -13,7 +13,7 @@ requires = ["maturin==1.15.0"] build-backend = "maturin" [tool.maturin] -manifest-path = "crates/gateway/Cargo.toml" +manifest-path = "Cargo.toml" bindings = "bin" profile = "release" strip = true @@ -22,15 +22,16 @@ strip = true cache-keys = [ { file = "pyproject.toml" }, { file = "Cargo.toml" }, - { file = "Cargo.lock" }, - { file = "crates/**/*" }, - { file = "../rust-toolchain.toml" }, - { file = "../.cargo/config.toml" }, + { file = "../../Cargo.toml" }, + { file = "../../Cargo.lock" }, + { file = "../**/*" }, + { file = "../../../rust-toolchain.toml" }, + { file = "../../../.cargo/config.toml" }, ] [tool.commitizen] version = "0.1.0" version_files = [ "pyproject.toml:^version", - "../pyproject.toml:litellm-gateway==", + "../../../pyproject.toml:litellm-gateway==", ] diff --git a/pyproject.toml b/pyproject.toml index 495954312f5..fbf1f61d2ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -387,7 +387,7 @@ litellm-enterprise = { workspace = true } litellm-gateway = { workspace = true } [tool.uv.workspace] -members = ["enterprise", "litellm-proxy-extras", "litellm-rust"] +members = ["enterprise", "litellm-proxy-extras", "litellm-rust/crates/gateway"] [tool.commitizen] version = "1.108.0" diff --git a/uv.lock b/uv.lock index 5518fdbcf4f..83d2353dcc4 100644 --- a/uv.lock +++ b/uv.lock @@ -5235,7 +5235,7 @@ requires-dist = [ { name = "keyring", marker = "extra == 'cli'", specifier = ">=25.6.0,<26.0" }, { name = "langfuse", marker = "extra == 'proxy-runtime'", specifier = ">=4.7,<5.0" }, { name = "litellm-enterprise", marker = "extra == 'proxy'", editable = "enterprise" }, - { name = "litellm-gateway", marker = "extra == 'proxy'", editable = "litellm-rust" }, + { name = "litellm-gateway", marker = "extra == 'proxy'", editable = "litellm-rust/crates/gateway" }, { name = "litellm-proxy-extras", marker = "extra == 'proxy'", editable = "litellm-proxy-extras" }, { name = "llm-sandbox", marker = "extra == 'proxy-runtime'", specifier = ">=0.3.39,<1.0" }, { name = "mangum", marker = "extra == 'proxy-runtime'", specifier = ">=0.17.0,<1.0" }, @@ -5438,7 +5438,7 @@ source = { editable = "enterprise" } [[package]] name = "litellm-gateway" version = "0.1.0" -source = { editable = "litellm-rust" } +source = { editable = "litellm-rust/crates/gateway" } [[package]] name = "litellm-proxy-extras"