FAIRouter for C# Is Now on NuGet and Picks a Model From 54 Built-In Options
The FAIRouter library for C# is now on NuGet, the .NET package catalog, in version 0.1.0, so you no longer need to build it from source. The router picks a language model for each task, either from your own list or from the 54 popular models bundled with the package. A separate judge model checks the answer and scores it from 0 to 1, and human feedback fine-tunes the weights. Installation takes one command, dotnet add package FAI.Router, and requires .NET 10. • The Quality, Balance and Price profiles can be switched on every request • The sufficiency bar works after three human feedback ratings • Connects to OpenRouter, FractalRouter or any OpenAI-compatible server
AI-processed from Habr AI; edited by Hamidun News
The FAIRouter library, which routes requests between language models, is now available on NuGet, the package catalog for the .NET platform. The package is called FAI.Router, the current version is 0.1.0, and you no longer need to build it from source. Models differ in price, speed and strengths, so FAIRouter picks the executor for each task itself, either from a list the developer provides or from the 54 popular models bundled with the package. A judge model checks the finished answer, and the router then learns from human feedback. The design has two parts: the router picks the model, the judge accepts or critiques the result, and both learn.
Installation and the first request
You need .NET 10 and an API key from a model provider. In its examples, the author uses OpenRouter and stores the key in the OPENROUTER_API_KEY environment variable. You create a console project the standard way, then add the package with dotnet add package FAI.Router.
After that, you call FaiRouter.FromOpenRouterAsync and pass it the key, a list of model identifiers and the path to the database file. In the example, the candidates are google/gemini-2.5-flash, openai/gpt-4.1-mini and anthropic/claude-haiku-4.5. The fai-router.db file stores the weights and the log of turns; if the file does not exist, it is created. If you do not specify a list of models, the choice is made among the 54 bundled models.
The AskAsync method returns a RouterAnswer object with four fields: Winner (the chosen model), Text (the answer), Score (the judge's score from 0 to 1) and Critic (item-by-item discrepancies between the request and the answer). If the task asked for four sections and a table, but the reply contains one section and no table, Critic will show it. By default, the judge is openai/gpt-4o-mini, accessed through the same provider.
Training, profiles and the sufficiency bar
Feedback is where it gets interesting. A human gives a score from 0 to 1, where 1 means an excellent answer and 0.2 a weak one. To submit it, you call router.Feedback, then Train with a set number of epochs, and then Save. The weights are saved in the database, and on similar tasks the router takes the accumulated experience into account. You can collect feedback and train the router less often, for example once a day. The log stores the text of requests, so keep that in mind.
Three ready-made profiles set the balance between price and quality: Quality, Balance and Price. Balance is the default, and you can change the profile on every request through the weights parameter.
There is another rule as well: find the models that can handle the task and pick the cheapest and fastest among them. This is what the sufficiency bar, bar, is for: the minimum probability that a human will like the answer. The Reached field shows whether any model made it to the bar. The bar starts working once at least three human feedback ratings have accumulated.
AskAsync also accepts a whole conversation. The task is determined from the user's last message, while the model sees the full history.
Your own models, tools and agents
There are three ways to connect: FromOpenRouterAsync for OpenRouter, FromFractalRouterAsync for FractalRouter, and FromOpenAiCompatibleAsync for any server that uses the OpenAI chat completions protocol. The last option also works for your own model. You have to specify the price of such a model yourself, for example Price(0, 0). If your server does not have the gpt-4o-mini model, you specify a different judge model in the judgeModel parameter.
You can route not only between models but also between tools and agents. To do this, you pass the FaiRouter constructor a list of BaseRoutedElement objects and a function that runs the chosen candidate. The example has two search options: deep-search (priced at 5 per million input tokens and 20 per million output tokens, with a speed of 30 tokens per second) and fast-search (priced at 1 and 2, with a speed of 200 tokens per second). For tools, these numbers are nominal; only their ratio matters. The developer writes the RunSearchAsync function: it launches the required search and returns text. Such candidates start with random weights, so at first they need your feedback.
License and documentation
The package is distributed under the Apache-2.0 license. The source code and detailed documentation are published on GitHub, and you can leave comments and questions in the issues section. All examples in the article were built on version 0.1.0. To try FAIRouter, a single install command and a few lines of code are enough. The authors cover the library's math, from the task vector and quality forecast to the judge and learning from feedback, in a separate article.
- Nov 2, 2026TJ Digital: 23% of AI-cited pages open with a direct answer, versus 14% of uncited ones
- Nov 2, 2026Arca gives AI agents finance tasks lasting up to 10 days, but leaves the trades to humans
- Nov 2, 2026Meta's Muse assistant keeps dossiers on loved ones and gets root on Ubuntu by default
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
Key Questions Answered
What are the key details on Installation and the first request?
You need .NET 10 and an API key from a model provider. In its examples, the author uses OpenRouter and stores the key in the OPENROUTER_API_KEY environment variable. You create a console project the standard way, then add the package with dotnet add package FAI.Router. After that, you call FaiRouter.FromOpenRouterAsync and pass it the key, a list of model identifiers and the path to the database file. In the example, the candidates are google/gemini-2.5-flash, openai/gpt-4.1-mini and anthropic/claude-haiku-4.5. The fai-router.db file stores the weights and the log of turns;
What are the key details on Training, profiles and the sufficiency bar?
Feedback is where it gets interesting. A human gives a score from 0 to 1, where 1 means an excellent answer and 0.2 a weak one. To submit it, you call router.Feedback, then Train with a set number of epochs, and then Save. The weights are saved in the database, and on similar tasks the router takes the accumulated experience into account. You can collect feedback and train the router less often, for example once a day. The log stores the text of requests, so keep that in mind. Three ready-made profiles set the balance between price and quality: Quality, Balance and Price. B
What are the key details on Your own models, tools and agents?
There are three ways to connect: FromOpenRouterAsync for OpenRouter, FromFractalRouterAsync for FractalRouter, and FromOpenAiCompatibleAsync for any server that uses the OpenAI chat completions protocol. The last option also works for your own model. You have to specify the price of such a model yourself, for example Price(0, 0). If your server does not have the gpt-4o-mini model, you specify a different judge model in the judgeModel parameter. You can route not only between models but also between tools and agents. To do this, you pass the FaiRouter constructor a list of B
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.