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: ""
|
||||
|
||||
@@ -171,6 +171,8 @@ kubectl -n hrbox exec -it deploy/hrbox-worker -- \
|
||||
| `livekit-api-secret` | `app.livekit.apiSecret` |
|
||||
| `yandex-client-password` | `app.yandex.clientPassword` |
|
||||
| `yandex-ai-api-key` | `app.ai.yandex.apiKey` |
|
||||
| `llm-api-key` | `app.ai.llm.apiKey` (если API требует ключ для чата) |
|
||||
| `llm-embedding-api-key` | `app.ai.llm.embeddingApiKey` (если API требует ключ для эмбеддингов) |
|
||||
| `google-client-secret` | `app.integrations.google.clientSecret` |
|
||||
| `slack-client-secret` | `app.slack.clientSecret` |
|
||||
| `slack-verification-token` | `app.slack.verificationToken` |
|
||||
@@ -283,6 +285,27 @@ app:
|
||||
effect: NoSchedule
|
||||
```
|
||||
|
||||
### OpenAI-совместимый API
|
||||
|
||||
Для чата и эмбеддингов можно указать свой API в `app.ai.llm`:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
ai:
|
||||
llm:
|
||||
baseUri: "https://example-endpoint.cc/v1/"
|
||||
apiKey: ""
|
||||
chatModel: "model/large"
|
||||
embeddingBaseUri: "https://example-endpoint.cc/v1/"
|
||||
embeddingApiKey: ""
|
||||
embeddingModel: "model/embedding"
|
||||
```
|
||||
|
||||
Если URL пуст, HRBox обращается к HRBox Hub. Если имя модели пустое, HRBox
|
||||
использует модель по умолчанию. Для API с авторизацией укажите ключ в
|
||||
`apiKey` / `embeddingApiKey` или добавьте его в Secret, указанный в
|
||||
`secrets.existingSecret`.
|
||||
|
||||
### Трассировка
|
||||
|
||||
```yaml
|
||||
|
||||
Reference in new issue
Block a user