Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/source/deployment/helm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Explanation of Key Items in ``values-02-basic-config.yaml``
- ``maxModelLen``: The maximum sequence length the model can handle.
- ``dtype``: Data type for computations, e.g., ``bfloat16`` for faster performance on modern GPUs.
- ``extraArgs``: Additional arguments passed to the vLLM engine for fine-tuning behavior.
- ``modelRevision``: Hugging Face model revision (branch, tag, or commit hash) to pin the exact model version downloaded at deployment time.

- **hf_token**: The Hugging Face token for authenticating with the Hugging Face model hub.
- **env**: Extra environment variables to pass to the model-serving engine.
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/deployment-vllm-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if $modelSpec.modelRevision }}
- "--revision"
- {{ $modelSpec.modelRevision | quote }}
{{- end }}
{{- if $modelSpec.lmcacheConfig }}
{{- if $modelSpec.lmcacheConfig.enabled }}
{{- if hasKey $modelSpec.lmcacheConfig "enablePD" }}
Expand Down
3 changes: 3 additions & 0 deletions helm/templates/ray-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ data:
ARGS+=({{ . | quote }})
{{- end }}
{{- end }}
{{- if $modelSpec.modelRevision }}
ARGS+=("--revision" {{ $modelSpec.modelRevision | quote }})
{{- end }}

{{- if $modelSpec.lmcacheConfig }}
{{- if $modelSpec.lmcacheConfig.enabled }}
Expand Down
50 changes: 50 additions & 0 deletions helm/tests/deployment-vllm-multi_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,53 @@ tests:
value: "localhost"
- name: LMCACHE_P2P_INIT_PORTS
value: "30081"

- it: should pass --revision flag when modelRevision is set
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"
modelRevision: "abc123def"
asserts:
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].command
content: "--revision"
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].command
content: "abc123def"

- it: should not pass --revision flag when modelRevision is empty
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"
modelRevision: ""
asserts:
- documentIndex: 0
notContains:
path: spec.template.spec.containers[0].command
content: "--revision"
60 changes: 60 additions & 0 deletions helm/tests/ray-cluster_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -603,3 +603,63 @@ tests:
- documentIndex: 0
isNull:
path: spec.workerGroupSpecs[0].template.spec.serviceAccountName

- it: should pass --revision flag in the start script when modelRevision is set
release:
name: vllm
set:
servingEngineSpec:
enableEngine: true
modelSpec:
- name: "test-model"
repository: "vllm/vllm-openai"
tag: "latest"
modelURL: "facebook/opt-125m"
replicaCount: 1
requestCPU: 1
requestMemory: "1Gi"
requestGPU: 1
raySpec:
enabled: true
headNode:
requestCPU: 1
requestMemory: "1Gi"
requestGPU: 1
modelRevision: "abc123def"
asserts:
- documentSelector:
path: metadata.name
value: "test-model-vllm-start-script"
matchRegex:
path: data["vllm-entrypoint.sh"]
pattern: "--revision.*abc123def"

- it: should not pass --revision flag in the start script when modelRevision is empty
release:
name: vllm
set:
servingEngineSpec:
enableEngine: true
modelSpec:
- name: "test-model"
repository: "vllm/vllm-openai"
tag: "latest"
modelURL: "facebook/opt-125m"
replicaCount: 1
requestCPU: 1
requestMemory: "1Gi"
requestGPU: 1
raySpec:
enabled: true
headNode:
requestCPU: 1
requestMemory: "1Gi"
requestGPU: 1
modelRevision: ""
asserts:
- documentSelector:
path: metadata.name
value: "test-model-vllm-start-script"
notMatchRegex:
path: data["vllm-entrypoint.sh"]
pattern: "--revision"
4 changes: 4 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,10 @@
}
}
},
"modelRevision": {
"description": "Hugging Face model revision (branch, tag, or commit hash) to pin the model version",
"type": "string"
},
"modelURL": {
"description": "The URL of the model",
"type": "string"
Expand Down
2 changes: 2 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ servingEngineSpec:
imagePullSecret: ""
# -- The URL of the model
modelURL: "mistralai/Mistral-7B-Instruct-v0.2"
# -- Hugging Face model revision (branch, tag, or commit hash) to pin the model version
modelRevision: ""
# -- Chat template (Jinga2) specifying tokenizer configuration
# chatTemplate: "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ 'Question:\n' + message['content'] + '\n\n' }}{% elif message['role'] == 'system' %}\n{{ 'System:\n' + message['content'] + '\n\n' }}{% elif message['role'] == 'assistant' %}{{ 'Answer:\n' + message['content'] + '\n\n' }}{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ 'Answer:\n' }}{% endif %}{% endfor %}"
# -- The number of replicas for the model
Expand Down
Loading