Breaking changes with Ollama and Aspire 9 #194
aaronpowell
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks to the excellent work from @Mrxx99 we have a major overhaul coming to the Ollama integration in the Aspire 9 release, and this is being coupled with a major update to OllamaSharp.
Models as resources
Originally models were just appended to the Ollama resource and you would pass the Ollama resource as a reference, but this resulted in some workarounds on how you'd set (and discover) the default model to use. But in the v9 release we have an
OllamaModelResource
that is returned and can be passed as a reference, which will then provide connection information to clients on which model to use.New connection string format
Originally the "connection string" from an Ollama resource was just the HTTP endpoint, but to support the Model as resource feature better the resources will create a "real" connection string of
Endpoint=<...>;Model=<...>
. TheModel
part will only be included if you're passing theOllamaModelResource
though. This is a breaking change that you may need update if you're not using the OllamaSharp integration.OllamaSharp 4 + Microsoft.Extensions.AI
OllamaSharp has been updated to a new major version and now supports the interfaces from Microsoft.Extensions.AI. We've bumped our integration to support that and you can register the
IOllamaApiClient
(native OllamaSharp client), or from M.E.AIIChatClient
andIEmbeddingGenerator
(depending on your model type).Using these new interfaces makes code more portable across LLM/SLM options.
API deprecations and removals
With all the refactoring that's gone on some APIs are being deprecated or straight up removed.
Pre-release builds
Pre-release builds are available on nuget.org and via the Azure Artifacts (if you want the really bleeding edge stuff), so if you're using the Ollama integrations, make sure you test in the lead up to the v9 release.
Relevant issues
Beta Was this translation helpful? Give feedback.
All reactions