mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
Merge 9929ba7d91 into 938ff6c90f
This commit is contained in:
commit
380553dcfc
6 changed files with 130 additions and 0 deletions
|
|
@ -311,6 +311,10 @@ and the same spend transaction buffer.
|
|||
- name: LITELLM_LOG
|
||||
value: {{ .Values.logLevel | quote }}
|
||||
{{- end }}
|
||||
{{- if and (not (kindIs "invalid" .Values.rustGateway.enabled)) (not (hasKey (default dict .Values.envVars) "LITELLM_RUST")) }}
|
||||
- name: LITELLM_RUST
|
||||
value: {{ .Values.rustGateway.enabled | toString | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.envVars }}
|
||||
{{- range $key, $val := .Values.envVars }}
|
||||
- name: {{ $key }}
|
||||
|
|
|
|||
52
helm/litellm-helm/tests/rust_gateway_tests.yaml
Normal file
52
helm/litellm-helm/tests/rust_gateway_tests.yaml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
suite: Rust forwarding gateway
|
||||
templates:
|
||||
- deployment.yaml
|
||||
- configmap-litellm.yaml
|
||||
tests:
|
||||
- it: leaves the image default in place when unset
|
||||
template: deployment.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
any: true
|
||||
- it: turns forwarding off explicitly
|
||||
template: deployment.yaml
|
||||
set:
|
||||
rustGateway.enabled: false
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "false"
|
||||
- it: enables forwarding without changing command or probes
|
||||
template: deployment.yaml
|
||||
set:
|
||||
rustGateway.enabled: true
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "true"
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe.httpGet.port
|
||||
value: http
|
||||
- it: respects an explicit environment override
|
||||
template: deployment.yaml
|
||||
set:
|
||||
rustGateway.enabled: true
|
||||
envVars.LITELLM_RUST: "false"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "false"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "true"
|
||||
|
|
@ -3,6 +3,10 @@
|
|||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
rustGateway:
|
||||
# null inherits the image default; true or false sets LITELLM_RUST
|
||||
enabled:
|
||||
liteadmin:
|
||||
enabled: false
|
||||
existingSecret: ""
|
||||
|
|
|
|||
|
|
@ -60,6 +60,17 @@ spec:
|
|||
- name: LITELLM_CORS_ORIGINS
|
||||
value: {{ include "litellm.ui.publicOrigin" . | quote }}
|
||||
{{- end }}
|
||||
{{- $rustGateway := .Values.gateway.rustGateway | default dict }}
|
||||
{{- $rustGatewayOverridden := false }}
|
||||
{{- range .Values.gateway.extraEnv }}
|
||||
{{- if eq .name "LITELLM_RUST" }}
|
||||
{{- $rustGatewayOverridden = true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (not (kindIs "invalid" $rustGateway.enabled)) (not $rustGatewayOverridden) }}
|
||||
- name: LITELLM_RUST
|
||||
value: {{ $rustGateway.enabled | toString | quote }}
|
||||
{{- end }}
|
||||
{{- include "litellm.serverEnv" (dict "root" $ "component" .Values.gateway) | nindent 12 }}
|
||||
{{- if .Values.gateway.config.create }}
|
||||
- name: CONFIG_FILE_PATH
|
||||
|
|
|
|||
56
helm/litellm/tests/rust_gateway_tests.yaml
Normal file
56
helm/litellm/tests/rust_gateway_tests.yaml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
suite: Rust forwarding gateway
|
||||
templates:
|
||||
- gateway/deployment.yaml
|
||||
- gateway/configmap.yaml
|
||||
values:
|
||||
- ./values/required.yaml
|
||||
tests:
|
||||
- it: leaves the image default in place when unset
|
||||
template: gateway/deployment.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
any: true
|
||||
- it: turns forwarding off explicitly
|
||||
template: gateway/deployment.yaml
|
||||
set:
|
||||
gateway.rustGateway.enabled: false
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "false"
|
||||
- it: enables forwarding without changing command or probes
|
||||
template: gateway/deployment.yaml
|
||||
set:
|
||||
gateway.rustGateway.enabled: true
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "true"
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe.httpGet.port
|
||||
value: http
|
||||
- it: respects an explicit extraEnv override
|
||||
template: gateway/deployment.yaml
|
||||
set:
|
||||
gateway.rustGateway.enabled: true
|
||||
gateway.extraEnv:
|
||||
- name: LITELLM_RUST
|
||||
value: "false"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "false"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: LITELLM_RUST
|
||||
value: "true"
|
||||
|
|
@ -303,6 +303,9 @@ gateway:
|
|||
# Number of uvicorn worker processes per gateway pod. Sets NUM_WORKERS,
|
||||
# consumed by the gateway image entrypoint. Default is 1.
|
||||
numWorkers: 1
|
||||
rustGateway:
|
||||
# null inherits the image default; true or false sets LITELLM_RUST
|
||||
enabled:
|
||||
extraEnv: [] # Add extra environment variables to the gateway
|
||||
envConfigMaps: [] # Add extra environment variables to the gateway from config maps
|
||||
envSecrets: [] # Add extra environment variables to the gateway from secrets
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue