Ollama.Api 0.9.25

dotnet add package Ollama.Api --version 0.9.25
                    
NuGet\Install-Package Ollama.Api -Version 0.9.25
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ollama.Api" Version="0.9.25" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ollama.Api" Version="0.9.25" />
                    
Directory.Packages.props
<PackageReference Include="Ollama.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ollama.Api --version 0.9.25
                    
#r "nuget: Ollama.Api, 0.9.25"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ollama.Api@0.9.25
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ollama.Api&version=0.9.25
                    
Install as a Cake Addin
#tool nuget:?package=Ollama.Api&version=0.9.25
                    
Install as a Cake Tool

Ollama.Api

<img src="Ollama.Api/Logo.png" alt="Ollama.Api Logo" align="right" width="120" />

Overview

Ollama.Api is a .NET 9 library for interacting with Ollama-compatible AI model APIs. It provides strongly-typed interfaces for chat, text generation, embeddings, and model management, making it easy to integrate advanced AI capabilities into your .NET applications.

Features

  • Chat and text generation endpoints
  • Embedding support
  • Model management (list, show, copy, delete, push, pull)
  • Strongly-typed request/response models
  • Async API using Refit
  • .NET 9 compatible

Installation

Add the NuGet package to your project:

dotnet add package Ollama.Api

Usage Example

using Ollama.Api;
using Ollama.Api.Models;

var client = new OllamaClient(new OllamaClientOptions { BaseUrl = "http://localhost:11434" });
var response = await client.Generate.GenerateAsync(new GenerateRequest {
    Model = "llama3",
    Prompt = "Hello, world!"
}, CancellationToken.None);
Console.WriteLine(response.Response);

License

MIT License. See LICENSE for details.

Copyright � Panoramic Data Limited 2025

Contributing

Contributions are welcome! Please open issues or submit pull requests on GitHub.

Repository

https://github.com/panoramicdata/Ollama.Api

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.25 122 7/21/2025
0.9.24 109 7/4/2025
0.9.23 67 7/4/2025
0.9.19 134 6/24/2025
0.9.18 134 6/24/2025
0.9.14 133 6/23/2025
0.9.12 132 6/23/2025
0.9.8 132 6/22/2025

# Change Log

* 2025-07-04 : 0.9.24
* Removed ToolCalls from root of ChatResponse.
* 2025-07-04 : 0.9.24
* Fixed MCP support for Agentic models/clients.
* 2025-07-04 : 0.9.23
* Fixed MCP support for Agentic models/clients.
* 2025-06-24 : 0.9.19
* Added MCP support for Agentic models/clients.
* 2025-06-23 : 0.9.18
* Fixed bad default GenerateRequest.Format value
* 2025-06-23 : 0.9.14
* Fixed logo
* 2025-06-23 : 0.9.12
* Added unit tests for multi-modal requests including images.
* e.g. using Llava for image description.
* 2025-06-22 : 0.9.8
* Initial release.