-
Notifications
You must be signed in to change notification settings - Fork 690
feat: Dynamo LLM Router Integeration #3045
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
arunraman
wants to merge
10
commits into
main
Choose a base branch
from
arraman-dev
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 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fe86080
feat: add LLM Router deployment examples and configuration for NVIDIA…
arunraman 23da93b
refactor: remove deprecated helm-enhancement-implementation.yaml and …
arunraman fe3b585
chore: update LLM Router configuration files and README for improved …
arunraman 8cf5596
Fix trailing whitespace in YAML files for pre-commit checks
arunraman 2e847a2
Update README.md to remove trailing whitespace and enhance clarity in…
arunraman 07ac0dc
Update LLM Router README.md for improved clarity and deployment instr…
arunraman 8382860
Update LLM Router README.md to fix trailing whitespace in routing str…
arunraman 607af86
chore: trigger CI re-run
arunraman 96c7df1
fix: correct documentation links to use docs/kubernetes path
arunraman c044e06
refactor: rename LLM Router directory to LLMRouter
arunraman 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
Some comments aren't visible on the classic Files Changed page.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,26 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| apiVersion: nvidia.com/v1alpha1 | ||
| kind: DynamoGraphDeployment | ||
| metadata: | ||
| name: vllm-agg-${MODEL_SUFFIX} | ||
| spec: | ||
| services: | ||
| VllmDecodeWorker: | ||
| envFromSecret: hf-token-secret | ||
| dynamoNamespace: vllm-agg | ||
| componentType: worker | ||
| replicas: 1 | ||
| resources: | ||
| limits: | ||
| gpu: "1" | ||
| extraPodSpec: | ||
| mainContainer: | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:${DYNAMO_VERSION} | ||
| workingDir: /workspace/components/backends/vllm | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| args: | ||
| - python3 -m dynamo.vllm --model ${MODEL_NAME} |
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,43 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| apiVersion: nvidia.com/v1alpha1 | ||
| kind: DynamoGraphDeployment | ||
| metadata: | ||
| name: vllm-disagg-${MODEL_SUFFIX} | ||
| spec: | ||
| services: | ||
| VllmDecodeWorker: | ||
| dynamoNamespace: vllm-agg | ||
| envFromSecret: hf-token-secret | ||
| componentType: worker | ||
| replicas: 1 | ||
| resources: | ||
| limits: | ||
| gpu: "1" | ||
| extraPodSpec: | ||
| mainContainer: | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:${DYNAMO_VERSION} | ||
| workingDir: /workspace/components/backends/vllm | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| args: | ||
| - "python3 -m dynamo.vllm --model ${MODEL_NAME}" | ||
| VllmPrefillWorker: | ||
| dynamoNamespace: vllm-agg | ||
| envFromSecret: hf-token-secret | ||
| componentType: worker | ||
| replicas: 1 | ||
| resources: | ||
| limits: | ||
| gpu: "1" | ||
| extraPodSpec: | ||
| mainContainer: | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:${DYNAMO_VERSION} | ||
| workingDir: /workspace/components/backends/vllm | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| args: | ||
| - "python3 -m dynamo.vllm --model ${MODEL_NAME} --is-prefill-worker" |
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,16 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| apiVersion: nvidia.com/v1alpha1 | ||
| kind: DynamoGraphDeployment | ||
| metadata: | ||
| name: vllm-frontend | ||
| spec: | ||
| services: | ||
| Frontend: | ||
| dynamoNamespace: vllm-agg | ||
| componentType: frontend | ||
| replicas: 1 | ||
| extraPodSpec: | ||
| mainContainer: | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:${DYNAMO_VERSION} |
116 changes: 116 additions & 0 deletions
116
examples/deployments/LLM Router/llm-router-values-override.yaml
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,116 @@ | ||
| ## | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| ## | ||
|
|
||
| # LLM Router Helm Values for NVIDIA Dynamo Cloud Platform Integration | ||
| # Based on official sample: https://github.com/NVIDIA-AI-Blueprints/llm-router/blob/main/deploy/helm/llm-router/values.override.yaml.sample | ||
| # Uses official External ConfigMap strategy for custom configuration | ||
|
|
||
| # Global configuration (following official sample structure) | ||
| # NOTE: Update imageRegistry and imagePullSecrets before deployment (see README Step 6) | ||
| global: | ||
| storageClass: "standard" | ||
| imageRegistry: "YOUR_REGISTRY_HERE/" # REPLACE with your Docker registry | ||
| imagePullSecrets: | ||
| - name: nvcr-secret # UPDATE to match your registry credentials | ||
|
|
||
| # Router Controller Configuration | ||
| routerController: | ||
| enabled: true | ||
| replicas: 1 | ||
| image: | ||
| repository: llm-router-controller # Will be prefixed with global.imageRegistry | ||
| tag: latest | ||
| pullPolicy: IfNotPresent | ||
|
|
||
| service: | ||
| type: ClusterIP | ||
| port: 8084 | ||
|
|
||
| # Dynamo-specific environment variables | ||
| env: | ||
| - name: LOG_LEVEL | ||
| value: "INFO" | ||
| - name: ENABLE_METRICS | ||
| value: "true" | ||
| - name: DYNAMO_API_BASE | ||
| value: "http://vllm-frontend-frontend.dynamo-kubernetes.svc.cluster.local:8000" | ||
| - name: DYNAMO_API_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: dynamo-api-secret | ||
| key: DYNAMO_API_KEY | ||
|
|
||
| # STRATEGY 1: External ConfigMap (Official Support) | ||
| # Uses the official Helm chart's external ConfigMap feature | ||
| config: | ||
| existingConfigMap: "router-config-dynamo" # Points to our router configuration | ||
|
|
||
| # Router Server Configuration | ||
| routerServer: | ||
| enabled: true | ||
| replicas: 1 # Single replica for simpler deployment | ||
| image: | ||
| repository: llm-router-server | ||
| tag: latest | ||
| pullPolicy: IfNotPresent | ||
| env: | ||
| - name: HF_HOME | ||
| value: "/tmp/huggingface" | ||
| - name: TRANSFORMERS_CACHE | ||
| value: "/tmp/huggingface/transformers" | ||
| - name: HF_HUB_CACHE | ||
| value: "/tmp/huggingface/hub" | ||
| resources: | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| memory: "8Gi" | ||
| requests: | ||
| nvidia.com/gpu: 1 | ||
| memory: "8Gi" | ||
| # Model repository configuration | ||
| modelRepository: | ||
| path: "/model_repository/routers" | ||
| volumes: | ||
| modelRepository: | ||
| enabled: true | ||
| mountPath: "/model_repository" | ||
| storage: | ||
| persistentVolumeClaim: | ||
| enabled: true | ||
| existingClaim: "router-models-pvc" | ||
| service: | ||
| type: ClusterIP | ||
| shm_size: "8G" | ||
|
|
||
| # Ingress Configuration (disabled for internal access) | ||
| ingress: | ||
| enabled: false | ||
| className: "nginx" | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/rewrite-target: /$2 | ||
| nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
| nginx.ingress.kubernetes.io/proxy-body-size: "10m" | ||
| nginx.ingress.kubernetes.io/proxy-read-timeout: "300" | ||
| nginx.ingress.kubernetes.io/proxy-send-timeout: "300" | ||
| hosts: | ||
| - host: llm-router.local | ||
| paths: | ||
| - path: /app(/|$)(.*) | ||
| pathType: ImplementationSpecific | ||
| service: app | ||
| - path: /router-controller(/|$)(.*) | ||
| pathType: ImplementationSpecific | ||
| service: router-controller | ||
|
|
||
| # Demo app (disabled) | ||
| app: | ||
| enabled: true # Enable for demo web interface | ||
| replicas: 1 # Single replica for simpler deployment | ||
| image: | ||
| repository: llm-router-app | ||
| tag: latest | ||
| pullPolicy: IfNotPresent | ||
| service: | ||
| type: ClusterIP |
122 changes: 122 additions & 0 deletions
122
examples/deployments/LLM Router/router-config-dynamo.yaml
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,122 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # LLM Router Configuration for NVIDIA Dynamo Integration | ||
| # This configuration routes requests to the official NVIDIA Dynamo Cloud Platform | ||
| # deployment using the proper service endpoints | ||
| # | ||
| # Based on: https://docs.nvidia.com/dynamo/latest/guides/dynamo_deploy/dynamo_cloud.html | ||
| # API Key pattern follows: https://github.com/NVIDIA-AI-Blueprints/llm-router/blob/main/deploy/helm/llm-router/templates/router-controller-configmap.yaml | ||
| # | ||
| # IMPORTANT: This config references the 3 models for intelligent routing: | ||
| # - meta-llama/Llama-3.1-8B-Instruct (Fast model for simple tasks) | ||
| # - meta-llama/Llama-3.1-70B-Instruct (Powerful model for complex tasks) | ||
| # - mistralai/Mixtral-8x22B-Instruct-v0.1 (Creative model for conversational tasks) | ||
| # | ||
| # To add more models: | ||
| # 1. Deploy the model using the pattern in Step 2 of README.md | ||
| # 2. Add router entries below following the same format | ||
| # | ||
| # NOTE: Environment variables are resolved at runtime: | ||
| # - ${DYNAMO_API_BASE}: Points to the Dynamo service endpoint | ||
| # - ${DYNAMO_API_KEY}: API key for authenticating with Dynamo services | ||
| # | ||
| # These variables are populated from: | ||
| # - ConfigMap: DYNAMO_API_BASE (defined in llm-router-values-override.yaml) | ||
| # - Secret: DYNAMO_API_KEY (created during deployment setup) | ||
|
|
||
| policies: | ||
| - name: "task_router" | ||
| url: http://llm-router-router-server.llm-router.svc.cluster.local:8000/v2/models/task_router_ensemble/infer | ||
| llms: | ||
| - name: Brainstorming | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Chatbot | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: mistralai/Mixtral-8x22B-Instruct-v0.1 | ||
| - name: Classification | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: Closed QA | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Code Generation | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Extraction | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: Open QA | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Other | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: mistralai/Mixtral-8x22B-Instruct-v0.1 | ||
| - name: Rewrite | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: Summarization | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Text Generation | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: mistralai/Mixtral-8x22B-Instruct-v0.1 | ||
| - name: Unknown | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: "complexity_router" | ||
| url: http://llm-router-router-server.llm-router.svc.cluster.local:8000/v2/models/complexity_router_ensemble/infer | ||
| llms: | ||
| - name: Creativity | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Reasoning | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Contextual-Knowledge | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: Few-Shot | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-70B-Instruct | ||
| - name: Domain-Knowledge | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: mistralai/Mixtral-8x22B-Instruct-v0.1 | ||
| - name: No-Label-Reason | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct | ||
| - name: Constraint | ||
| api_base: ${DYNAMO_API_BASE} | ||
| api_key: ${DYNAMO_API_KEY} | ||
| model: meta-llama/Llama-3.1-8B-Instruct |
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.
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.
Hi @arunraman, I'm assuming we will currently rely on you or the LLM Router team to maintain support for this example. If you have other expectations for maintenance moving forward, please let us know. If we can't have someone helping to maintain it, then we may need to consider removing it or moving the dynamo example to LLM Router repository at some point to flip the maintenance burden.