-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
Error
Pod is missing the environment variables OPENAI_API_BASE_URLS and OPENAI_API_KEYS even though the variables openaiBaseApiUrls and openaiApiKeys are configured in the Helm release.
Reproduce
I use the following values in my Helm release config:
openaiBaseApiUrls:
- abc
- def
openaiApiKeys:
- abc
- def
pipelines:
enabled: falseThe resulting pod has no OPENAI_* environment variables. ENABLE_OPENAI_API is also missing.
Reason
As far as I understand, this is the result of the workload-manager.yaml not expecting to have pipelines turned off when using multiple APIs. The case
pipelines.enabled: false
enableOpenaiApi: true
openaiBaseApiUrls: ['anything']
openaiApiKeys: ['anything']is not handled in this piece of code:
{{- if and .Values.enableOpenaiApi .Values.openaiBaseApiUrl (not .Values.openaiBaseApiUrls) (not .Values.pipelines.enabled) }}
# If only an OpenAI API value is set, set it to OPENAI_API_BASE_URL
- name: "OPENAI_API_BASE_URL"
value: {{ .Values.openaiBaseApiUrl | quote }}
{{- if .Values.openaiApiKey }}
- name: "OPENAI_API_KEY"
value: {{ .Values.openaiApiKey | quote }}
{{- end }}
{{- else if and .Values.enableOpenaiApi .Values.openaiBaseApiUrl .Values.pipelines.enabled (not .Values.openaiBaseApiUrls) }}
# If Pipelines is enabled and OpenAI API value is set, use OPENAI_API_BASE_URLS with combined values
- name: "OPENAI_API_BASE_URLS"
value: "{{ include "pipelines.serviceEndpoint" . }};{{ .Values.openaiBaseApiUrl }}"
{{- if .Values.openaiApiKeys }}
- name: "OPENAI_API_KEYS"
value: {{ .Values.openaiApiKeys | join ";" | quote }}
{{- end }}
{{- else if and .Values.enableOpenaiApi .Values.pipelines.enabled (not .Values.openaiBaseApiUrl) (not .Values.openaiBaseApiUrls) }}
# If Pipelines is enabled and no OpenAI API values are set, set OPENAI_API_BASE_URL to the Pipelines server endpoint
- name: "OPENAI_API_BASE_URL"
value: {{ include "pipelines.serviceEndpoint" . | quote }}
{{- if .Values.openaiApiKey }}
- name: "OPENAI_API_KEY"
value: {{ .Values.openaiApiKey | quote }}
{{- end }}
{{- else if and .Values.enableOpenaiApi .Values.openaiBaseApiUrls .Values.pipelines.enabled }}
# If OpenAI API value(s) set and Pipelines is enabled, use OPENAI_API_BASE_URLS to support all the endpoints in the chart
- name: "OPENAI_API_BASE_URLS"
value: "{{ include "pipelines.serviceEndpoint" . }};{{ join ";" .Values.openaiBaseApiUrls }}"
{{- if .Values.openaiApiKeys }}
- name: "OPENAI_API_KEYS"
value: {{ .Values.openaiApiKeys | join ";" | quote }}
{{- end }}
{{- else if not .Values.enableOpenaiApi }}
- name: "ENABLE_OPENAI_API"
value: "False"
{{- end }}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels