fix(ai): prewarm quick chat model

This commit is contained in:
jenkins 2026-06-29 15:33:50 -03:00
parent 9e592642aa
commit f9ea2be3d5

View File

@ -88,6 +88,8 @@ spec:
env:
- name: OLLAMA_HOST
value: 0.0.0.0
- name: OLLAMA_FAST_MODEL
value: qwen2.5-coder:1.5b-instruct-q4_0
- name: OLLAMA_KEEP_ALIVE
value: 6h
- name: OLLAMA_MODELS
@ -96,13 +98,27 @@ spec:
value: all
- name: NVIDIA_DRIVER_CAPABILITIES
value: compute,utility
command:
- /bin/sh
- -c
- |
set -e
ollama serve &
pid="$!"
trap 'kill -TERM "$pid"; wait "$pid"' TERM INT
sleep 6
timeout 180s ollama run "${OLLAMA_FAST_MODEL}" "reply with just pong" >/tmp/ollama-fast-warm.log 2>&1
touch /tmp/ollama-fast-ready
wait "$pid"
volumeMounts:
- name: models
mountPath: /root/.ollama
readinessProbe:
httpGet:
path: /api/tags
port: 11434
exec:
command:
- /bin/sh
- -c
- test -f /tmp/ollama-fast-ready && ollama list >/dev/null 2>&1
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5