SharpAIKit 0.3.0
dotnet add package SharpAIKit --version 0.3.0
NuGet\Install-Package SharpAIKit -Version 0.3.0
<PackageReference Include="SharpAIKit" Version="0.3.0" />
<PackageVersion Include="SharpAIKit" Version="0.3.0" />
<PackageReference Include="SharpAIKit" />
paket add SharpAIKit --version 0.3.0
#r "nuget: SharpAIKit, 0.3.0"
#:package SharpAIKit@0.3.0
#addin nuget:?package=SharpAIKit&version=0.3.0
#tool nuget:?package=SharpAIKit&version=0.3.0
SharpAIKit
A unified .NET large-model application and agentic AI development framework.
Overview
SharpAIKit is a comprehensive AI/LLM toolkit for .NET that provides a unified interface for working with large language models, building AI agents, and implementing RAG (Retrieval-Augmented Generation) applications. It's designed to be more powerful and simpler than LangChain, with killer features that leverage the .NET ecosystem.
Key Features
Core Capabilities
- Unified LLM Interface - One API for all OpenAI-compatible models
- LCEL-style Chains - Elegant chain composition with pipe operators
- Multiple Memory Strategies - Buffer, Window, Summary, Vector, and Entity memory
- Advanced Agents - ReAct, Plan-and-Execute, and Multi-Agent systems
- RAG Engine - Built-in document indexing and intelligent Q&A
- Full Observability - Console, logging, metrics, and file tracing
Killer Features Beyond LangChain
- 🔮 Native C# Code Interpreter - Execute C# code directly using Roslyn, no Python needed
- 🕸️ SharpGraph - Graph-based orchestration with FSM, supports loops and complex branches
- 🧬 DSPy-style Optimizer - Automatically optimize prompts through iterative improvement
Installation
dotnet add package SharpAIKit
Quick Start
using SharpAIKit.LLM;
// Create a client for any OpenAI-compatible API
var client = LLMClientFactory.Create(
apiKey: "your-api-key",
baseUrl: "https://api.deepseek.com/v1",
model: "deepseek-chat"
);
// Simple chat
var response = await client.ChatAsync("Hello!");
Console.WriteLine(response);
// Streaming output
await foreach (var chunk in client.ChatStreamAsync("Tell me a story"))
{
Console.Write(chunk);
}
Supported LLM Providers
SharpAIKit supports all OpenAI-compatible APIs, including:
- OpenAI
- DeepSeek
- Qwen (Alibaba)
- Mistral
- Yi (01.AI)
- Groq
- Moonshot (Kimi)
- Zhipu GLM
- Ollama (Local)
- Any custom OpenAI-compatible endpoint
Example: Code Interpreter
using SharpAIKit.CodeInterpreter;
var interpreter = new RoslynCodeInterpreter();
var result = await interpreter.ExecuteAsync<double>("Math.Pow(3, 5)");
Console.WriteLine($"3^5 = {result}"); // Output: 243
Example: Graph Orchestration
using SharpAIKit.Graph;
var graph = new SharpGraphBuilder("start")
.Node("start", async state => {
state.NextNode = "process";
return state;
})
.Node("process", async state => {
state.Output = "Done";
state.ShouldEnd = true;
return state;
})
.Build();
var result = await graph.ExecuteAsync();
Example: Prompt Optimization
using SharpAIKit.Optimizer;
var optimizer = new DSPyOptimizer(client)
.AddExample("What is C#?", "C# is an object-oriented programming language...")
.SetMetric(Metrics.Contains);
var result = await optimizer.OptimizeAsync("Answer: {input}");
Console.WriteLine(result.OptimizedPrompt);
Documentation
For detailed documentation and examples, visit:
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions 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 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. |
-
net8.0
- Microsoft.CodeAnalysis.CSharp (>= 4.8.0)
- Microsoft.CodeAnalysis.Scripting (>= 4.8.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Http.Polly (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Polly (>= 8.2.1)
- System.Diagnostics.DiagnosticSource (>= 8.0.0)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.