I Built a Council of AIs That Live in My Kubernetes Cluster
estimated read time: 7 minutes
I Built a Council of AIs That Live in My Kubernetes Cluster
Some decisions are too big for a single perspective. I’ve been running an AI assistant in my homelab — OpenClaw, backed by Claude, which I call Jarvis — and it’s genuinely useful for day-to-day questions. But occasionally a question comes along where I want more than one opinion. Not a different model. A panel.
So I built one.
The Concept
The idea is simple: when Openclaw agent Jarvis encounters a question that warrants multiple perspectives, it can call a council. The council is a group of AI advisors, each running a different model on AWS Bedrock, each with a distinct specialism and personality. They deliberate, debate, vote, and return a verdict.
I called it Avengers Assemble.
| Avenger | Role | Model | Why this model |
|---|---|---|---|
| Banner | Head Researcher | Claude Sonnet 4.6 | Best long-form reasoning and evidence synthesis |
| Pepper | CFO | Nova Lite | Fast and cheap — fitting for someone watching the budget |
| Stark | CTO | Nova Pro | Amazon’s own architecture — different bias for tech decisions |
| Deadpool | Chief Fun Advisor | Mistral Large | Noticeably more unpredictable and lateral — creative chaos |
| Strange | Chief Health Advisor | Nova Lite | Conversational, considers the human cost |
| Baldrick | Perspective | Nova Micro | Cheapest model, deliberately simple — says the obvious thing |
Model selection wasn’t arbitrary. Deadpool runs on Mistral because it genuinely behaves more laterally than the others. Baldrick runs on Nova Micro — the cheapest, simplest model — because his job is to say the thing everyone else missed by being too sophisticated. Pepper runs Nova Lite because she’s watching the budget; it felt right.
How It Works
Jarvis posts a question to a webhook. That triggers a k3s Job — Mission Control — which fans out to all six Avengers in parallel via the AWS Bedrock API. But it’s not just a parallel call and aggregate. There are three phases:
1. Opening Statements
All Avengers respond to the question simultaneously, with no knowledge of each other’s answers. This avoids anchoring bias — nobody is influenced by the first response.
2. Debate Rounds
Each Avenger then reads the full transcript of the previous round and responds again. This is configurable — zero to five rounds. With debate rounds, Pepper might push back on Stark’s architecture recommendation on cost grounds. Deadpool will probably say something that makes everyone uncomfortable but is actually correct.
3. Binding Vote
After debate, each Avenger casts a binding YES / NO / ABSTAIN vote with a stated reason. The tally determines the outcome: Approved, Rejected, or Inconclusive.
If the vote ties, the council goes to a tie-break round — up to three times. On the third tie, the session is declared inconclusive and everyone loses a reputation point, because the council failed to decide.
The Reputation System
This is the part I’m most pleased with.
Every Avenger starts with a reputation score of 100, persisted in Postgres between sessions. The rules are simple:
- Vote with the majority → +10 reputation
- Vote against the majority → -1 reputation
- Abstain → -1 reputation (you’re here to vote, not watch)
- Session ends inconclusive (tied) → -1 for everyone (the council failed to decide)
If an Avenger’s score reaches zero, they are permanently eliminated from the council. They don’t come back.
WARN avenger=baldrick ELIMINATED — score reached 0. They will not return.
The asymmetry is deliberate. Winning votes are worth 10x a losing vote. An Avenger who is right 90% of the time will grow their score steadily. One who is consistently contrarian — voting no when everyone else votes yes, session after session — will bleed points slowly and eventually disappear.
There’s also a tie-break mechanism. If the vote is deadlocked, the council gets up to three tie-break rounds. If it’s still inconclusive after three attempts, the session is disbanded and everyone takes the -1 penalty. The council chair puts it bluntly in the prompt:
“If the council ties three times the session will be disbanded as inconclusive and everyone loses 1 reputation point. Make a decision.”
This creates emergent behaviour over time. An Avenger whose specialism is poorly calibrated for the kinds of questions being asked, or whose model genuinely diverges from the group’s reasoning, will gradually lose standing. The council self-selects for coherence.
Whether that’s a feature or a bug probably depends on the question.
Cost Controls
The whole thing runs on AWS Bedrock with a hard $5/month budget alert. Each session targets under $0.25. Every Avenger has a token cap (2,000 output tokens), and the service tracks estimated cost per session using per-model pricing:
fn cost_per_output_token(model_id: &str) -> f64 {
if model_id.contains("claude-sonnet") { return 15.0 / 1_000_000.0; }
if model_id.contains("nova-pro") { return 8.0 / 1_000_000.0; }
if model_id.contains("nova-lite") { return 0.2 / 1_000_000.0; } // approx
if model_id.contains("mistral-large") { return 8.0 / 1_000_000.0; }
// ...
}
With six Avengers at 2,000 tokens each plus two debate rounds, a full session runs around $0.08–$0.15 depending on the models involved. Baldrick, bless him, costs almost nothing.
The Stack
- Rust — the Mission Control service. Async fan-out with
tokio::spawn, structured JSON logs piped into my existing Loki stack - AWS Bedrock — all model calls, eu-west-1 region
- k3s Job — Mission Control runs as a Kubernetes Job, triggered by webhook from Jarvis
- PostgreSQL on Longhorn — sessions, verdicts, and reputation scores persist between council meetings
- Helm — packaged and deployed to the
avengersnamespace - Next.js dashboard — a simple UI for browsing past sessions, verdicts, and Avenger reputation scores
Does It Actually Work?
Yes, and it’s more interesting than I expected.
The council has run 22 sessions so far. Some highlights:
Should we migrate the homelab from k3s to full Kubernetes? — REJECTED, 4-1-1. Banner flagged the operational overhead wasn’t justified at this scale. Pepper pointed out the time cost with no meaningful return. Stark, the one yes vote, argued it was the architecturally correct move regardless. The council overruled him.
Should the Avengers adopt AI assistants to help manage the homelab? — APPROVED, 5-0-1. The council voted yes on their own adoption. Deadpool presumably abstained out of principle.
Debate the optimal agent setup in Claude Code blending different models for cost-effective SRE results — APPROVED, 6-0-0. A meta session: a council of AI models debating how best to use AI models. Banner produced a structured cost analysis. Deadpool suggested something nobody else would have considered.
The model diversity genuinely matters. Deadpool, running on Mistral, consistently surfaces the lateral take that the other models miss — and currently holds the highest reputation score on the council at 237. The chaos agent is, statistically, the most reliable voter.
Baldrick, running on Nova Micro (the cheapest model available), tends to say the obvious thing in plain English. Sometimes that’s the right answer. The council respects it enough that he’s still in the room.
The source is at github.com/dfoulkes/avengers-assemble if you want to poke around.