diff --git a/helm-charts/chatqna/Chart.yaml b/helm-charts/chatqna/Chart.yaml index 7bc2c3499..a13311ca8 100644 --- a/helm-charts/chatqna/Chart.yaml +++ b/helm-charts/chatqna/Chart.yaml @@ -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" @@ -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 - name: nginx version: 0-latest repository: "file://../common/nginx" + condition: nginx.enabled version: 0-latest appVersion: "v1.0" diff --git a/helm-charts/chatqna/README.md b/helm-charts/chatqna/README.md index 1daa9809b..ba478c016 100644 --- a/helm-charts/chatqna/README.md +++ b/helm-charts/chatqna/README.md @@ -45,6 +45,9 @@ helm install chatqna chatqna --set global.HF_TOKEN=${HFTOKEN} --set global.model # To use AMD ROCm device with TGI #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 +# 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" + # To deploy FaqGen #helm install faqgen chatqna --set global.HF_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} -f chatqna/faqgen-cpu-values.yaml diff --git a/helm-charts/chatqna/templates/deployment.yaml b/helm-charts/chatqna/templates/deployment.yaml index 22fdbff13..97b94904a 100644 --- a/helm-charts/chatqna/templates/deployment.yaml +++ b/helm-charts/chatqna/templates/deployment.yaml @@ -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 diff --git a/helm-charts/chatqna/templates/nginx.yaml b/helm-charts/chatqna/templates/nginx.yaml index 2fa0feb8e..e84f38bb8 100644 --- a/helm-charts/chatqna/templates/nginx.yaml +++ b/helm-charts/chatqna/templates/nginx.yaml @@ -1,6 +1,7 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +{{- if .Values.nginx.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -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 }} diff --git a/helm-charts/chatqna/values.yaml b/helm-charts/chatqna/values.yaml index 35eb22e8b..bd6fd0fda 100644 --- a/helm-charts/chatqna/values.yaml +++ b/helm-charts/chatqna/values.yaml @@ -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" @@ -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" @@ -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: @@ -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" @@ -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: "" diff --git a/helm-charts/chatqna/variant_external-llm-values.yaml b/helm-charts/chatqna/variant_external-llm-values.yaml new file mode 100644 index 000000000..79f996382 --- /dev/null +++ b/helm-charts/chatqna/variant_external-llm-values.yaml @@ -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 diff --git a/helm-charts/codegen/Chart.yaml b/helm-charts/codegen/Chart.yaml index 150497274..5f2b41647 100644 --- a/helm-charts/codegen/Chart.yaml +++ b/helm-charts/codegen/Chart.yaml @@ -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 - name: nginx version: 0-latest repository: "file://../common/nginx" diff --git a/helm-charts/codegen/README.md b/helm-charts/codegen/README.md index 3debcd09e..4cc6897e4 100644 --- a/helm-charts/codegen/README.md +++ b/helm-charts/codegen/README.md @@ -32,9 +32,8 @@ helm install codegen codegen --set global.HF_TOKEN=${HFTOKEN} --set global.model # 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 # To use AMD ROCm device with vLLM # 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 -# To use AMD ROCm device with TGI -# 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/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" ``` ### IMPORTANT NOTE diff --git a/helm-charts/codegen/templates/deployment.yaml b/helm-charts/codegen/templates/deployment.yaml index e3a5d305b..881d632e8 100644 --- a/helm-charts/codegen/templates/deployment.yaml +++ b/helm-charts/codegen/templates/deployment.yaml @@ -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 }}" diff --git a/helm-charts/codegen/templates/ui-nginx.yaml b/helm-charts/codegen/templates/ui-nginx.yaml index 1ed888414..b14598588 100644 --- a/helm-charts/codegen/templates/ui-nginx.yaml +++ b/helm-charts/codegen/templates/ui-nginx.yaml @@ -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 }} diff --git a/helm-charts/codegen/values.yaml b/helm-charts/codegen/values.yaml index a751d1e3b..75ece38d1 100644 --- a/helm-charts/codegen/values.yaml +++ b/helm-charts/codegen/values.yaml @@ -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" @@ -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: "" diff --git a/helm-charts/codegen/variant_external-llm-values.yaml b/helm-charts/codegen/variant_external-llm-values.yaml new file mode 100644 index 000000000..190f21e38 --- /dev/null +++ b/helm-charts/codegen/variant_external-llm-values.yaml @@ -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 diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index 7541927a9..50822ba3f 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -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 }} diff --git a/helm-charts/common/ui/variant_productivity_suite-values.yaml b/helm-charts/common/ui/variant_productivity_suite-values.yaml new file mode 100644 index 000000000..621a13913 --- /dev/null +++ b/helm-charts/common/ui/variant_productivity_suite-values.yaml @@ -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"