Stop the ollama integration tests flaking on cold model reloads#545
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.