-
Notifications
You must be signed in to change notification settings - Fork 1
/
helm-release.yaml
224 lines (210 loc) · 7.84 KB
/
helm-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: &appname localai
namespace: home
spec:
releaseName: *appname
interval: 5m
chart:
spec:
chart: local-ai
version: 3.2.0
interval: 5m
sourceRef:
kind: HelmRepository
name: go-skynet-charts
namespace: flux-system
upgrade:
remediation:
retries: 4
postRenderers:
- kustomize:
patches:
- target:
version: v1
kind: Deployment
name: localai
patch: |
- op: add
path: /spec/template/spec/runtimeClassName
value: nvidia
- op: add
path: /spec/template/spec/containers/0/lifecycle
value:
postStart:
exec:
command:
- /bin/sh
- -c
- >
until curl -sf http://localhost:8080/models; do
echo "Waiting for server to be ready...";
sleep 5;
done;
echo "Server is ready. Models endpoint returned 200 OK.";
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{ "model": "llama3-8b-chinese", "messages": [{"role": "user", "content": "Do not respond to this message", "temperature": 0.1}] }'
# See https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
values:
fullnameOverride: localai
replicaCount: 1
deployment:
image:
repository: localai/localai
#tag: v2.9.0-cublas-cuda12-ffmpeg
tag: v2.13.0-cublas-cuda12-ffmpeg
env:
DEBUG: true
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH"
NVIDIA_VISIBLE_DEVICES: 0
NVIDIA_DRIVER_CAPABILITIES: "all"
PYTHON_GRPC_MAX_WORKERS: 2
LLAMACPP_PARALLEL: 2
LOCALAI_PARALLEL_REQUESTS: true
SINGLE_ACTIVE_BACKEND: true
#GALLERIES: '[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"name":"huggingface", "url": "github:go-skynet/model-gallery/huggingface.yaml"}]'
#GALLERIES: '[{"name":"huggingface", "url": "github:go-skynet/model-gallery/huggingface.yaml"}]'
GALLERIES: '[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]'
#PRELOAD_MODELS: '[{"id": "huggingface@thebloke__wizardlm-7b-v1-0-uncensored-superhot-8k-ggml__wizardlm-7b-v1.0-superhot-8k.ggmlv3.q3_k_m.bin","name": "WizardLM-7B-uncensored"}, {"id": "model-gallery@bert-embeddings"}, {"url": "github:go-skynet/model-gallery/stablediffusion.yaml"}]'
PRELOAD_MODELS: '[{"id": "model-gallery@bert-embeddings"}, {"url": "github:go-skynet/model-gallery/stablediffusion.yaml"}]'
COMPEL: 0
threads: 4
context_size: 512
modelsPath: "/models"
download_model:
# To use cloud provided (eg AWS) image, provide it like: 1234356789.dkr.ecr.us-REGION-X.amazonaws.com/busybox
image: busybox
prompt_templates:
# To use cloud provided (eg AWS) image, provide it like: 1234356789.dkr.ecr.us-REGION-X.amazonaws.com/busybox
image: busybox
pullPolicy: IfNotPresent
imagePullSecrets: []
# - name: secret-names
resources:
requests:
nvidia.com/gpu: "1"
cpu: 200m
memory: 2000Mi
limits:
nvidia.com/gpu: "1"
memory: 20000Mi
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# Prompt templates to include
# Note: the keys of this map will be the names of the prompt template files
#promptTemplates:
# ggml-gpt4all-j.tmpl: |
# The prompt below is a question to answer, a task to complete, or a conversation to respond to; decide which and write an appropriate response.
# ### Prompt:
# {{.Input}}
# ### Response:
# WizardLM-7B-uncensored.Q2_K.tmpl: |
# The prompt below is a question to answer, a task to complete, or a conversation to respond to; decide which and write an appropriate response.
# ### Prompt:
# {{.Input}}
# ### Response:
# Models to download at runtime
models:
# Whether to force download models even if they already exist
forceDownload: false
# The list of URLs to download models from
# Note: the name of the file will be the name of the loaded model
#list:
# - url: "https://gpt4all.io/models/ggml-gpt4all-j.bin"
# basicAuth: base64EncodedCredentials
initContainers: []
# Example:
# - name: my-init-container
# image: my-init-image
# imagePullPolicy: IfNotPresent
# command: ["/bin/sh", "-c", "echo init"]
# volumeMounts:
# - name: my-volume
# mountPath: /path/to/mount
sidecarContainers: []
# Example:
# - name: my-sidecar-container
# image: my-sidecar-image
# imagePullPolicy: IfNotPresent
# ports:
# - containerPort: 1234
# Persistent storage for models and prompt templates.
# PVC and HostPath are mutually exclusive. If both are enabled,
# PVC configuration takes precedence. If neither are enabled, ephemeral
# storage is used.
persistence:
#nvidia:
# enabled: true
# type: hostPath
# storageClass: local-path
# hostPath: /usr/lib/x86_64-linux-gnu
# accessModes: ReadWriteOnce
# size: 2Gi
models:
enabled: true
annotations: {}
storageClass: longhorn
accessModes: ReadWriteMany
size: 200Gi
globalMount: /models
output:
enabled: true
annotations: {}
storageClass: longhorn
accessModes: ReadWriteMany
size: 10Gi
globalMount: /tmp/generated
retain: true
service:
type: LoadBalancer
# If deferring to an internal only load balancer
# externalTrafficPolicy: Local
port: 8080
annotations: {}
# If using an AWS load balancer, you'll need to override the default 60s load balancer idle timeout
# service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "1200"
ingress:
enabled: true
name: localai
annotations:
hajimari.io/enable: 'true'
hajimari.io/icon: resistor-nodes
hajimari.io/appName: LocalAI
hajimari.io/group: Home
cert-manager.io/cluster-issuer: letsencrypt-production
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: networking-chain-authelia@kubernetescrd
hosts:
- host: &uri ai.${SECRET_DEV_DOMAIN}
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- *uri
secretName: *uri
className: traefik
nodeSelector:
nvidia.com/gpu.present: 'true'
tolerations: []
#affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# #- key: app.kubernetes.io/name
# # operator: In
# # values: [plex]
# #- key: "app.kubernetes.io/name"
# # operator: In
# # values:
# # - *appname
# topologyKey: "kubernetes.io/hostname"