-
Notifications
You must be signed in to change notification settings - Fork 195
Extending the guide with multiple LoRAs serving with BBR #1859
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||
| apiVersion: gateway.networking.k8s.io/v1 | ||||
| kind: HTTPRoute | ||||
| metadata: | ||||
| name: llm-llama-route | ||||
| spec: | ||||
| parentRefs: | ||||
| - group: gateway.networking.k8s.io | ||||
| kind: Gateway | ||||
| name: inference-gateway | ||||
| rules: | ||||
| - backendRefs: | ||||
| - group: inference.networking.k8s.io | ||||
| kind: InferencePool | ||||
| name: vllm-llama3-8b-instruct | ||||
| matches: | ||||
| - path: | ||||
| type: PathPrefix | ||||
| value: / | ||||
| headers: | ||||
| - type: Exact | ||||
| #Body-Based routing(https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/pkg/bbr/README.md) is being used to copy the model name from the request body to the header. | ||||
| name: X-Gateway-Model-Name | ||||
| value: 'meta-llama/Llama-3.1-8B-Instruct' | ||||
| timeouts: | ||||
| request: 300s | ||||
| --- | ||||
| apiVersion: gateway.networking.k8s.io/v1 | ||||
| kind: HTTPRoute | ||||
| metadata: | ||||
| name: llm-deepseek-route #give this HTTPRoute any name that helps you to group and track the matchers | ||||
| spec: | ||||
| parentRefs: | ||||
| - group: gateway.networking.k8s.io | ||||
| kind: Gateway | ||||
| name: inference-gateway | ||||
| rules: | ||||
| - backendRefs: | ||||
| - group: inference.networking.k8s.io | ||||
| kind: InferencePool | ||||
| name: vllm-deepseek-r1 | ||||
| matches: | ||||
| - path: | ||||
| type: PathPrefix | ||||
| value: / | ||||
| headers: | ||||
| - type: Exact | ||||
| #Body-Based routing(https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/pkg/bbr/README.md) is being used to copy the model name from the request body to the header. | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
Suggested change
|
||||
| name: X-Gateway-Model-Name | ||||
| value: 'deepseek/vllm-deepseek-r1' | ||||
| - path: | ||||
| type: PathPrefix | ||||
| value: / | ||||
| headers: | ||||
| - type: Exact | ||||
| #Body-Based routing(https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/pkg/bbr/README.md) is being used to copy the model name from the request body to the header. | ||||
| name: X-Gateway-Model-Name | ||||
| value: 'food-review' | ||||
| - path: | ||||
| type: PathPrefix | ||||
| value: / | ||||
| headers: | ||||
| - type: Exact | ||||
| #Body-Based routing(https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/pkg/bbr/README.md) is being used to copy the model name from the request body to the header. | ||||
| name: X-Gateway-Model-Name | ||||
| value: 'movie-critique' | ||||
| timeouts: | ||||
| request: 300s | ||||
| --- | ||||
| apiVersion: gateway.networking.k8s.io/v1 | ||||
| kind: HTTPRoute | ||||
| metadata: | ||||
| name: vllm-llama3-8b-instruct-lora-food-review-1 #give this HTTPRoute any name that helps you to group and track the routes | ||||
| spec: | ||||
| parentRefs: | ||||
| - group: gateway.networking.k8s.io | ||||
| kind: Gateway | ||||
| name: inference-gateway | ||||
| rules: | ||||
| - backendRefs: | ||||
| - group: inference.networking.k8s.io | ||||
| kind: InferencePool | ||||
| name: vllm-llama3-8b-instruct | ||||
| matches: | ||||
| - path: | ||||
| type: PathPrefix | ||||
| value: / | ||||
| headers: | ||||
| - type: Exact | ||||
| #Body-Based routing(https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/pkg/bbr/README.md) is being used to copy the model name from the request body to the header. | ||||
| name: X-Gateway-Model-Name | ||||
| value: 'food-review-1' #this is the name of LoRA as defined in vLLM deployment | ||||
| timeouts: | ||||
| request: 300s | ||||
|
Comment on lines
+69
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this is not part of the first HttpRoute |
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: vllm-deepseek-r1 | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: vllm-deepseek-r1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: vllm-deepseek-r1 | ||
| spec: | ||
| containers: | ||
| - name: vllm-sim | ||
| image: ghcr.io/llm-d/llm-d-inference-sim:v0.4.0 | ||
| imagePullPolicy: Always | ||
| args: | ||
| - --model | ||
| - deepseek/vllm-deepseek-r1 | ||
| - --port | ||
| - "8000" | ||
| - --max-loras | ||
| - "2" | ||
| - --lora-modules | ||
| - '{"name": "food-review"}' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can call the lora adapters with completely different names to avoid confusion? |
||
| - '{"name": "movie-critique"}' | ||
| env: | ||
| - name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| ports: | ||
| - containerPort: 8000 | ||
| name: http | ||
| protocol: TCP | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this comment from the yaml?
theoretically for testing the HttpRoute functionality one can inject the header manually.
this has nothing to do with BBR, which is just an implementation detail and one way to inject the model name header.