LeapAi.SDK
2.0.1
dotnet add package LeapAi.SDK --version 2.0.1
NuGet\Install-Package LeapAi.SDK -Version 2.0.1
<PackageReference Include="LeapAi.SDK" Version="2.0.1" />
<PackageVersion Include="LeapAi.SDK" Version="2.0.1" />
<PackageReference Include="LeapAi.SDK" />
paket add LeapAi.SDK --version 2.0.1
#r "nuget: LeapAi.SDK, 2.0.1"
#:package LeapAi.SDK@2.0.1
#addin nuget:?package=LeapAi.SDK&version=2.0.1
#tool nuget:?package=LeapAi.SDK&version=2.0.1
<p align="center"> <img src="assets/leap_logo.png" alt="Ai-Logo" width="120"> </p>
Leap AI SDK
<p align="center"> <a href="https://www.nuget.org/packages/LeapAi.Sdk"><img src="https://img.shields.io/nuget/v/LeapAi.Sdk.svg" alt="NuGet" /></a> </p>
<p align="center"> <img src="assets/leap_banner.png" alt="Ai Banner" width="100%"> </p>
The Leap AI SDK is a provider-agnostic .NET toolkit designed to help you build AI-powered applications, chatbots, and agents. Built with a highly scalable, enterprise-grade architecture, it provides a unified, stateless service interface to interact with any language model.
AI Models
<p align="start"> <img src="assets/models/gpt.png" width="15%" /> <img src="assets/models/gemini.png" width="15%" /> <img src="assets/models/claude.png" width="15%" /> </p>
Installation
You will need the .NET SDK installed on your local development machine. You can find the package on NuGet.
dotnet add package LeapAi.Sdk
Available NuGet Packages
Leap AI SDK v2.0 introduces a modular architecture. You can install the fully-featured metapackage or adopt specifically what you need:
LeapAi.SDK: The all-in-one metapackage containing Core and all available providers.Leap.AI.Core: The bare-metal abstractions, unified models, and pipeline architecture.Leap.AI.Providers.OpenAi: Official OpenAI adapter (GPT-4o, o1, etc.).Leap.AI.Providers.Anthropic: Official Anthropic adapter (Claude 3.5 Sonnet, etc.).Leap.AI.Providers.Google: Official Google Gemini adapter (Gemini 1.5 Flash/Pro, etc.).Leap.AI.Extensions.DependencyInjection: Official builder extensions for ASP.NET CoreIServiceCollectionintegrations.
Unified Provider Architecture
Leap AI SDK v2.0 introduces a high-performance middleware pipeline architecture designed natively for .NET. It lets you plug in OpenAI, Anthropic, or Google Gemini and write strictly against a unified, model-agnostic LeapClient.
using Leap.AI.Core;
using Leap.AI.Providers.OpenAi;
using Leap.AI.Core.Models;
// 1. Build your client pipeline
var leap = LeapClient.Create()
.UseOpenAi("sk-...", "gpt-4o-mini") // Or .UseAnthropic() / .UseGoogle()
.UseLogging()
.UseRetry(maxRetries: 3)
.Build();
// 2. Generate
string result = await leap.GenerateTextAsync("Hello!");
Usage
Generating Text (Chat)
Generating conversational output is clean and simple. You can query models directly with raw strings or conversational histories.
var messages = new List<ChatMessage> {
ChatMessage.System("You are a helpful assistant."),
ChatMessage.User("What is an agent?")
};
var response = await leap.GenerateTextAsync(messages.ToString());
Console.WriteLine(response);
Streaming Text
The SDK natively leverages Server-Sent Events (SSE) providing an IAsyncEnumerable<ChatChunk>. It unifies the varying streaming schemas from Anthropic, Google, and OpenAI under a single interface.
await foreach (var chunk in leap.StreamAsync("Count to 3 quickly."))
{
Console.Write(chunk.Text);
}
Generating Structured Data (JSON)
The GenerateObjectAsync<T> method dynamically builds JSON Schema definitions strictly from your C# record or class definitions, complete with type enforcement, enum mapping, nullable safety, and validation retries.
public record Recipe(string Name, int PrepTimeMinutes, List<string> Ingredients);
var recipe = await leap.GenerateObjectAsync<Recipe>(
"Generate a simple chocolate chip cookie recipe."
);
Console.WriteLine($"Recipe: {recipe.Name} ({recipe.PrepTimeMinutes}m prep)");
Agents & Tool Calling
Leap AI v2.0 includes fully-automated tool calling execution. Just create a FunctionTool<T> definition, attach it to your client, and the SDK will automatically manage the round-trip loops required.
using Leap.AI.Core.Tools;
public record WeatherArgs(string City);
// 1. Define your tool
var weatherTool = FunctionTool<WeatherArgs>.Create(
name: "get_weather",
description: "Gets the current weather for a specific city.",
handler: args => $"The weather in {args.City} is sunny and 22C."
);
// 2. Register it when building the client
var leap = LeapClient.Create()
.UseOpenAi("sk-...")
.UseTool(weatherTool)
.Build();
// 3. The SDK automatically resolves the tool requests in the background!
var response = await leap.GenerateTextAsync("What's the weather like in Paris?");
Community
The Leap AI SDK community can be found on our GitHub repository where you can ask questions, voice ideas, and share your projects with other people.
Contributing
Contributions to the Leap AI SDK are welcome and highly appreciated. Stay tuned for our Contribution Guidelines to make sure you have a smooth experience contributing!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- LeapAi.SDK.Core (>= 2.0.1)
- LeapAi.SDK.Providers.Anthropic (>= 2.0.1)
- LeapAi.SDK.Providers.Google (>= 2.0.1)
- LeapAi.SDK.Providers.OpenAi (>= 2.0.1)
- LeapAi.SDK.Providers.xAI (>= 2.0.1)
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 |
|---|---|---|
| 2.0.1 | 107 | 4/30/2026 |
| 2.0.0 | 90 | 4/30/2026 |
| 2.0.0-preview.1 | 56 | 4/19/2026 |
| 1.0.1 | 105 | 4/1/2026 |
| 1.0.0 | 116 | 3/27/2026 |