Configure on-prem LLM providers through Helm values
This commit is contained in:
1 parent
1b3aed8302
commit
80877b01ec
9 files changed
+73
No files matched your search
@@ -1,4 +1,5 @@
|
||||
{{- if not .Values.secrets.existingSecret }}
|
||||
{{- $llm := .Values.app.ai.llm | default dict }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -20,6 +21,12 @@ stringData:
|
||||
livekit-api-secret: {{ .Values.app.livekit.apiSecret | quote }}
|
||||
yandex-client-password: {{ .Values.app.yandex.clientPassword | quote }}
|
||||
yandex-ai-api-key: {{ .Values.app.ai.yandex.apiKey | quote }}
|
||||
{{- with $llm.apiKey }}
|
||||
llm-api-key: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with $llm.embeddingApiKey }}
|
||||
llm-embedding-api-key: {{ . | quote }}
|
||||
{{- end }}
|
||||
google-client-secret: {{ .Values.app.integrations.google.clientSecret | quote }}
|
||||
slack-client-secret: {{ .Values.app.slack.clientSecret | quote }}
|
||||
slack-verification-token: {{ .Values.app.slack.verificationToken | quote }}
|
||||
|
||||
@@ -40,6 +40,7 @@ spec:
|
||||
containerPort: 9000
|
||||
env:
|
||||
{{- include "envs_all" . | indent 12 }}
|
||||
{{- include "envs_llm" . | indent 12 }}
|
||||
{{- include "envs_nanabush_player_signing" . | indent 12 }}
|
||||
- name: VIDEO_CONVERTER_ENABLED
|
||||
value: {{ .Values.app.videoConverter.enabled | quote }}
|
||||
|
||||
@@ -32,6 +32,7 @@ spec:
|
||||
command: ["hrbox-worker"]
|
||||
env:
|
||||
{{- include "envs_all" . | indent 12 }}
|
||||
{{- include "envs_llm" . | indent 12 }}
|
||||
- name: VIDEO_CONVERTER_ENABLED
|
||||
value: {{ .Values.app.videoConverter.enabled | quote }}
|
||||
{{- include "hrbox.resources" (dict "ctx" . "component" "worker") | indent 10 }}
|
||||
|
||||
@@ -40,6 +40,7 @@ spec:
|
||||
command: ["php", "yii", "migrate", "--interactive=0"]
|
||||
env:
|
||||
{{- include "envs_all" . | indent 12 }}
|
||||
{{- include "envs_llm" . | indent 12 }}
|
||||
{{- include "hrbox.resources" (dict "ctx" . "component" "jobs") | indent 10 }}
|
||||
volumes:
|
||||
- name: configs
|
||||
|
||||
@@ -27,4 +27,5 @@ spec:
|
||||
command: ["php", "yii", "util/update-cluster"]
|
||||
env:
|
||||
{{- include "envs_all" . | indent 12 }}
|
||||
{{- include "envs_llm" . | indent 12 }}
|
||||
{{- include "hrbox.resources" (dict "ctx" . "component" "jobs") | indent 10 }}
|
||||
@@ -314,3 +314,30 @@
|
||||
- name: OTEL_LOG_LEVEL
|
||||
value: "info"
|
||||
{{- end }}
|
||||
|
||||
{{- define "envs_llm" }}
|
||||
{{- $llm := .Values.app.ai.llm | default dict }}
|
||||
{{- $externalSecret := not (empty .Values.secrets.existingSecret) }}
|
||||
{{- with $llm.baseUri }}
|
||||
- name: LLM_BASE_URI
|
||||
value: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with $llm.chatModel }}
|
||||
- name: LLM_CHAT_MODEL
|
||||
value: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with $llm.embeddingBaseUri }}
|
||||
- name: LLM_EMBEDDING_BASE_URI
|
||||
value: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with $llm.embeddingModel }}
|
||||
- name: LLM_EMBEDDING_MODEL
|
||||
value: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- if or $llm.apiKey (and $externalSecret $llm.baseUri) }}
|
||||
{{- include "hrbox.secretEnv" (dict "ctx" . "env" "LLM_API_KEY" "key" "llm-api-key" "optional" $externalSecret) | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- if or $llm.embeddingApiKey (and $externalSecret $llm.embeddingBaseUri) }}
|
||||
{{- include "hrbox.secretEnv" (dict "ctx" . "env" "LLM_EMBEDDING_API_KEY" "key" "llm-embedding-api-key" "optional" $externalSecret) | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -74,6 +74,9 @@ imagePullSecrets:
|
||||
secretKeyRef:
|
||||
name: {{ include "hrbox.secretName" .ctx | quote }}
|
||||
key: {{ .key | quote }}
|
||||
{{- if .optional }}
|
||||
optional: true
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "nanabushPlayer.host" -}}
|
||||
|
||||
@@ -446,6 +446,15 @@ app:
|
||||
docsIndexEnabled: "true"
|
||||
semanticIndexEnabled: "true"
|
||||
semanticIndexUseBatch: "true"
|
||||
llm:
|
||||
# URL и ключ OpenAI-совместимого API для чата.
|
||||
baseUri: ""
|
||||
apiKey: ""
|
||||
chatModel: ""
|
||||
# URL и ключ OpenAI-совместимого API для эмбеддингов.
|
||||
embeddingBaseUri: ""
|
||||
embeddingApiKey: ""
|
||||
embeddingModel: ""
|
||||
yandex:
|
||||
folderId: ""
|
||||
apiKey: ""
|
||||
|
||||
Reference in new issue
Block a user