diff --git a/services/ai-llm/deployment.yaml b/services/ai-llm/deployment.yaml index c3f96edbf..d7a3d2c51 100644 --- a/services/ai-llm/deployment.yaml +++ b/services/ai-llm/deployment.yaml @@ -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