Skip to content

Commit 78c53a5

Browse files
committed
Intial Commit for SGLang Helm Chart added to EI
Signed-off-by: vinayK34 <vinay3.kumar@intel.com>
1 parent ba5141d commit 78c53a5

15 files changed

Lines changed: 1004 additions & 0 deletions

core/helm-charts/sglang/Chart.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (C) 2025-2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: v2
5+
name: sglang
6+
description: The Helm chart for sglang Inference Server
7+
type: application
8+
version: 0-latest
9+
# The sglang version
10+
appVersion: "0.5"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (C) 2025-2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
values.yaml
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "sglang.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "sglang.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "sglang.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Convert chart name to a string suitable as metric prefix
35+
*/}}
36+
{{- define "sglang.metricPrefix" -}}
37+
{{- include "sglang.fullname" . | replace "-" "_" | regexFind "[a-zA-Z_:][a-zA-Z0-9_:]*" }}
38+
{{- end }}
39+
40+
{{/*
41+
Common labels
42+
*/}}
43+
{{- define "sglang.labels" -}}
44+
helm.sh/chart: {{ include "sglang.chart" . }}
45+
{{ include "sglang.selectorLabels" . }}
46+
{{- if .Chart.AppVersion }}
47+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
48+
{{- end }}
49+
app.kubernetes.io/managed-by: {{ .Release.Service }}
50+
{{- end }}
51+
52+
{{/*
53+
Selector labels
54+
*/}}
55+
{{- define "sglang.selectorLabels" -}}
56+
app.kubernetes.io/name: {{ include "sglang.name" . }}
57+
app.kubernetes.io/instance: {{ .Release.Name }}
58+
{{- end }}
59+
60+
{{/*
61+
Create the name of the service account to use
62+
*/}}
63+
{{- define "sglang.serviceAccountName" -}}
64+
{{- if .Values.global.sharedSAName }}
65+
{{- .Values.global.sharedSAName }}
66+
{{- else if .Values.serviceAccount.create }}
67+
{{- default (include "sglang.fullname" .) .Values.serviceAccount.name }}
68+
{{- else }}
69+
{{- default "default" .Values.serviceAccount.name }}
70+
{{- end }}
71+
{{- end }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (C) 2025-2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
{{- if .Values.apisix.enabled }}
4+
{{- $modelName := (default .Values.LLM_MODEL_ID .Values.SERVED_MODEL_NAME) | splitList "/" | last }}
5+
apiVersion: apisix.apache.org/v2
6+
kind: ApisixRoute
7+
metadata:
8+
name: {{ include "sglang.fullname" . }}-apisixroute
9+
namespace: default
10+
spec:
11+
http:
12+
- name: {{ include "sglang.fullname" . }}-apisixroute
13+
match:
14+
hosts:
15+
- {{ .Values.route.host | default .Values.ingress.host }}
16+
paths:
17+
# - /{{ $modelName }}/*
18+
19+
backends:
20+
- serviceName: {{ include "sglang.fullname" . }}-service
21+
servicePort: {{- if .Values.route.enabled }}
22+
sglang
23+
{{- else }}
24+
80
25+
{{- end }}
26+
plugins:
27+
- name: openid-connect
28+
enable: true
29+
secretRef: {{ include "sglang.fullname" . }}-secret
30+
config:
31+
discovery: {{ .Values.oidc.discovery }}
32+
{{- if or (eq .Values.platform "openshift") (eq .Values.platform "eks") }}
33+
use_jwks: {{ .Values.oidc.use_jwks }}
34+
{{- else }}
35+
introspection_endpoint: {{ .Values.oidc.introspection_endpoint }}
36+
introspection_endpoint_auth_method: client_secret_basic
37+
{{- end }}
38+
scope: openid profile email
39+
bearer_only: true
40+
realm: master
41+
- name: proxy-rewrite
42+
enable: true
43+
config:
44+
regex_uri:
45+
46+
- /$1
47+
# - ^/{{ $modelName }}/(.*)
48+
# - /$1
49+
headers:
50+
Content-Type: application/json
51+
{{- end }}

core/helm-charts/sglang/templates/configmap.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2025-2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
{{- $modelName := (default .Values.LLM_MODEL_ID .Values.SERVED_MODEL_NAME) }}
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: {{ include "sglang.fullname" . }}-config
8+
labels:
9+
{{- include "sglang.labels" . | nindent 4 }}
10+
data:
11+
{{- if .Values.global.HF_ENDPOINT }}
12+
HF_ENDPOINT: {{ .Values.global.HF_ENDPOINT | quote}}
13+
{{- end }}
14+
http_proxy: {{ .Values.global.http_proxy | quote }}
15+
https_proxy: {{ .Values.global.https_proxy | quote }}
16+
no_proxy: {{ .Values.global.no_proxy | quote }}
17+
TORCHINDUCTOR_CACHE_DIR: "/tmp"
18+
NUMBA_CACHE_DIR: "/tmp"
19+
HF_HOME: "/data"
20+
OUTLINES_CACHE_DIR: "/tmp/.cache/outlines"
21+
{{- if .Values.runtime }}
22+
runtime: {{ .Values.runtime | quote}}
23+
{{- end }}
24+
25+
{{- $modelConfig := (index .Values.modelConfigs $modelName | default dict).configMapValues | default .Values.defaultModelConfigs.configMapValues }}
26+
{{- range $key, $value := $modelConfig }}
27+
{{ $key }}: {{ $value | quote }}
28+
{{- end }}

0 commit comments

Comments
 (0)