Add DevServices support for Ollama model #182
Merged
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.
This PR adds dev services to Ollama, so in dev mode, you don't need to have Ollama running locally; it starts an Ollama container and installs the first time the model you want to use. After that, every run against the same model will reuse the created image.
One of the things in this implementation that is different from other devservices is that it is developed in its module, so you need to add the module to enable it.
The reason it is this way is that the Ollama container takes a lot of minutes to start the first time, and also when running it and querying locally might take some seconds, so maybe it's not always the best to have devservices running. I know there is the enable flag, so here we can decide if we want to set the flag enabled to false by default and let the user explicitly set to true (which means that developers might not notice there is a devservice by default) or we explicitly make them add as a dependency enabled to true by default