Skip to content

Commit 9200b37

Browse files
devpramodUbuntu
andauthored
Enable docsum to connect with external llm endpoints via helm (#1141)
* Enable docsum to connect with external llm endpoints via helm Signed-off-by: devpramod <pramod.pai@intel.com> * modify values yaml name Signed-off-by: Ubuntu <azureuser@denvr-inf.kifxisxbiwme5gt4kkwqsfdjuh.dx.internal.cloudapp.net> * addressed PR comment Signed-off-by: Ubuntu <azureuser@denvr-inf.kifxisxbiwme5gt4kkwqsfdjuh.dx.internal.cloudapp.net> * change host and port names for external llm env variables Signed-off-by: devpramod <pramod.pai@intel.com> * enable llm-uservice to point to external llm endpoints Signed-off-by: devpramod <pramod.pai@intel.com> * add env variable for api key in llm-uservice configmap Signed-off-by: devpramod <pramod.pai@intel.com> --------- Signed-off-by: devpramod <pramod.pai@intel.com> Signed-off-by: Ubuntu <azureuser@denvr-inf.kifxisxbiwme5gt4kkwqsfdjuh.dx.internal.cloudapp.net> Co-authored-by: Ubuntu <azureuser@denvr-inf.kifxisxbiwme5gt4kkwqsfdjuh.dx.internal.cloudapp.net>
1 parent 62ab5cc commit 9200b37

6 files changed

Lines changed: 44 additions & 1 deletion

File tree

helm-charts/common/llm-uservice/templates/configmap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ data:
7070
{{- if .Values.LLM_MODEL_ID }}
7171
LLM_MODEL_ID: {{ .Values.LLM_MODEL_ID | quote }}
7272
{{- end }}
73+
{{- if .Values.OPENAI_API_KEY }}
74+
OPENAI_API_KEY: {{ .Values.OPENAI_API_KEY | quote }}
75+
{{- end }}
7376
HF_HOME: "/tmp/.cache/huggingface"
7477
{{- if not .Values.global.offline }}
7578
HF_TOKEN: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | default .Values.global.HF_TOKEN | quote }}

helm-charts/docsum/Chart.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ dependencies:
2121
- name: llm-uservice
2222
version: 0-latest
2323
repository: "file://../common/llm-uservice"
24+
condition: llm-uservice.enabled
2425
- name: whisper
2526
version: 0-latest
2627
repository: "file://../common/whisper"
28+
condition: whisper.enabled
2729
- name: ui
2830
version: 0-latest
2931
repository: "file://../common/ui"
3032
alias: docsum-ui
33+
condition: docsum-ui.enabled
3134
- name: nginx
3235
version: 0-latest
3336
repository: "file://../common/nginx"

helm-charts/docsum/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ helm install docsum docsum --set global.HF_TOKEN=${HFTOKEN} --set global.modelUs
2626
# helm install docsum docsum --set global.HF_TOKEN=${HFTOKEN} --values docsum/rocm-values.yaml
2727
# To use AMD ROCm device with TGI
2828
# helm install docsum docsum --set global.HF_TOKEN=${HFTOKEN} --values docsum/rocm-tgi-values.yaml
29-
29+
# To use with external OpenAI-compatible LLM endpoints (OpenAI, vLLM, TGI, etc.)
30+
# This configures the llm-uservice to connect to external LLM providers while maintaining DocSum compatibility
31+
# For OpenAI:
32+
# helm install docsum docsum --values docsum/variant_external-llm-values.yaml --set llm-uservice.OPENAI_API_KEY="your-api-key" --set llm-uservice.LLM_ENDPOINT="https://api.openai.com" --set llm-uservice.LLM_MODEL_ID="gpt-4-turbo"
33+
# For vLLM/TGI or other OpenAI-compatible endpoints:
34+
# helm install docsum docsum --values docsum/variant_external-llm-values.yaml --set llm-uservice.LLM_ENDPOINT="http://your-server-url" --set llm-uservice.LLM_MODEL_ID="your-model"
3035
```
3136

3237
## Verify

helm-charts/docsum/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ spec:
3838
value: {{ include "llm-uservice.fullname" (index .Subcharts "llm-uservice") }}
3939
- name: LLM_SERVICE_PORT
4040
value: {{ index .Values "llm-uservice" "service" "port" | quote }}
41+
{{- if .Values.whisper.enabled }}
4142
- name: ASR_SERVICE_HOST_IP
4243
value: {{ include "whisper.fullname" (index .Subcharts "whisper") }}
4344
- name: ASR_SERVICE_PORT
4445
value: {{ index .Values "whisper" "service" "port" | quote }}
46+
{{- end }}
4547
securityContext:
4648
{{- toYaml .Values.securityContext | nindent 12 }}
4749
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

helm-charts/docsum/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ tolerations: []
5757
affinity: {}
5858

5959
# To override values in subchart llm-uservice
60+
# For external LLM configuration, you can override these values here or use variant_external-llm-values.yaml
61+
# Example for external OpenAI-compatible endpoints:
62+
# DOCSUM_BACKEND: "vLLM" # Use vLLM backend for OpenAI-compatible APIs
63+
# LLM_ENDPOINT: "https://api.openai.com" # External endpoint (omit /v1 suffix)
64+
# LLM_MODEL_ID: "gpt-4-turbo" # Model to use
65+
# OPENAI_API_KEY: "your-api-key" # API key for authentication
6066
llm-uservice:
67+
enabled: true
6168
image:
6269
repository: opea/llm-docsum
6370
DOCSUM_BACKEND: "vLLM"
@@ -79,6 +86,8 @@ vllm:
7986
nginx:
8087
enabled: false
8188
docsum-ui:
89+
# if false, set also nginx.enabled=false
90+
enabled: true
8291
image:
8392
repository: opea/docsum-gradio-ui
8493
tag: "latest"
@@ -101,8 +110,12 @@ docsum-ui:
101110
# type: ClusterIP
102111

103112
dashboard:
113+
enabled: true
104114
prefix: "OPEA DocSum"
105115

116+
whisper:
117+
enabled: true
118+
106119
global:
107120
http_proxy: ""
108121
https_proxy: ""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# External LLM configuration - configures llm-uservice to use external LLM providers
5+
# This keeps the llm-uservice wrapper (required for /v1/docsum endpoint) but connects it to external LLMs
6+
llm-uservice:
7+
enabled: true # Keep the wrapper service for DocSum compatibility
8+
DOCSUM_BACKEND: "vLLM" # Use vLLM backend for OpenAI-compatible APIs
9+
LLM_ENDPOINT: "https://api.openai.com" # External LLM API endpoint (omit /v1 suffix)
10+
OPENAI_API_KEY: "${OPENAI_API_KEY}" # API key for authentication
11+
LLM_MODEL_ID: "gpt-4-turbo" # Model to use
12+
13+
# Disable local inference services since we're using external LLMs
14+
vllm:
15+
enabled: false
16+
tgi:
17+
enabled: false

0 commit comments

Comments
 (0)