Add docker-model-runner module: Spring AI OpenAI starter against Docker Model Runner and Ollama with a benchmark runner (time to first token, decode tokens/second, container memory, tool-call success); real docker/model-runner v1.2.9 CPU image and Ollama 0.40.13 on a shared 2-vCPU sandbox, no GPU

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
2026-10-29 06:24:00 +00:00
co-authored by Claude Sonnet 5.5
parent 6d792f00e0
commit c97bcf9adf
18 changed files with 668 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Starts ollama/ollama on host port 11434 and pulls qwen2.5:1.5b (Ollama's default tag is Q4_K_M,
# the same quantisation as the GGUF the Docker Model Runner script pulls).
# EXTRA_CA=/path/to/ca.crt (optional) as in start-dmr.sh.
set -euo pipefail
NAME="${NAME:-ollama}"
IMAGE=ollama/ollama:latest
if [ -n "${EXTRA_CA:-}" ]; then
D=$(mktemp -d); cp "$EXTRA_CA" "$D/extra-ca.crt"
printf 'FROM %s\nCOPY extra-ca.crt /usr/local/share/ca-certificates/extra-ca.crt\nRUN update-ca-certificates\n' "$IMAGE" > "$D/Dockerfile"
docker build -q -t ollama-ca "$D" >/dev/null; IMAGE=ollama-ca
fi
docker rm -f "$NAME" >/dev/null 2>&1 || true
docker run -d --name "$NAME" -p 11434:11434 "$IMAGE" >/dev/null
until docker exec "$NAME" ollama list >/dev/null 2>&1; do sleep 1; done
docker exec "$NAME" ollama pull qwen2.5:1.5b
docker exec "$NAME" ollama show qwen2.5:1.5b | head -12