Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
587db38
Add support for external OpenAI-compatible LLM endpoints with conditi…
devpramod Apr 14, 2025
b53e498
merge changes in readme
devpramod Apr 14, 2025
3d9a276
Merge readme changes for docsum helm chart readme
devpramod Apr 14, 2025
ca216f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 14, 2025
82d8ae4
Add default externalLLM values and include productivity suite changes…
devpramod Apr 16, 2025
42e5e08
Enable llm-uservice, data-prep, retriever-usvc, embedding-usvc, and c…
devpramod Apr 17, 2025
0c78cd9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 17, 2025
b41d6cc
Refactor Helm chart templates to simplify conditional checks for exte…
devpramod Apr 21, 2025
0362d65
Refactor external LLM configuration checks in Helm charts; simplify c…
devpramod Apr 23, 2025
f361956
remove unnecessary conditional checks for LLM, fix indentation
devpramod Apr 25, 2025
3813ff5
move optional external llm configmap to after default env variables t…
devpramod Apr 28, 2025
f16d6fb
Enhance LLM environment variable configuration in deployment.yaml; ad…
devpramod May 13, 2025
057fac1
refactor: replace external LLM ConfigMaps with direct environment var…
devpramod May 20, 2025
8b1b207
feat: add LLM_SERVER_PORT to external LLM configuration across multip…
devpramod May 27, 2025
3e57f52
revert the changes for docsum to main state
devpramod Jul 1, 2025
5894ba0
for codegen - update LLM_MODEL -> LLM_MODEL_ID
devpramod Jul 1, 2025
509815c
Merge branch 'main' into helm-external-llm
poussa Jul 3, 2025
1a00ed2
Merge branch 'main' into helm-external-llm
lianhao Jul 4, 2025
273fa44
change llm yaml files to bypass remote endpoint CI testing before end…
louie-tsai Jul 4, 2025
6d20fca
Merge branch 'main' into helm-external-llm
poussa Jul 4, 2025
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
5 changes: 5 additions & 0 deletions helm-charts/chatqna/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies:
- name: tei
version: 0-latest
repository: "file://../common/tei"
condition: tei.enabled
- name: embedding-usvc
version: 0-latest
repository: "file://../common/embedding-usvc"
Expand Down Expand Up @@ -65,15 +66,19 @@ dependencies:
- name: retriever-usvc
version: 0-latest
repository: "file://../common/retriever-usvc"
condition: retriever-usvc.enabled
- name: data-prep
version: 0-latest
repository: "file://../common/data-prep"
condition: data-prep.enabled
- name: ui
alias: chatqna-ui
version: 0-latest
repository: "file://../common/ui"
condition: chatqna-ui.enabled
Comment on lines +73 to +78
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling either data-prep or chatqna-ui means that Helm fails parsing the ChatQnA NGINX template: https://github.com/opea-project/GenAIInfra/blob/main/helm-charts/chatqna/templates/nginx.yaml

(Because their names have dashes, Helm does not understand if one adds ifs to the template for them being enabled.)

- name: nginx
version: 0-latest
repository: "file://../common/nginx"
condition: nginx.enabled
version: 0-latest
appVersion: "v1.0"
3 changes: 3 additions & 0 deletions helm-charts/chatqna/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ helm install chatqna chatqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --
# To use AMD ROCm device with TGI
#helm install chatqna chatqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set tgi.LLM_MODEL_ID=${MODELNAME} -f chatqna/rocm-tgi-values.yaml

# To use with external OpenAI compatible LLM endpoint
#helm install chatqna chatqna -f chatqna/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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the file name external-llm-values.yaml accordingly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poussa already did a merge, so I added separate #1153 PR to fix the value file names.


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

