FAI.Router 0.1.0

dotnet add package FAI.Router --version 0.1.0
                    
NuGet\Install-Package FAI.Router -Version 0.1.0
                    
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="FAI.Router" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FAI.Router" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FAI.Router" />
                    
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 FAI.Router --version 0.1.0
                    
#r "nuget: FAI.Router, 0.1.0"
                    
#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 FAI.Router@0.1.0
                    
#: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=FAI.Router&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FAI.Router&version=0.1.0
                    
Install as a Cake Tool

FAIRouter

FAIRouter for .NET

Picks the right executor for each task and checks what it delivered.

FAIRouter is a library for routing requests between LLM models, agents and tools. It includes a judge that measures the result and training on feedback.

You have a dozen models and agents. Prices differ by orders of magnitude, speed by several times, and each model has its own strengths: one is good at code, another at writing. Sending everything to the strongest model is expensive, sending everything to the cheapest one loses quality, and choosing by hand for every task does not scale. FAIRouter makes that choice for you, then checks the result and learns from it.

  • Quality that is enough for the job. The router first filters out executors that are predicted to fall short of the required bar.
  • No paying for extra power. Among those that reach the bar, price and expected time decide, so a cheap model wins where it can cope.
  • Know what you got. The judge compares the finished answer with what was requested and reports the differences item by item. For example: 4 sections and a table requested, 1 section and no tables delivered.
  • Gets more accurate over time. Feedback accumulates, weights are trained, and candidates specialize by task type.

Installation

dotnet add package FAI.Router

Requires .NET 10.

Quick start

using FAI.Router;

FaiRouter router = await FaiRouter.FromOpenRouterAsync(
    apiKey: Environment.GetEnvironmentVariable("OPENROUTER_API_KEY")!,
    modelIds: ["google/gemini-2.5-flash", "openai/gpt-4.1-mini", "anthropic/claude-haiku-4.5"],
    databasePath: "fai-router.db");                 // weights and history, created if missing

RouterAnswer answer = await router.AskAsync("Write a 1500-character overview of clustering methods");

Console.WriteLine($"{answer.Winner.Name}: {answer.Score}");
Console.WriteLine(answer.Text);
Console.WriteLine(answer.Critic);                   // differences from the request, item by item

router.Feedback(answer.RoundId!.Value, score: 1.0); // from 0 (bad) to 1 (excellent)
router.Train(epochs: 10);
router.Save();

If you do not list any models, the choice is made among popular models bundled with the package.

Providers

Factory Provider
FaiRouter.FromOpenRouterAsync OpenRouter
FaiRouter.FromFractalRouterAsync FractalRouter
FaiRouter.FromOpenAiCompatibleAsync Any server with the OpenAI chat completions protocol

Your own candidates, executor and judge client are passed to the FaiRouter constructor, so the router can choose between agents and tools as well as models.

Licensed under Apache-2.0.

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

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
0.1.0 50 10/30/2026