Skip to content

Commit 21c248c

Browse files
committed
External LLM endpoint usage improvements + fixes
Improve/shorten/fix Helm variable names: - Consistent Helm variable naming: LLM_SERVICE/LLM_SERVER -> LLM_SERVER - Drop misleading/redundant _IP suffix: LLM_SERVER_HOST_IP -> LLM_SERVER_HOST (Helm variables do not need to duplicate naming problems in OPEA applications.) Add: - Examples on using OPEA KubeAI installation as external LLM - LLM_SERVER_PORT setting to everywhere LLM_SERVER_HOST is set - Comment that NGIX needs to be disabled if UI/data-prep is disabled [1] - Missing HF_TOKEN settings to external LLM usage examples - Missing Ollama disabling [2] Otherwise Helm fails to parse NGINX template file. Helm would fail also on "if .Values.data-prep.enabled" in that file, due to '-' in the component name, so best seemed just to add comment about the dependency. Signed-off-by: Eero Tamminen <[email protected]>
1 parent fc68528 commit 21c248c

File tree

8 files changed

+27
-13
lines changed

8 files changed

+27
-13
lines changed

helm-charts/chatqna/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ helm install chatqna chatqna --set global.HF_TOKEN=${HFTOKEN} --set global.model
4545
# To use AMD ROCm device with TGI
4646
#helm install chatqna chatqna --set global.HF_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set tgi.LLM_MODEL_ID=${MODELNAME} -f chatqna/rocm-tgi-values.yaml
4747

48-
# To use with external OpenAI compatible LLM endpoint
49-
#helm install chatqna chatqna -f chatqna/variant_external-llm-values.yaml --set global.HF_TOKEN=${HFTOKEN} --set externalLLM.LLM_SERVER_HOST_IP="http://your-llm-server" --set externalLLM.LLM_MODEL="your-model" --set externalLLM.OPENAI_API_KEY="your-api-key"
48+
# To use with OPEA KubeAI LLM models installed to same cluster
49+
#helm install chatqna chatqna -f chatqna/variant_external-llm-values.yaml --set global.HF_TOKEN=${HFTOKEN} --set externalLLM.LLM_MODEL="your-model" --set externalLLM.LLM_SERVER_HOST="http://kubeai.kubeai/openai" --set externalLLM.LLM_SERVER_PORT="" --set externalLLM.OPENAI_API_KEY="your-api-key"
50+
# To use with other external OpenAI compatible LLM endpoints
51+
#helm install chatqna chatqna -f chatqna/variant_external-llm-values.yaml --set global.HF_TOKEN=${HFTOKEN} --set externalLLM.LLM_MODEL="your-model" --set externalLLM.LLM_SERVER_HOST="http://your-llm-server" --set externalLLM.LLM_SERVER_PORT="80" --set externalLLM.OPENAI_API_KEY="your-api-key"
5052

5153
# To deploy FaqGen
5254
#helm install faqgen chatqna --set global.HF_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} -f chatqna/faqgen-cpu-values.yaml

helm-charts/chatqna/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
{{- else if .Values.tgi.enabled }}
4646
value: {{ .Release.Name }}-tgi
4747
{{- else if .Values.externalLLM.enabled }}
48-
value: {{ .Values.externalLLM.LLM_SERVER_HOST_IP }}
48+
value: {{ .Values.externalLLM.LLM_SERVER_HOST }}
4949
{{- else }}
5050
{{- fail "ChatQnA needs a LLM inference backend!" }}
5151
{{- end }}

helm-charts/chatqna/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ vllm:
7575
shmSize: 128Gi
7676
VLLM_TORCH_PROFILER_DIR: "/tmp/vllm_profile"
7777
data-prep:
78+
# if set to false, need to set also nginx.enabled=false
7879
enabled: true
7980
# the following are for redis-vector-db
8081
DATAPREP_BACKEND: "REDIS"
@@ -162,6 +163,7 @@ nginx:
162163

163164
# UI configuration
164165
chatqna-ui:
166+
# if set to false, need to set also nginx.enabled=false
165167
enabled: true
166168
image:
167169
repository: opea/chatqna-ui
@@ -174,7 +176,8 @@ dashboard:
174176
# External LLM configuration
175177
externalLLM:
176178
enabled: false
177-
LLM_SERVICE_HOST_IP: "http://your-llm-server"
179+
LLM_SERVER_HOST: "http://your-llm-server"
180+
LLM_SERVER_PORT: "80"
178181
LLM_MODEL: "your-model"
179182
OPENAI_API_KEY: "your-api-key"
180183

helm-charts/chatqna/variant_external-llm-values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# External LLM configuration override
55
externalLLM:
66
enabled: true # Enable external LLM service
7-
LLM_SERVER_HOST_IP: "http://your-llm-server" # External LLM service host
7+
LLM_SERVER_HOST: "http://your-llm-server" # External LLM service host
8+
LLM_SERVER_PORT: "80" # Port for the external LLM service
89
LLM_MODEL: "your-model" # LLM model to use
910
OPENAI_API_KEY: "your-api-key" # OpenAI API key for authentication
10-
LLM_SERVER_PORT: "80" # Port for the external LLM service
1111