Expand Down
22 changes: 18 additions & 4 deletions helm-charts/chatqna/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,40 @@ spec:
- name: {{ .Release.Name }}
env:
- name: LLM_SERVER_HOST_IP
# For FaqGen, llm-uservice is used.
{{- if eq .Values.CHATQNA_TYPE "CHATQNA_FAQGEN"}}
# For FaqGen, llm-uservice is used
{{- if eq .Values.CHATQNA_TYPE "CHATQNA_FAQGEN" }}
value: {{ .Release.Name }}-llm-uservice
{{- else if .Values.ollama.enabled }}
value: {{ .Release.Name }}-ollama
{{- else if .Values.vllm.enabled }}
value: {{ .Release.Name }}-vllm
{{- else }}
{{- else if .Values.tgi.enabled }}
value: {{ .Release.Name }}-tgi
{{- else if .Values.externalLLM.enabled }}
value: {{ .Values.externalLLM.LLM_SERVER_HOST_IP }}
{{- else }}
{{- fail "ChatQnA needs a LLM inference backend!" }}
{{- end }}
- name: LLM_SERVER_PORT
{{- if .Values.externalLLM.enabled }}
value: {{ .Values.externalLLM.LLM_SERVER_PORT | default "80" | quote }}
{{- else }}
value: "80"
{{- end }}
- name: LLM_MODEL
{{- if .Values.ollama.enabled }}
value: {{ .Values.ollama.LLM_MODEL_ID | quote }}
{{- else if .Values.vllm.enabled }}
value: {{ .Values.vllm.LLM_MODEL_ID | quote }}
{{- else }}
{{- else if .Values.tgi.enabled }}
value: {{ .Values.tgi.LLM_MODEL_ID | quote }}
{{- else if .Values.externalLLM.enabled }}
value: {{ .Values.externalLLM.LLM_MODEL }}
{{- end }}
{{- if .Values.externalLLM.enabled }}
- name: OPENAI_API_KEY
value: {{ .Values.externalLLM.OPENAI_API_KEY }}
{{- end }}
- name: RERANK_SERVER_HOST_IP
value: {{ .Release.Name }}-teirerank
- name: RERANK_SERVER_PORT
Expand Down
2 changes: 2 additions & 0 deletions helm-charts/chatqna/templates/nginx.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.nginx.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -15,3 +16,4 @@ data:
BACKEND_SERVICE_PORT: {{ .Values.service.port | quote }}
DATAPREP_SERVICE_IP: {{ include "data-prep.fullname" (index .Subcharts "data-prep") | quote }}
DATAPREP_SERVICE_PORT: {{ index .Values "data-prep" "service" "port" | quote }}
{{- end }}
17 changes: 16 additions & 1 deletion helm-charts/chatqna/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ vllm:
shmSize: 128Gi
VLLM_TORCH_PROFILER_DIR: "/tmp/vllm_profile"
data-prep:
enabled: true
# the following are for redis-vector-db
DATAPREP_BACKEND: "REDIS"
INDEX_NAME: "rag-redis"
Expand All @@ -84,6 +85,7 @@ data-prep:
# the following are for milvus db
MILVUS_PORT: 19530
retriever-usvc:
enabled: true
# the following are for redis-vector-db
RETRIEVER_BACKEND: "REDIS"
INDEX_NAME: "rag-redis"
Expand All @@ -105,6 +107,10 @@ vllm-guardrails:
teirerank:
enabled: true

# Text embedding inference service
tei:
enabled: true

# vector db choice
# redis by default.
redis-vector-db:
Expand Down Expand Up @@ -150,11 +156,13 @@ reranking-usvc:
RERANK_BACKEND: "TEI"

nginx:
enabled: true
service:
type: NodePort

# Uncomment the following lines
# UI configuration
chatqna-ui:
enabled: true
image:
repository: opea/chatqna-ui
tag: "latest"
Expand All @@ -163,6 +171,13 @@ chatqna-ui:
dashboard:
prefix: "OPEA ChatQnA"

