# Ollama SDK for .NET

A C# client for the Ollama API, auto-generated from its OpenAPI specification, covering chat, streaming completions, embeddings, model management and tool calling for .NET applications.

Ollama SDK for .NET is a fully generated C# client for Ollama's OpenAPI specification, kept current with automatic preview releases whenever the upstream spec changes. It covers chat, embeddings, listing, pulling, creating and deleting models, and other Ollama API endpoints, and supports .NET Framework, .NET Standard 2.0 and modern .NET features such as nullability, trimming and NativeAOT.

A source generator lets a developer define tool functions natively through C# interfaces for function calling, and the library implements Microsoft.Extensions.AI's IChatClient and IEmbeddingGenerator interfaces so it plugs into that ecosystem. MIT licensed.

Website: https://tryagi.github.io/Ollama/
