Consensus voting
Every active provider answers in parallel; Legion returns the consensus, its strength, the reasoning and the dissenting views, under Plurality, SimpleMajority, TwoThirds or Unanimous quorum.
One model is an opinion. A panel is a decision.
MindAttic.Legion is a .NET 10 library and CLI that puts your question to a panel of LLMs, Claude, ChatGPT, Gemini, DeepSeek and more, and returns one answer with a quorum, the reasoning behind it and the dissent.
What it is
When a misclassification, a contradiction or a bad route is expensive, one model that sounds confident is not good enough. Legion asks every provider on the panel in parallel, tallies their answers against the quorum you choose, and tells you how strong the consensus is and who disagreed.
It speaks to thirteen provider connections through one LegionClient, plus any self-hosted OpenAI-compatible endpoint such as Ollama or vLLM. Ask for a Low, Medium or High tier and the catalog resolves the concrete model, so model-version churn stops being your problem. Failed voters are refilled from the providers still answering, so a panel never drops below quorum because one API had a bad minute.
Use it as a library, services.AddLLMVoting(...) and VoteAsync, DecideAsync or scoring, or as legion.exe, which lets a blocked coding agent get an architect-grade decision from the panel instead of waiting on a human.
Who it's for
legion ask hands a stuck Claude Code or Codex session a reasoned decision, with your repo's README and git state pulled in as context.Features
Every active provider answers in parallel; Legion returns the consensus, its strength, the reasoning and the dissenting views, under Plurality, SimpleMajority, TwoThirds or Unanimous quorum.
DecideAsync(question, options) turns a branch your code would otherwise guess at into one chosen option with a confidence.
Score work from 1 to 10 on each dimension, get aggregate scores, the weakest dimension and ready-to-inject improvement directives.
Claude, ChatGPT, Gemini, DeepSeek, Mistral, xAI, Groq, Together AI, OpenRouter, Fireworks AI, Cohere, Kimi and Perplexity, plus an explicit-URL option for self-hosted models.
Ask for Low through Highest; the nine mapped providers resolve each tier to a concrete model, so your code survives model releases.
Retry with backoff, a process-wide per-provider circuit breaker, refill of failed voters and a fallback chain keep the panel at quorum.
Give voters personas, score them on five instruments including Big Five and HEXACO with deterministic code-side scoring, and segment results by trait.
ask, poll, generate, vote, tiers, health and more run the same engine with no .NET app of your own.
Keys resolve per voter, then from configuration, then from the shared MindAttic.Vault credential store, so every app on the machine uses one set.
How it works
Send a question, optional context and a quorum, or a fixed list of options to choose from.
Each provider on the panel answers in parallel at the tier you asked for, optionally in a persona's voice.
Failed voters are replaced from the surviving providers, then the answers are tallied against the quorum.
You receive the consensus, its strength, the reasoning and the dissent, ready to act on or log.
Quick start
Keys come from your environment or the shared credential store; never hard-code them.
The full setup guide lives in the documentation.
var services = new ServiceCollection();
services.AddLogging();
services.AddLLMVoting(new VotingConfiguration
{
ApiKeys =
{
["claude"] = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ?? "",
["openai"] = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? "",
},
JudgeProviderId = "claude",
});
var voting = services.BuildServiceProvider().GetRequiredService<LlmVotingService>();
var result = await voting.VoteAsync("Should Kyle take the contract?", "Contract details: ...", Quorum.SimpleMajority);
Console.WriteLine($"Consensus: {result.Consensus} ({result.ConsensusStrength:P0})");Part of MindAttic
Legion is the family's decision engine. MindAttic apps and the coding agents that build them call it when a choice is too important for one model, and its keys come from the same MindAttic.Vault keyring every other app uses.
It is deliberately portable: the library depends only on MindAttic.Vault and Microsoft.Extensions.*, never on a specific MindAttic application, so it drops into any .csproj.
Status
Voting, deciding, scoring, judging, personas and the CLI are all built. The road to 28 stable is offline tests that prove the voting core, a correct health report for the default panel, current docs, and publishing 28 to nuget.org (which lists 26.0.0 today).
Current milestone: MindAttic.Legion 28 stable release.
Next step
Guides, reference and design notes are in the searchable MindAttic documentation. The source, issues and history are on GitHub.