Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/helm-charts/sglang/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2025-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: sglang
description: The Helm chart for sglang Inference Server
type: application
version: 0-latest
# The sglang version
appVersion: "0.5"
3 changes: 3 additions & 0 deletions core/helm-charts/sglang/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (C) 2025-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
values.yaml
71 changes: 71 additions & 0 deletions core/helm-charts/sglang/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "sglang.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "sglang.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 "sglang.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Convert chart name to a string suitable as metric prefix
*/}}
{{- define "sglang.metricPrefix" -}}
{{- include "sglang.fullname" . | replace "-" "_" | regexFind "[a-zA-Z_:][a-zA-Z0-9_:]*" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "sglang.labels" -}}
helm.sh/chart: {{ include "sglang.chart" . }}
{{ include "sglang.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "sglang.selectorLabels" -}}
app.kubernetes.io/name: {{ include "sglang.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "sglang.serviceAccountName" -}}
{{- if .Values.global.sharedSAName }}
{{- .Values.global.sharedSAName }}
{{- else if .Values.serviceAccount.create }}
{{- default (include "sglang.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
51 changes: 51 additions & 0 deletions core/helm-charts/sglang/templates/apisixroutes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (C) 2025-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
{{- if .Values.apisix.enabled }}
{{- $modelName := (default .Values.LLM_MODEL_ID .Values.SERVED_MODEL_NAME) | splitList "/" | last }}
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: {{ include "sglang.fullname" . }}-apisixroute
namespace: default
spec:
http:
- name: {{ include "sglang.fullname" . }}-apisixroute
match:
hosts:
- {{ .Values.route.host | default .Values.ingress.host }}
paths:
# - /{{ $modelName }}/*

backends:
- serviceName: {{ include "sglang.fullname" . }}-service
servicePort: {{- if .Values.route.enabled }}
sglang
{{- else }}
80
{{- end }}
plugins:
- name: openid-connect
enable: true
secretRef: {{ include "sglang.fullname" . }}-secret
config:
discovery: {{ .Values.oidc.discovery }}
{{- if or (eq .Values.platform "openshift") (eq .Values.platform "eks") }}
use_jwks: {{ .Values.oidc.use_jwks }}
{{- else }}
introspection_endpoint: {{ .Values.oidc.introspection_endpoint }}
introspection_endpoint_auth_method: client_secret_basic
{{- end }}
scope: openid profile email
bearer_only: true
realm: master
- name: proxy-rewrite
enable: true
config:
regex_uri:

- /$1
# - ^/{{ $modelName }}/(.*)
# - /$1
headers:
Content-Type: application/json
{{- end }}
25 changes: 25 additions & 0 deletions core/helm-charts/sglang/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2025-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
{{- $modelName := (default .Values.LLM_MODEL_ID .Values.SERVED_MODEL_NAME) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "sglang.fullname" . }}-config
labels:
{{- include "sglang.labels" . | nindent 4 }}
data:
{{- if .Values.global.HF_ENDPOINT }}
HF_ENDPOINT: {{ .Values.global.HF_ENDPOINT | quote}}
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
TORCHINDUCTOR_CACHE_DIR: "/tmp"
NUMBA_CACHE_DIR: "/tmp"
HF_HOME: "/data"
OUTLINES_CACHE_DIR: "/tmp/.cache/outlines"

{{- $modelConfig := (index .Values.modelConfigs $modelName | default dict).configMapValues | default .Values.defaultModelConfigs.configMapValues }}
{{- range $key, $value := $modelConfig }}
{{ $key }}: {{ $value | quote }}
{{- end }}
Loading