AIRouter.Core 0.0.1

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

AIRouter

AIRouter is a library-first AI provider router for .NET 10. Use it directly from any .NET application, optionally expose an OpenAI-compatible /v1 API from your own ASP.NET Core host, or run the ready-made AiRouter.Server gateway/container.

Packages

There are exactly two public NuGet packages.

AIRouter.Core

Use AIRouter.Core in console apps, workers, Windows services, desktop apps, MCP servers, or any other .NET project. Core includes provider management, built-in OpenAI-compatible upstream providers, fallback and round-robin routing, Responses support, streaming, health/cooldown behavior, and in-memory provider/route stores.

<PackageReference Include="AIRouter.Core" Version="0.1.0" />
var services = new ServiceCollection();
services.AddAiRouter();

await using var serviceProvider = services.BuildServiceProvider();
var providers = serviceProvider.GetRequiredService<IProviderManager>();
var router = serviceProvider.GetRequiredService<IAiRouter>();

SQLite is not required. Applications can keep the default in-memory stores or replace IProviderStore and IRouteStore with their own persistence.

AIRouter.AspNetCore

Add AIRouter.AspNetCore when your application should expose the OpenAI-compatible API. It depends on AIRouter.Core and only adds ASP.NET Core hosting integration.

<PackageReference Include="AIRouter.AspNetCore" Version="0.1.0" />
builder.Services
    .AddAiRouter()
    .AddAiRouterAspNetCore();

var app = builder.Build();
app.MapAiRouterOpenAiEndpoints();

This maps:

  • POST /v1/chat/completions
  • POST /v1/responses
  • GET /v1/models

See docs/library-usage.md for provider, route, custom-host, and streaming examples.

Optional standalone server

AiRouter.Server is optional. It composes Core, ASP.NET hosting, and internal SQLite persistence into a ready-made gateway. Applications embedding AIRouter should depend on the NuGet packages instead of the server project.

The release container is available from GHCR:

docker run --rm \
  -p 8080:8080 \
  -v ai-router-data:/data \
  ghcr.io/dhhieu113pro/ai-router:latest

The server exposes /health and the OpenAI-compatible /v1 routes. By default SQLite is stored at /data/ai-router.db.

Optional server keys:

AIROUTER_API_KEY    Protects /v1 routes when configured
AIROUTER_ADMIN_KEY  Enables and protects management routes when configured

Releases

Push a semantic-version tag such as v0.1.0 from a commit contained in main.

The dedicated release workflow then:

  1. restores, builds, and tests the solution,
  2. packs and smoke-tests AIRouter.Core and AIRouter.AspNetCore,
  3. publishes both packages to NuGet.org through trusted publishing,
  4. publishes linux/amd64 and linux/arm64 server images to GHCR as 0.1.0, 0.1, and latest.

NuGet.org trusted publishers for both package IDs must target repository dhhieu113pro/ai-router, workflow .github/workflows/release.yml, and GitHub environment production. No long-lived NuGet API-key repository secret is required.

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AIRouter.Core:

Package Downloads
AIRouter.AspNetCore

ASP.NET Core OpenAI-compatible hosting adapter for AIRouter.Core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 39 9/6/2026
0.0.3 40 9/6/2026
0.0.2 45 9/6/2026
0.0.1 87 9/5/2026