-
Notifications
You must be signed in to change notification settings - Fork 132
feat(helm): add LLMGateway helm chart #1998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
5f04047
db4e2a5
5402f96
96fa4dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,3 +183,15 @@ Once your LLMGateway is running: | |
| 2. **Create your first organization** and project | ||
| 3. **Generate API keys** for your applications | ||
| 4. **Test the gateway** by making API calls to http://localhost:4001 | ||
|
|
||
| ## Helm Chart | ||
|
|
||
| You can also deploy LLMGateway using the Helm chart. | ||
|
|
||
| ```bash | ||
| helm repo add llmgateway https://llmgateway.io/helm | ||
| helm repo update | ||
| helm install llmgateway llmgateway/llmgateway | ||
| ``` | ||
|
Comment on lines
+187
to
+193
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Helm-specific prerequisites to avoid failed onboarding. Line [187] adds a Helm deployment path, but prerequisites are still Docker-only. Please add Kubernetes cluster + Helm requirements in the prerequisites section so this option is executable end-to-end. 📘 Proposed doc patch ## Prerequisites
- Latest Docker
+- A Kubernetes cluster (local or managed)
+- Helm v3
- API keys for the LLM providers you want to use (OpenAI, Anthropic, etc.)🤖 Prompt for AI Agents |
||
|
|
||
| See the [Helm chart documentation](https://llmgateway.io/helm) for more information. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # LLM Gateway Helm Chart | ||
|
|
||
| This is the Helm chart for LLM Gateway. It is used to deploy LLM Gateway on a Kubernetes cluster. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| helm repo add llmgateway https://llmgateway.io/helm | ||
| helm repo update | ||
| helm install llmgateway llmgateway/llmgateway | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: v2 | ||
| name: llmgateway | ||
| description: A Helm chart for LLM Gateway - a full-stack LLM API gateway with multi-provider support | ||
| type: application | ||
| icon: https://llmgateway.io/brand/logo-black.svg | ||
| version: 0.1.0 | ||
| appVersion: "latest" | ||
| home: https://llmgateway.io | ||
| sources: | ||
| - https://github.com/theopenco/llmgateway | ||
| keywords: | ||
| - llm | ||
| - gateway | ||
| - ai | ||
| - openai | ||
| - anthropic | ||
| - api-gateway | ||
| maintainers: | ||
| - name: theopenco | ||
| url: https://github.com/theopenco |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "llmgateway.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| */}} | ||
| {{- define "llmgateway.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "llmgateway.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "llmgateway.labels" -}} | ||
| helm.sh/chart: {{ include "llmgateway.chart" . }} | ||
| {{ include "llmgateway.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- with .Values.global.labels }} | ||
| {{ toYaml . }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "llmgateway.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "llmgateway.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Component labels (call with dict "context" . "component" "api") | ||
| */}} | ||
| {{- define "llmgateway.componentLabels" -}} | ||
| {{ include "llmgateway.labels" .context }} | ||
| app.kubernetes.io/component: {{ .component }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Component selector labels | ||
| */}} | ||
| {{- define "llmgateway.componentSelectorLabels" -}} | ||
| {{ include "llmgateway.selectorLabels" .context }} | ||
| app.kubernetes.io/component: {{ .component }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Build image reference for a component. | ||
| Usage: {{ include "llmgateway.image" (dict "context" . "image" .Values.api.image) }} | ||
| */}} | ||
| {{- define "llmgateway.image" -}} | ||
| {{- $registry := .image.registry | default .context.Values.global.image.registry -}} | ||
| {{- $repository := .image.repository -}} | ||
| {{- $tag := .image.tag | default .context.Values.global.image.tag | default .context.Chart.AppVersion -}} | ||
| {{- if $registry -}} | ||
| {{- printf "%s/%s:%s" $registry $repository $tag -}} | ||
| {{- else -}} | ||
| {{- printf "%s:%s" $repository $tag -}} | ||
| {{- end -}} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Image pull secrets | ||
| */}} | ||
| {{- define "llmgateway.imagePullSecrets" -}} | ||
| {{- with .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 2 }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Secret name (supports existingSecret) | ||
| */}} | ||
| {{- define "llmgateway.secretName" -}} | ||
| {{- if .Values.existingSecret }} | ||
| {{- .Values.existingSecret }} | ||
| {{- else }} | ||
| {{- include "llmgateway.fullname" . }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| ConfigMap name | ||
| */}} | ||
| {{- define "llmgateway.configMapName" -}} | ||
| {{- include "llmgateway.fullname" . }}-config | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| PostgreSQL host | ||
| */}} | ||
| {{- define "llmgateway.postgresql.host" -}} | ||
| {{- if .Values.postgresql.enabled }} | ||
| {{- printf "%s-postgresql" (include "llmgateway.fullname" .) }} | ||
| {{- else }} | ||
| {{- .Values.externalPostgresql.host }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| PostgreSQL port | ||
| */}} | ||
| {{- define "llmgateway.postgresql.port" -}} | ||
| {{- if .Values.postgresql.enabled }} | ||
| {{- .Values.postgresql.port | default 5432 }} | ||
| {{- else }} | ||
| {{- .Values.externalPostgresql.port | default 5432 }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| PostgreSQL database | ||
| */}} | ||
| {{- define "llmgateway.postgresql.database" -}} | ||
| {{- if .Values.postgresql.enabled }} | ||
| {{- .Values.postgresql.database | default "llmgateway" }} | ||
| {{- else }} | ||
| {{- .Values.externalPostgresql.database | default "llmgateway" }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| PostgreSQL user | ||
| */}} | ||
| {{- define "llmgateway.postgresql.user" -}} | ||
| {{- if .Values.postgresql.enabled }} | ||
| {{- .Values.postgresql.user | default "postgres" }} | ||
| {{- else }} | ||
| {{- .Values.externalPostgresql.user | default "postgres" }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Redis host | ||
| */}} | ||
| {{- define "llmgateway.redis.host" -}} | ||
| {{- if .Values.redis.enabled }} | ||
| {{- printf "%s-redis" (include "llmgateway.fullname" .) }} | ||
| {{- else }} | ||
| {{- .Values.externalRedis.host }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Redis port | ||
| */}} | ||
| {{- define "llmgateway.redis.port" -}} | ||
| {{- if .Values.redis.enabled }} | ||
| {{- .Values.redis.port | default 6379 }} | ||
| {{- else }} | ||
| {{- .Values.externalRedis.port | default 6379 }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Internal service URL helper. | ||
| Usage: {{ include "llmgateway.serviceUrl" (dict "context" . "name" "api") }} | ||
| */}} | ||
| {{- define "llmgateway.serviceUrl" -}} | ||
| {{- printf "http://%s-%s:80" (include "llmgateway.fullname" .context) .name -}} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| {{- if .Values.admin.enabled }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "llmgateway.fullname" . }}-admin | ||
| labels: | ||
| {{- include "llmgateway.componentLabels" (dict "context" . "component" "admin") | nindent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.admin.replicas | default 1 }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "llmgateway.componentSelectorLabels" (dict "context" . "component" "admin") | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "llmgateway.componentSelectorLabels" (dict "context" . "component" "admin") | nindent 8 }} | ||
| annotations: | ||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
| checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} | ||
| spec: | ||
| {{- include "llmgateway.imagePullSecrets" . | nindent 6 }} | ||
| containers: | ||
| - name: admin | ||
| image: {{ include "llmgateway.image" (dict "context" . "image" .Values.admin.image) }} | ||
| imagePullPolicy: {{ .Values.admin.image.pullPolicy | default "IfNotPresent" }} | ||
| ports: | ||
| - name: http | ||
| containerPort: 80 | ||
| protocol: TCP | ||
| envFrom: | ||
| - configMapRef: | ||
| name: {{ include "llmgateway.configMapName" . }} | ||
| - secretRef: | ||
| name: {{ include "llmgateway.secretName" . }} | ||
| {{- with .Values.admin.extraEnv }} | ||
| env: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /api/health | ||
| port: http | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 10 | ||
| timeoutSeconds: 5 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /api/health | ||
| port: http | ||
| initialDelaySeconds: 20 | ||
| periodSeconds: 30 | ||
| timeoutSeconds: 5 | ||
| resources: | ||
| {{- toYaml .Values.admin.resources | nindent 12 }} | ||
| {{- with .Values.admin.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.admin.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| {{- if .Values.admin.enabled }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "llmgateway.fullname" . }}-admin | ||
| labels: | ||
| {{- include "llmgateway.componentLabels" (dict "context" . "component" "admin") | nindent 4 }} | ||
| spec: | ||
| type: {{ .Values.admin.service.type | default "ClusterIP" }} | ||
| ports: | ||
| - port: 80 | ||
| targetPort: http | ||
| protocol: TCP | ||
| name: http | ||
| selector: | ||
| {{- include "llmgateway.componentSelectorLabels" (dict "context" . "component" "admin") | nindent 4 }} | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yezz123 this link needs to be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should deploy it either in github pages or you can do it with the domain of llmgateway