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: env:
- name: OLLAMA_HOST - name: OLLAMA_HOST
value: 0.0.0.0 value: 0.0.0.0
- name: OLLAMA_FAST_MODEL
value: qwen2.5-coder:1.5b-instruct-q4_0
- name: OLLAMA_KEEP_ALIVE - name: OLLAMA_KEEP_ALIVE
value: 6h value: 6h
- name: OLLAMA_MODELS - name: OLLAMA_MODELS
@ -96,13 +98,27 @@ spec:
value: all value: all
- name: NVIDIA_DRIVER_CAPABILITIES - name: NVIDIA_DRIVER_CAPABILITIES
value: compute,utility 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: volumeMounts:
- name: models - name: models
mountPath: /root/.ollama mountPath: /root/.ollama
readinessProbe: readinessProbe:
httpGet: exec:
path: /api/tags command:
port: 11434 - /bin/sh
- -c
- test -f /tmp/ollama-fast-ready && ollama list >/dev/null 2>&1
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5