# OllamaSharp

A .NET client library for the Ollama API, recommended by Microsoft and used by Semantic Kernel, .NET Aspire and Microsoft.Extensions.AI, covering chat, embeddings, model management and tool calling.

OllamaSharp provides .NET bindings for the Ollama API, so a .NET application can talk to a local or remote Ollama server in a few lines of code. It covers every Ollama API endpoint, including chat, embeddings, listing, pulling, creating and deleting models, streams responses and model-pull progress in real time, and supports vision models for multimodal input.

Its tool-calling support uses source generators for sophisticated function calling, and it offers opt-in Native AOT support through a custom `JsonSerializerContext` for improved startup performance. It powers Ollama support inside Microsoft Semantic Kernel, .NET Aspire and Microsoft.Extensions.AI, and is written in C# under the MIT license.

Website: https://www.nuget.org/packages/OllamaSharp
