Cisharpai 0.2.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cisharpai --version 0.2.2
                    
NuGet\Install-Package Cisharpai -Version 0.2.2
                    
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="Cisharpai" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cisharpai" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Cisharpai" />
                    
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 Cisharpai --version 0.2.2
                    
#r "nuget: Cisharpai, 0.2.2"
                    
#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 Cisharpai@0.2.2
                    
#: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=Cisharpai&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Cisharpai&version=0.2.2
                    
Install as a Cake Tool

Cisharpai

Core abstractions and shared logic for the Cisharpai unified LLM client library.

What is Cisharpai?

Cisharpai provides a common interface for interacting with multiple LLM providers (OpenAI, Azure OpenAI, Azure AI Inference, Anthropic, Cohere). Your application code depends only on this core package — provider-specific logic lives in separate packages.

Key Interfaces

  • IChatCompletionClient — unified chat completion across all providers
  • IEmbeddingClient — unified text embedding across all providers

Feature Collection Pattern

Optional capabilities are discovered at runtime via IHasFeatures.Features.Get<T>():

Feature Description
IJsonOutputFeature JSON Mode and Structured Outputs
IToolCallingFeature Function/tool calling
IStreamingChatFeature Token-by-token streaming
IGroundedChatFeature RAG with document citations
IImageEmbeddingFeature Image embeddings
IMultimodalEmbeddingFeature Mixed text + image embeddings

Quick Start

using Cisharpai;
using Cisharpai.Models;

// Use any provider package to get an IChatCompletionClient
var request = new ChatCompletionRequest(
    Messages: [new LlmMessage(LlmRole.User, "Hello!")],
    Model: "gpt-4.1-nano");

var response = await client.GetChatCompletionAsync(request);
Console.WriteLine(response.Content);

Design Principles

  • No exceptions for API errors — responses use IsSuccess/ErrorMessage
  • Debuggability — access RawRequestJson/RawResponseJson on any response
  • Immutability — all DTOs are immutable record types
  • Escape hatchExtraParameters deep-merges arbitrary JSON into requests

Provider Packages

Package Provider
Cisharpai.OpenAi OpenAI
Cisharpai.Azure Azure OpenAI & Azure AI Inference
Cisharpai.Anthropic Anthropic (Claude)
Cisharpai.Cohere Cohere
Cisharpai.Testing Fake clients for unit testing
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 is compatible.  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 (5)

Showing the top 5 NuGet packages that depend on Cisharpai:

Package Downloads
Cisharpai.Testing

Unified .NET client library for chat completions and embeddings across multiple LLM providers.

Cisharpai.OpenAi

Unified .NET client library for chat completions and embeddings across multiple LLM providers.

Cisharpai.Azure

Unified .NET client library for chat completions and embeddings across multiple LLM providers.

Cisharpai.Cohere

Unified .NET client library for chat completions and embeddings across multiple LLM providers.

Cisharpai.Anthropic

Unified .NET client library for chat completions and embeddings across multiple LLM providers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.12.202 53 5/19/2026
0.3.0-alpha.11.197 62 5/15/2026
0.3.0-alpha.10.196 62 5/15/2026
0.3.0-alpha.9.186 76 5/8/2026
0.3.0-alpha.8.185 74 5/8/2026
0.3.0-alpha.7.164 62 5/6/2026
0.3.0-alpha.6.161 70 5/6/2026
0.3.0-alpha.5.159 63 5/6/2026
0.3.0-alpha.5.155 66 5/6/2026
0.3.0-alpha.4.156 64 5/6/2026
0.3.0-alpha.4.154 59 5/6/2026
0.3.0-alpha.3.150 62 4/30/2026
0.3.0-alpha.2.145 55 4/30/2026
0.2.2 178 4/30/2026
0.2.2-beta.1.147 52 4/30/2026
0.2.2-beta.1.146 53 4/30/2026
0.2.1 177 4/30/2026
0.2.1-beta.1.142 51 4/30/2026
0.2.1-beta.1.140 56 4/30/2026
0.2.1-beta.1.138 50 4/30/2026
Loading failed