-
Notifications
You must be signed in to change notification settings - Fork 304
feat: llm-d (EPP+Envoy) router backend #2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
S1ro1
wants to merge
2
commits into
main
Choose a base branch
from
feat/llm-d-router-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!/usr/bin/env bash | ||
| # Install the llm-d standalone (no-Kubernetes) routing binaries into | ||
| # third_party/llmd/bin: | ||
| # - epp : llm-d-router Endpoint Picker (the routing brain) | ||
| # - pd-sidecar : decode-side proxy for P/D disaggregation | ||
| # - envoy : the data-plane proxy that calls the EPP via ext_proc | ||
| # | ||
| # epp/pd-sidecar are built from a pinned llm-d-router commit. We currently build | ||
| # from a small fork that adds P/D disaggregation for vLLM's token-in | ||
| # /inference/v1/generate endpoint (prime-rl's renderer / TITO rollout path) — | ||
| # upstream's pd-sidecar only disaggregates the OpenAI endpoints, so token-in P/D | ||
| # silently runs decode-only. The fork is pending upstream PR | ||
| # llm-d/llm-d-router#1458; switch LLMD_ROUTER_REPO back to the upstream repo and | ||
| # bump LLMD_ROUTER_REF once it merges. The fork is branched off the upstream | ||
| # commit that added the EPP vllmhttp parser (PR #1248), which the renderer path | ||
| # also needs. | ||
| # | ||
| # System Go is not required: a Go toolchain is vendored under third_party/llmd/go | ||
| # and used to bootstrap; GOTOOLCHAIN=auto fetches the exact version the module | ||
| # pins. Envoy is pulled as a static binary from its release container image | ||
| # (docker is the only widely-available extraction path on bare-metal nodes). | ||
| set -euo pipefail | ||
|
|
||
| LLMD_ROUTER_REPO="${LLMD_ROUTER_REPO:-https://github.com/S1ro1/llm-d-router.git}" | ||
| LLMD_ROUTER_REF="${LLMD_ROUTER_REF:-1ca4243ec84c657b4a5f507a1776d6c15a618d5b}" | ||
| GO_BOOTSTRAP_VERSION="${GO_BOOTSTRAP_VERSION:-1.23.4}" | ||
| ENVOY_VERSION="${ENVOY_VERSION:-1.36.0}" | ||
|
|
||
| SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
| PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd) | ||
| LLMD_DIR="$PROJECT_DIR/third_party/llmd" | ||
| BIN_DIR="$LLMD_DIR/bin" | ||
| GO_ROOT="$LLMD_DIR/go" | ||
| SRC_DIR="$LLMD_DIR/src" | ||
| mkdir -p "$BIN_DIR" | ||
|
|
||
| # --- Go toolchain (vendored bootstrap; auto-upgrades to the module's version) --- | ||
| if [ ! -x "$GO_ROOT/bin/go" ]; then | ||
| echo "[install_llmd] downloading bootstrap Go $GO_BOOTSTRAP_VERSION" | ||
| rm -rf "$GO_ROOT" | ||
| curl -fsSL "https://go.dev/dl/go${GO_BOOTSTRAP_VERSION}.linux-amd64.tar.gz" | tar -xz -C "$LLMD_DIR" | ||
| fi | ||
| export GOROOT="$GO_ROOT" | ||
| export PATH="$GO_ROOT/bin:$PATH" | ||
| export GOTOOLCHAIN=auto | ||
| echo "[install_llmd] bootstrap $(go version)" | ||
|
|
||
| # --- Fetch llm-d-router source at the pinned ref --- | ||
| echo "[install_llmd] fetching ${LLMD_ROUTER_REPO}@${LLMD_ROUTER_REF}" | ||
| if [ ! -d "$SRC_DIR/.git" ]; then | ||
| rm -rf "$SRC_DIR" | ||
| git clone --quiet "$LLMD_ROUTER_REPO" "$SRC_DIR" | ||
| fi | ||
| git -C "$SRC_DIR" remote set-url origin "$LLMD_ROUTER_REPO" | ||
| git -C "$SRC_DIR" fetch --quiet origin | ||
| git -C "$SRC_DIR" checkout --quiet "$LLMD_ROUTER_REF" | ||
|
|
||
| # --- Build epp + pd-sidecar --- | ||
| echo "[install_llmd] building epp + pd-sidecar" | ||
| ( cd "$SRC_DIR" && go build -o "$BIN_DIR/epp" ./cmd/epp && go build -o "$BIN_DIR/pd-sidecar" ./cmd/pd-sidecar ) | ||
|
|
||
| # --- Envoy static binary (extract from the release image; keep if present) --- | ||
| if [ ! -x "$BIN_DIR/envoy" ]; then | ||
| echo "[install_llmd] extracting Envoy ${ENVOY_VERSION} from envoyproxy/envoy image" | ||
| cid=$(docker create "envoyproxy/envoy:v${ENVOY_VERSION}") | ||
| docker cp "${cid}:/usr/local/bin/envoy" "$BIN_DIR/envoy" | ||
| docker rm "$cid" >/dev/null | ||
| chmod +x "$BIN_DIR/envoy" | ||
| fi | ||
|
|
||
| echo "[install_llmd] installed binaries in $BIN_DIR:" | ||
| "$BIN_DIR/epp" --version 2>&1 | head -1 || true | ||
| "$BIN_DIR/envoy" --version 2>&1 | head -1 || true | ||
| "$BIN_DIR/pd-sidecar" --help >/dev/null 2>&1 && echo " pd-sidecar OK" || true | ||
| echo "[install_llmd] done" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.