Ollama.Api
0.9.25
dotnet add package Ollama.Api --version 0.9.25
NuGet\Install-Package Ollama.Api -Version 0.9.25
<PackageReference Include="Ollama.Api" Version="0.9.25" />
<PackageVersion Include="Ollama.Api" Version="0.9.25" />
<PackageReference Include="Ollama.Api" />
paket add Ollama.Api --version 0.9.25
#r "nuget: Ollama.Api, 0.9.25"
#:package Ollama.Api@0.9.25
#addin nuget:?package=Ollama.Api&version=0.9.25
#tool nuget:?package=Ollama.Api&version=0.9.25
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
Copyright � Panoramic Data Limited 2025
Contributing
Contributions are welcome! Please open issues or submit pull requests on GitHub.
Repository
Product | Versions 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. |
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
- Refit (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# 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.