Skip to content

Stop the ollama integration tests flaking on cold model reloads#545

Merged
tobocop2 merged 1 commit into
mainfrom
ci/ollama-warm-keepalive
Jul 16, 2026
Merged

Stop the ollama integration tests flaking on cold model reloads#545
tobocop2 merged 1 commit into
mainfrom
ci/ollama-warm-keepalive

Conversation

@tobocop2

Copy link
Copy Markdown
Owner

Problem

The litellm integration tests failed intermittently with "Couldn't reach the provider for ollama/qwen3:0.6b, or it timed out". The service was up (the suite's reachability guard passed), but ollama unloads models after 5 idle minutes, the tests run well after setup, and the cold reload plus first generation overran the request timeout on a loaded runner.

Solution

Serve with OLLAMA_KEEP_ALIVE=-1 so loaded models stay resident, replace the blind startup sleep with a readiness poll, and warm both models during setup, where nothing is timing the request. Applied to the Linux/macOS and Windows start steps.

The litellm integration tests flaked with "Couldn't reach the provider
for ollama/qwen3:0.6b, or it timed out": the service was reachable (the
suite's skip guard saw it), but ollama unloads a model after 5 idle
minutes and the tests run well past setup, so the first request paid a
cold reload plus generation that overran the timeout on a loaded
runner. Serve with OLLAMA_KEEP_ALIVE=-1, poll readiness instead of a
blind sleep, and warm both models during setup where nothing is timing
the request.
@tobocop2
tobocop2 merged commit a20df89 into main Jul 16, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant