AIRouter.Core
0.0.1
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
<PackageReference Include="AIRouter.Core" Version="0.0.1" />
<PackageVersion Include="AIRouter.Core" Version="0.0.1" />
<PackageReference Include="AIRouter.Core" />
paket add AIRouter.Core --version 0.0.1
#r "nuget: AIRouter.Core, 0.0.1"
#:package AIRouter.Core@0.0.1
#addin nuget:?package=AIRouter.Core&version=0.0.1
#tool nuget:?package=AIRouter.Core&version=0.0.1
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/completionsPOST /v1/responsesGET /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:
- restores, builds, and tests the solution,
- packs and smoke-tests
AIRouter.CoreandAIRouter.AspNetCore, - publishes both packages to NuGet.org through trusted publishing,
- publishes
linux/amd64andlinux/arm64server images to GHCR as0.1.0,0.1, andlatest.
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 | 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
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.