Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions helm/templates/deployment-vllm-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ spec:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $modelSpec.command }}
command: {{ toYaml $modelSpec.command | nindent 12 }}
{{- else }}
command:
{{- if eq $modelSpec.repository "lmcache/vllm-openai" }}
- "/opt/venv/bin/vllm"
Expand Down Expand Up @@ -219,6 +222,10 @@ spec:
- "--chat-template"
- "/templates/{{ $modelSpec.chatTemplate }}"
{{- end }}
{{- end }}
{{- if $modelSpec.args }}
args: {{ toYaml $modelSpec.args | nindent 12 }}
{{- end }}
imagePullPolicy: "{{ .Values.servingEngineSpec.imagePullPolicy }}"
env:
- name: PYTHONHASHSEED
Expand Down
39 changes: 39 additions & 0 deletions helm/tests/deployment-vllm-multi_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,42 @@ tests:
notContains:
path: spec.template.spec.containers[0].command
content: "--revision"

- it: should use custom command and args on the main container
release:
name: vllm
set:
servingEngineSpec:
enableEngine: true
modelSpec:
- name: "opt125m"
repository: "lmcache/vllm-openai"
tag: "latest"
modelURL: "facebook/opt-125m"
replicaCount: 1
requestCPU: 6
requestMemory: "16Gi"
requestGPU: 1
pvcStorage: "50Gi"
command:
- "sh"
- "-c"
args:
- "mkdir -p /tmp/lmcache_prometheus && exec vllm serve facebook/opt-125m --host 0.0.0.0 --port 8000"
asserts:
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].command
value:
- "sh"
- "-c"
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].args
value:
- "mkdir -p /tmp/lmcache_prometheus && exec vllm serve facebook/opt-125m --host 0.0.0.0 --port 8000"
- documentIndex: 0
notContains:
path: spec.template.spec.containers[0].command
content: "serve"

14 changes: 14 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,20 @@
"description": "The annotations to add to the deployment",
"type": "object"
},
"args": {
"description": "Optional container args for the main vLLM container. Used with command to override the default vllm serve invocation.",
"type": "array",
"items": {
"type": "string"
}
},
"command": {
"description": "Optional container command for the main vLLM container. Replaces the default vllm serve invocation.",
"type": "array",
"items": {
"type": "string"
}
},
"enableLoRA": {
"description": "Whether to enable LoRA",
"type": "boolean"
Expand Down
8 changes: 8 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ servingEngineSpec:
extraVolumeMounts: []
# - name: tmp-volume
# mountPath: /tmp
# -- Optional command for the main vLLM container. Replaces the default `vllm serve` invocation.
# command:
# - "sh"
# - "-c"
# -- Optional args for the main vLLM container. Use with command to wrap startup
# (for example mkdir before exec vllm serve).
# args:
# - "mkdir -p /tmp/lmcache_prometheus && exec vllm serve MODEL --host 0.0.0.0 --port 8000"
# -- The configuration for the init container to be run before the main container.
initContainer:
# -- The name of the init container
Expand Down