# External LLM configuration
externalLLM:
enabled: false
LLM_SERVICE_HOST_IP: "http://your-llm-server"
LLM_MODEL: "your-model"
OPENAI_API_KEY: "your-api-key"

global:
http_proxy: ""
https_proxy: ""
Expand Down
20 changes: 20 additions & 0 deletions helm-charts/chatqna/variant_external-llm-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# External LLM configuration override
externalLLM:
enabled: true # Enable external LLM service
LLM_SERVER_HOST_IP: "http://your-llm-server" # External LLM service host
LLM_MODEL: "your-model" # LLM model to use
OPENAI_API_KEY: "your-api-key" # OpenAI API key for authentication
LLM_SERVER_PORT: "80" # Port for the external LLM service

# Disable internal LLM services when using external LLM
llm-uservice:
enabled: false

vllm:
enabled: false

tgi:
enabled: false
Comment on lines +12 to +20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing:

ollama:
  enabled: false

7 changes: 7 additions & 0 deletions helm-charts/codegen/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,32 @@ dependencies:
- name: llm-uservice
version: 0-latest
repository: "file://../common/llm-uservice"
condition: llm-uservice.enabled
- name: tei
version: 0-latest
repository: "file://../common/tei"
condition: tei.enabled
- name: embedding-usvc
version: 0-latest
repository: "file://../common/embedding-usvc"
condition: embedding-usvc.enabled
- name: redis-vector-db
version: 0-latest
repository: "file://../common/redis-vector-db"
condition: redis-vector-db.enabled
- name: retriever-usvc
version: 0-latest
repository: "file://../common/retriever-usvc"
condition: retriever-usvc.enabled
- name: data-prep
version: 0-latest
repository: "file://../common/data-prep"
condition: data-prep.enabled
- name: ui
version: 0-latest
repository: "file://../common/ui"
alias: codegen-ui
condition: codegen-ui.enabled
Comment on lines +40 to +45
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling either data-prep or codegen-ui means that Helm fails parsing the CodeGen NGINX template:
https://github.com/opea-project/GenAIInfra/blob/main/helm-charts/codegen/templates/ui-nginx.yaml

- name: nginx
version: 0-latest
repository: "file://../common/nginx"
Expand Down
3 changes: 2 additions & 1 deletion helm-charts/codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ helm install codegen codegen --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --
# helm install codegen codegen --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set llm-uservcie.LLM_MODEL_ID=${MODELNAME} --set vllm.LLM_MODEL_ID=${MODELNAME} -f codegen/rocm-values.yaml
# To use AMD ROCm device with TGI
# helm install codegen codegen --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set llm-uservcie.LLM_MODEL_ID=${MODELNAME} --set tgi.LLM_MODEL_ID=${MODELNAME} -f codegen/rocm-tgi-values.yaml

# To use with external OpenAI compatible LLM endpoint
# helm install codegen codegen -f codegen/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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the file name external-llm-values.yaml accordingly

