devzone 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/agent-local.sh +17 -27
- package/.devcontainer/argocd/services-hook.sh +9 -39
- package/.devcontainer/devzone +46 -10
- package/.devcontainer/ia/host-models.sh +3 -3
- package/.devcontainer/services-admin.sh +5 -10
- package/README.md +3 -7
- package/manage/scripts/migrer-retour.sh +2 -0
- package/manage/scripts/services-workspace.sh +7 -17
- package/manage/workspace.sh +1 -1
- package/package.json +1 -1
- package/.devcontainer/llm/bench.sh +0 -171
- package/.devcontainer/llm/llm.sh +0 -262
- package/.devcontainer/llm/opencode.sh +0 -56
- package/.devcontainer/llm/presets.sh +0 -43
- package/charts/devzone-llm/Chart.yaml +0 -6
- package/charts/devzone-llm/templates/bench-job.yaml +0 -65
- package/charts/devzone-llm/templates/deployment.yaml +0 -113
- package/charts/devzone-llm/templates/pvc.yaml +0 -19
- package/charts/devzone-llm/templates/service.yaml +0 -18
- package/charts/devzone-llm/values.yaml +0 -72
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
apiVersion: apps/v1
|
|
2
|
-
kind: Deployment
|
|
3
|
-
metadata:
|
|
4
|
-
name: llm
|
|
5
|
-
namespace: {{ .Release.Namespace }}
|
|
6
|
-
labels:
|
|
7
|
-
app: llm
|
|
8
|
-
app.kubernetes.io/name: llm
|
|
9
|
-
app.kubernetes.io/part-of: devzone
|
|
10
|
-
app.kubernetes.io/managed-by: devzone
|
|
11
|
-
spec:
|
|
12
|
-
replicas: 1
|
|
13
|
-
strategy:
|
|
14
|
-
type: Recreate
|
|
15
|
-
selector:
|
|
16
|
-
matchLabels:
|
|
17
|
-
app: llm
|
|
18
|
-
template:
|
|
19
|
-
metadata:
|
|
20
|
-
labels:
|
|
21
|
-
app: llm
|
|
22
|
-
app.kubernetes.io/managed-by: devzone
|
|
23
|
-
spec:
|
|
24
|
-
initContainers:
|
|
25
|
-
- name: fetch-model
|
|
26
|
-
image: {{ .Values.fetchImage }}
|
|
27
|
-
securityContext:
|
|
28
|
-
runAsUser: 0
|
|
29
|
-
env:
|
|
30
|
-
- name: MODEL_URL
|
|
31
|
-
value: {{ .Values.model.url | quote }}
|
|
32
|
-
- name: MODEL_FILE
|
|
33
|
-
value: {{ .Values.model.file | quote }}
|
|
34
|
-
- name: MODEL_SHA256
|
|
35
|
-
value: {{ .Values.model.sha256 | quote }}
|
|
36
|
-
command:
|
|
37
|
-
- sh
|
|
38
|
-
- -c
|
|
39
|
-
- |
|
|
40
|
-
set -eu
|
|
41
|
-
f="/models/$MODEL_FILE"
|
|
42
|
-
if [ ! -f "$f" ]; then
|
|
43
|
-
echo "downloading $MODEL_FILE (first start: several minutes)"
|
|
44
|
-
curl -fL --retry 5 --retry-delay 5 -C - -o "$f.part" "$MODEL_URL"
|
|
45
|
-
mv "$f.part" "$f"
|
|
46
|
-
fi
|
|
47
|
-
if ! echo "$MODEL_SHA256 $f" | sha256sum -c -; then
|
|
48
|
-
echo "sha256 differs: $MODEL_FILE removed" >&2
|
|
49
|
-
rm -f "$f"
|
|
50
|
-
exit 1
|
|
51
|
-
fi
|
|
52
|
-
volumeMounts:
|
|
53
|
-
- name: models
|
|
54
|
-
mountPath: /models
|
|
55
|
-
containers:
|
|
56
|
-
- name: llm
|
|
57
|
-
image: {{ .Values.image }}:server-{{ .Values.llamaBuild }}
|
|
58
|
-
env:
|
|
59
|
-
- name: THREADS
|
|
60
|
-
value: {{ .Values.threads | quote }}
|
|
61
|
-
- name: MAX_THREADS
|
|
62
|
-
value: {{ .Values.maxThreads | quote }}
|
|
63
|
-
command:
|
|
64
|
-
- sh
|
|
65
|
-
- -c
|
|
66
|
-
- |
|
|
67
|
-
set -eu
|
|
68
|
-
t="$THREADS"
|
|
69
|
-
if [ "$t" = auto ]; then
|
|
70
|
-
t="$(nproc)"
|
|
71
|
-
[ "$t" -le "$MAX_THREADS" ] || t="$MAX_THREADS"
|
|
72
|
-
fi
|
|
73
|
-
echo "llama-server: $t threads"
|
|
74
|
-
exec /app/llama-server "$@" -t "$t" --threads-batch "$t"
|
|
75
|
-
- llama-server
|
|
76
|
-
args:
|
|
77
|
-
- --host
|
|
78
|
-
- 0.0.0.0
|
|
79
|
-
- --port
|
|
80
|
-
- "8080"
|
|
81
|
-
- -m
|
|
82
|
-
- /models/{{ .Values.model.file }}
|
|
83
|
-
- -c
|
|
84
|
-
- {{ .Values.contextSize | quote }}
|
|
85
|
-
- --cache-type-k
|
|
86
|
-
- {{ .Values.cacheType | quote }}
|
|
87
|
-
- --cache-type-v
|
|
88
|
-
- {{ .Values.cacheType | quote }}
|
|
89
|
-
- --flash-attn
|
|
90
|
-
- {{ .Values.flashAttention | quote }}
|
|
91
|
-
ports:
|
|
92
|
-
- containerPort: 8080
|
|
93
|
-
name: http
|
|
94
|
-
readinessProbe:
|
|
95
|
-
httpGet:
|
|
96
|
-
path: /health
|
|
97
|
-
port: 8080
|
|
98
|
-
initialDelaySeconds: 10
|
|
99
|
-
periodSeconds: 10
|
|
100
|
-
failureThreshold: 30
|
|
101
|
-
resources:
|
|
102
|
-
requests:
|
|
103
|
-
cpu: {{ .Values.resources.requests.cpu }}
|
|
104
|
-
memory: {{ .Values.memory }}
|
|
105
|
-
limits:
|
|
106
|
-
memory: {{ .Values.resources.limits.memory }}
|
|
107
|
-
volumeMounts:
|
|
108
|
-
- name: models
|
|
109
|
-
mountPath: /models
|
|
110
|
-
volumes:
|
|
111
|
-
- name: models
|
|
112
|
-
persistentVolumeClaim:
|
|
113
|
-
claimName: {{ .Values.claim }}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
apiVersion: v1
|
|
2
|
-
kind: PersistentVolumeClaim
|
|
3
|
-
metadata:
|
|
4
|
-
name: {{ .Values.claim }}
|
|
5
|
-
namespace: {{ .Release.Namespace }}
|
|
6
|
-
labels:
|
|
7
|
-
app: llm
|
|
8
|
-
app.kubernetes.io/name: llm
|
|
9
|
-
app.kubernetes.io/part-of: devzone
|
|
10
|
-
app.kubernetes.io/managed-by: devzone
|
|
11
|
-
annotations:
|
|
12
|
-
# The model is not downloaded again: the volume outlives the release
|
|
13
|
-
helm.sh/resource-policy: keep
|
|
14
|
-
argocd.argoproj.io/sync-options: Delete=false
|
|
15
|
-
spec:
|
|
16
|
-
accessModes: ["ReadWriteOnce"]
|
|
17
|
-
resources:
|
|
18
|
-
requests:
|
|
19
|
-
storage: {{ .Values.size }}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
apiVersion: v1
|
|
2
|
-
kind: Service
|
|
3
|
-
metadata:
|
|
4
|
-
name: llm
|
|
5
|
-
namespace: {{ .Release.Namespace }}
|
|
6
|
-
labels:
|
|
7
|
-
app: llm
|
|
8
|
-
app.kubernetes.io/name: llm
|
|
9
|
-
app.kubernetes.io/part-of: devzone
|
|
10
|
-
app.kubernetes.io/managed-by: devzone
|
|
11
|
-
spec:
|
|
12
|
-
type: ClusterIP
|
|
13
|
-
selector:
|
|
14
|
-
app: llm
|
|
15
|
-
ports:
|
|
16
|
-
- name: http
|
|
17
|
-
port: {{ .Values.port }}
|
|
18
|
-
targetPort: 8080
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# The one definition of the local model: the helm-direct path installs this
|
|
2
|
-
# chart (.devcontainer/llm/llm.sh) as the release llm. No Secret: the model is
|
|
3
|
-
# public and checked by its sha256.
|
|
4
|
-
# Official llama.cpp image repository (CPU). The tag is derived from llamaBuild:
|
|
5
|
-
# server-<llamaBuild> runs the model, full-<llamaBuild> (llama-bench, only for
|
|
6
|
-
# the bench Job) comes from the same build.
|
|
7
|
-
image: ghcr.io/ggml-org/llama.cpp
|
|
8
|
-
# The one pinned llama.cpp build, shared by the server and the bench images
|
|
9
|
-
llamaBuild: b12407
|
|
10
|
-
# Image of the init container that downloads and checks the model
|
|
11
|
-
fetchImage: curlimages/curl:8.11.1
|
|
12
|
-
# Port of the Service and of llama-server
|
|
13
|
-
port: 8080
|
|
14
|
-
# Memory request of the container (the limit is resources.limits.memory)
|
|
15
|
-
memory: 6Gi
|
|
16
|
-
# Name of the volume claim holding the models; kept when the release goes
|
|
17
|
-
claim: llm-models
|
|
18
|
-
# Size of the models volume
|
|
19
|
-
size: 8Gi
|
|
20
|
-
# Context size (-c) of llama-server. 32768 is the native window of Qwen2.5; the
|
|
21
|
-
# light preset uses 16384 (--set contextSize=16384).
|
|
22
|
-
contextSize: 32768
|
|
23
|
-
# KV cache type for K and V (--cache-type-k / --cache-type-v): q8_0 costs about
|
|
24
|
-
# 1 GB at 32k for the 7B (f16 about 1.9 GB). A quantized V cache needs flash
|
|
25
|
-
# attention.
|
|
26
|
-
cacheType: q8_0
|
|
27
|
-
# Flash attention (--flash-attn on|off|auto in server-b12407)
|
|
28
|
-
flashAttention: "on"
|
|
29
|
-
# Threads (-t and --threads-batch): auto = the CPUs seen by the container
|
|
30
|
-
# (nproc), capped by maxThreads; a number is used as is.
|
|
31
|
-
threads: auto
|
|
32
|
-
maxThreads: 8
|
|
33
|
-
# The model: downloaded only when the file is missing, then its sha256 is
|
|
34
|
-
# checked (the file is removed and the pod fails when it differs). The URL is
|
|
35
|
-
# pinned to a Hugging Face commit (resolve/<commit>).
|
|
36
|
-
# Preset "qwen2.5-coder-7b-instruct-q4_k_m" (default, 4.7 GB):
|
|
37
|
-
# url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/13fb94bfda8c8cf22497dc57b78f391a9acb426a/qwen2.5-coder-7b-instruct-q4_k_m.gguf
|
|
38
|
-
# file: qwen2.5-coder-7b-instruct-q4_k_m.gguf
|
|
39
|
-
# sha256: 509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c
|
|
40
|
-
# Preset "qwen2.5-coder-3b-instruct-q4_k_m" (light, 2.1 GB; memory=3Gi,
|
|
41
|
-
# resources.limits.memory=4Gi and contextSize=16384):
|
|
42
|
-
# url: https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct-GGUF/resolve/f74adce6aa16316c625447af059dbebe4983757c/qwen2.5-coder-3b-instruct-q4_k_m.gguf
|
|
43
|
-
# file: qwen2.5-coder-3b-instruct-q4_k_m.gguf
|
|
44
|
-
# sha256: 724fb256bec1ff062b2f65e4569e871ad2e95ab2a3989723d1769c54294730b7
|
|
45
|
-
model:
|
|
46
|
-
url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/13fb94bfda8c8cf22497dc57b78f391a9acb426a/qwen2.5-coder-7b-instruct-q4_k_m.gguf
|
|
47
|
-
file: qwen2.5-coder-7b-instruct-q4_k_m.gguf
|
|
48
|
-
sha256: 509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c
|
|
49
|
-
# CPU: a request only (no CPU limit, so the threads are not throttled)
|
|
50
|
-
resources:
|
|
51
|
-
requests:
|
|
52
|
-
cpu: "2"
|
|
53
|
-
limits:
|
|
54
|
-
memory: 7Gi
|
|
55
|
-
# llama-bench Job (templates/bench-job.yaml), rendered only when enabled=true,
|
|
56
|
-
# which `devzone llm bench` sets. It runs the image full-<llamaBuild> (larger
|
|
57
|
-
# than the server image, pulled only for the bench) on the node of the server
|
|
58
|
-
# pod, with the models volume read-only, and is removed after ttl seconds.
|
|
59
|
-
bench:
|
|
60
|
-
enabled: false
|
|
61
|
-
# Prompt tokens (-p), generated tokens (-n), repetitions of each test (-r;
|
|
62
|
-
# llama-bench defaults to 5) and the thread counts tried (-t). Small values:
|
|
63
|
-
# the whole bench takes a few minutes, even on a slow machine.
|
|
64
|
-
prompt: 128
|
|
65
|
-
gen: 32
|
|
66
|
-
repetitions: 1
|
|
67
|
-
threads: "4,8"
|
|
68
|
-
# Seconds before the finished Job is garbage collected
|
|
69
|
-
ttl: 600
|
|
70
|
-
# Seconds before a stuck Job is stopped (activeDeadlineSeconds: the Job does
|
|
71
|
-
# not run forever if the call that started it is interrupted)
|
|
72
|
-
deadline: 1800
|