1212
# Disable internal LLM services when using external LLM
1313
llm-uservice:
@@ -18,3 +18,6 @@ vllm:
1818

1919
tgi:
2020
enabled: false
21+
22+
ollama:
23+
enabled: false

helm-charts/codegen/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ helm install codegen codegen --set global.HF_TOKEN=${HFTOKEN} --set global.model
3232
# helm install codegen codegen --set global.HF_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set llm-uservcie.LLM_MODEL_ID=${MODELNAME} --set tgi.LLM_MODEL_ID=${MODELNAME} -f codegen/gaudi-tgi-values.yaml
3333
# To use AMD ROCm device with vLLM
3434
# helm install codegen codegen --set global.HF_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set llm-uservcie.LLM_MODEL_ID=${MODELNAME} --set vllm.LLM_MODEL_ID=${MODELNAME} -f codegen/rocm-values.yaml
35-
# To use with external OpenAI compatible LLM endpoint
36-
# helm install codegen codegen -f codegen/variant_external-llm-values.yaml --set externalLLM.LLM_SERVER_HOST_IP="http://your-llm-server" --set externalLLM.LLM_MODEL="your-model" --set externalLLM.OPENAI_API_KEY="your-api-key"
35+
36+
# To use with OPEA KubeAI LLM models installed to same cluster
37+
# helm install codegen codegen -f codegen/variant_external-llm-values.yaml --set global.HF_TOKEN=${HFTOKEN} --set externalLLM.LLM_MODEL="your-kubeai-model" --set externalLLM.LLM_SERVER_HOST="http://kubeai.kubeai/openai" --set externalLLM.LLM_SERVER_PORT="" --set externalLLM.OPENAI_API_KEY=""
38+
# To use with other external OpenAI compatible LLM endpoints
39+
# helm install codegen codegen -f codegen/variant_external-llm-values.yaml --set global.HF_TOKEN=${HFTOKEN} --set externalLLM.LLM_MODEL="your-model" --set externalLLM.LLM_SERVER_HOST="http://your-llm-server" --set externalLLM.LLM_SERVER_PORT="80" --set externalLLM.OPENAI_API_KEY="your-api-key"
3740
```
3841

3942
### IMPORTANT NOTE

helm-charts/codegen/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ spec:
3636
env:
3737
- name: LLM_SERVICE_HOST_IP
3838
{{- if .Values.externalLLM.enabled }}
39-
value: {{ .Values.externalLLM.LLM_SERVICE_HOST_IP }}
39+
value: {{ .Values.externalLLM.LLM_SERVER_HOST }}
4040
{{- else }}
4141
value: {{ include "llm-uservice.fullname" (index .Subcharts "llm-uservice") | quote }}
4242
{{- end }}
4343
- name: LLM_SERVICE_PORT
4444
{{- if .Values.externalLLM.enabled }}
45-
value: {{ .Values.externalLLM.LLM_SERVICE_PORT | default "80" | quote }}
45+
value: {{ .Values.externalLLM.LLM_SERVER_PORT | default "80" | quote }}
4646
{{- else }}
4747
value: {{ index .Values "llm-uservice" "service" "port" | quote }}
4848
{{- end }}

helm-charts/codegen/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ redis-vector-db:
7777
enabled: true
7878

7979
data-prep:
80+
# if set to false, need to set also nginx.enabled=false
8081
enabled: true
8182
# the following are for redis-vector-db
8283
DATAPREP_BACKEND: "REDIS"
@@ -94,6 +95,7 @@ embedding-usvc:
9495
nginx:
9596
enabled: false
9697
codegen-ui:
98+
# if set to false, need to set also nginx.enabled=false
9799
enabled: true
98100
image:
99101
repository: opea/codegen-gradio-ui
@@ -119,7 +121,8 @@ codegen-ui:
119121
# External LLM configuration
120122
externalLLM:
121123
enabled: false
122-
LLM_SERVICE_HOST_IP: "http://your-llm-server"
124+
LLM_SERVER_HOST: "http://your-llm-server"
125+
LLM_SERVER_PORT: "80"
123126
LLM_MODEL_ID: "your-model"
124127
OPENAI_API_KEY: "your-api-key"
125128

helm-charts/codegen/variant_external-llm-values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# External LLM configuration
55
externalLLM:
66
enabled: true # Enable external LLM service
7-
LLM_SERVICE_HOST_IP: "http://your-llm-server" # External LLM service host
7+
LLM_SERVER_HOST: "http://your-llm-server" # External LLM service host
8+
LLM_SERVER_PORT: "80" # Port for the external LLM service
89
LLM_MODEL_ID: "your-model" # LLM model to use
910
OPENAI_API_KEY: "your-api-key" # OpenAI API key for authentication
10-
LLM_SERVER_PORT: "80" # Port for the external LLM service
1111

1212
# Disable internal LLM services when using external LLM
1313
tgi:

0 commit comments

Comments
 (0)