```

### IMPORTANT NOTE
Expand Down
18 changes: 18 additions & 0 deletions helm-charts/codegen/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,35 @@ spec:
- name: {{ .Release.Name }}
env:
- name: LLM_SERVICE_HOST_IP
{{- if .Values.externalLLM.enabled }}
value: {{ .Values.externalLLM.LLM_SERVICE_HOST_IP }}
{{- else }}
value: {{ include "llm-uservice.fullname" (index .Subcharts "llm-uservice") | quote }}
{{- end }}
- name: LLM_SERVICE_PORT
{{- if .Values.externalLLM.enabled }}
value: {{ .Values.externalLLM.LLM_SERVICE_PORT | default "80" | quote }}
{{- else }}
value: {{ index .Values "llm-uservice" "service" "port" | quote }}
{{- end }}
{{- if .Values.externalLLM.enabled }}
- name: LLM_MODEL_ID
value: {{ .Values.externalLLM.LLM_MODEL_ID }}
- name: OPENAI_API_KEY
value: {{ .Values.externalLLM.OPENAI_API_KEY }}
{{- end }}
{{- if index .Values "retriever-usvc" "enabled" }}
- name: RETRIEVAL_SERVICE_HOST_IP
value: {{ include "retriever-usvc.fullname" (index .Subcharts "retriever-usvc") | quote }}
- name: REDIS_RETRIEVER_PORT
value: {{ index .Values "retriever-usvc" "service" "port" | quote }}
{{- end }}
{{- if index .Values "embedding-usvc" "enabled" }}
- name: TEI_EMBEDDING_HOST_IP
value: {{ include "embedding-usvc.fullname" (index .Subcharts "embedding-usvc") | quote }}
- name: EMBEDDER_PORT
value: {{ index .Values "embedding-usvc" "service" "port" | quote }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/codegen/templates/ui-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ metadata:
labels:
{{- include "codegen.labels" . | nindent 4 }}
data:
{{- if (index .Values "data-prep" "enabled") }}
DATAPREP_ENDPOINT: {{ (printf "http://%s:%s/v1/dataprep" (include "data-prep.fullname" (index .Subcharts "data-prep")) (toString (index .Values "data-prep" "service" "port"))) | quote }}
{{- end }}
BACKEND_SERVICE_ENDPOINT: {{ (printf "http://%s:%s/v1/codegen" (include "codegen.fullname" .) (toString .Values.service.port)) | quote }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if or .Values.global.http_proxy .Values.global.https_proxy }}
{{- if (index .Values "data-prep" "enabled") }}
no_proxy: {{ (printf "%s,%s,%s" (include "codegen.fullname" .) (include "data-prep.fullname" (index .Subcharts "data-prep")) .Values.global.no_proxy) | quote }}
{{- else }}
no_proxy: {{ (printf "%s,%s" (include "codegen.fullname" .) (.Values.global.no_proxy)) | quote }}
{{- end }}
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions helm-charts/codegen/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,35 @@ vllm:
LLM_MODEL_ID: Qwen/Qwen2.5-Coder-7B-Instruct

llm-uservice:
enabled: true
TEXTGEN_BACKEND: vLLM
LLM_MODEL_ID: Qwen/Qwen2.5-Coder-7B-Instruct

tei:
enabled: true

redis-vector-db:
enabled: true

data-prep:
enabled: true
# the following are for redis-vector-db
DATAPREP_BACKEND: "REDIS"
INDEX_NAME: "CodeGen"
retriever-usvc:
enabled: true
# the following are for redis-vector-db
RETRIEVER_BACKEND: "REDIS"
INDEX_NAME: "CodeGen"
embedding-usvc:
enabled: true
EMBEDDING_BACKEND: "TEI"

# Use codegen gradio UI
nginx:
enabled: false
codegen-ui:
enabled: true
image:
repository: opea/codegen-gradio-ui
tag: "latest"
Expand All @@ -105,6 +116,13 @@ codegen-ui:
# service:
# type: ClusterIP

# External LLM configuration
externalLLM:
enabled: false
LLM_SERVICE_HOST_IP: "http://your-llm-server"
LLM_MODEL_ID: "your-model"
OPENAI_API_KEY: "your-api-key"

global:
http_proxy: ""
https_proxy: ""
Expand Down
18 changes: 18 additions & 0 deletions helm-charts/codegen/variant_external-llm-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# External LLM configuration
externalLLM:
enabled: true # Enable external LLM service
LLM_SERVICE_HOST_IP: "http://your-llm-server" # External LLM service host
LLM_MODEL_ID: "your-model" # LLM model to use
OPENAI_API_KEY: "your-api-key" # OpenAI API key for authentication
LLM_SERVER_PORT: "80" # Port for the external LLM service

# Disable internal LLM services when using external LLM
tgi:
enabled: false
vllm:
enabled: false
llm-uservice:
enabled: false
14 changes: 14 additions & 0 deletions helm-charts/common/ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,18 @@ data:
BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }}
{{- else if contains "agent-ui" .Values.image.repository }}
AGENT_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }}
{{- else if contains "productivity-suite-react-ui-server" .Values.image.repository }}
APP_BACKEND_SERVICE_ENDPOINT_CHATQNA: {{ .Values.APP_BACKEND_SERVICE_ENDPOINT_CHATQNA | quote }}
APP_DATAPREP_DELETE_FILE_ENDPOINT: {{ .Values.APP_DATAPREP_DELETE_FILE_ENDPOINT | quote }}
APP_BACKEND_SERVICE_ENDPOINT_CODEGEN: {{ .Values.APP_BACKEND_SERVICE_ENDPOINT_CODEGEN | quote }}
APP_BACKEND_SERVICE_ENDPOINT_DOCSUM: {{ .Values.APP_BACKEND_SERVICE_ENDPOINT_DOCSUM | quote }}
APP_DATAPREP_SERVICE_ENDPOINT: {{ .Values.APP_DATAPREP_SERVICE_ENDPOINT | quote }}
APP_DATAPREP_GET_FILE_ENDPOINT: {{ .Values.APP_DATAPREP_GET_FILE_ENDPOINT | quote }}
APP_CHAT_HISTORY_CREATE_ENDPOINT: {{ .Values.APP_CHAT_HISTORY_CREATE_ENDPOINT | quote }}
APP_CHAT_HISTORY_DELETE_ENDPOINT: {{ .Values.APP_CHAT_HISTORY_DELETE_ENDPOINT | quote }}
APP_CHAT_HISTORY_GET_ENDPOINT: {{ .Values.APP_CHAT_HISTORY_GET_ENDPOINT | quote }}
APP_PROMPT_SERVICE_GET_ENDPOINT: {{ .Values.APP_PROMPT_SERVICE_GET_ENDPOINT | quote }}
APP_PROMPT_SERVICE_CREATE_ENDPOINT: {{ .Values.APP_PROMPT_SERVICE_CREATE_ENDPOINT | quote }}
APP_PROMPT_SERVICE_DELETE_ENDPOINT: {{ .Values.APP_PROMPT_SERVICE_DELETE_ENDPOINT | quote }}
APP_KEYCLOAK_SERVICE_ENDPOINT: {{ .Values.APP_KEYCLOAK_SERVICE_ENDPOINT | quote }}
{{- end }}
21 changes: 21 additions & 0 deletions helm-charts/common/ui/variant_productivity_suite-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/productivity-suite-react-ui-server
tag: "latest"

containerPort: 5173
APP_BACKEND_SERVICE_ENDPOINT_CHATQNA: "/v1/chatqna"
APP_DATAPREP_DELETE_FILE_ENDPOINT: "/v1/dataprep/delete"
APP_BACKEND_SERVICE_ENDPOINT_CODEGEN: "/v1/codegen"
APP_BACKEND_SERVICE_ENDPOINT_DOCSUM: "/v1/docsum"
APP_DATAPREP_SERVICE_ENDPOINT: "/v1/dataprep/ingest"
APP_DATAPREP_GET_FILE_ENDPOINT: "/v1/dataprep/get"
APP_CHAT_HISTORY_CREATE_ENDPOINT: "/v1/chathistory/create"
APP_CHAT_HISTORY_DELETE_ENDPOINT: "/v1/chathistory/delete"
APP_CHAT_HISTORY_GET_ENDPOINT: "/v1/chathistory/get"
APP_PROMPT_SERVICE_GET_ENDPOINT: "/v1/prompt/get"
APP_PROMPT_SERVICE_CREATE_ENDPOINT: "/v1/prompt/create"
APP_PROMPT_SERVICE_DELETE_ENDPOINT: "/v1/prompt/delete"
APP_KEYCLOAK_SERVICE_ENDPOINT: "/auth"