Skip to main content

GitHub All-Stars #10: llm-council – AI Consensus mechanism

Picture of Artur Skowroński, Head of Java/Kotlin Space

Artur Skowroński

Head of Java/Kotlin Space
Dec 3, 2025|16 min read
cubes_layered
AI_council_members_at_the_table

stackoverflow_chatgpt_meme

1async def query_model(model_name, messages,...):
2 try:
3 response = await client.chat.completions.create(
4 model=model_name,
5 messages=messages,
6 #... parametry
7 )
8 return response.choices.message.content
9 except Exception as e:
10 # Graceful degradation - system nie wybuchnie, jeśli jeden model padnie
11 print(f"Model {model_name} failed: {e}")
12 return None
1You are the Chairman of an LLM Council. Multiple AI models have provided responses to a user's question, and then ranked each other's responses.
2
3Original Question: {user_query}
4
5STAGE 1 - Individual Responses:
6{stage1_text}
7
8STAGE 2 - Peer Rankings:
9{stage2_text}
10
11Your task as Chairman is to synthesize all of this information into a single, comprehensive, accurate answer to the user's original question. Consider:
12- The individual responses and their insights
13- The peer rankings and what they reveal about response quality
14- Any patterns of agreement or disagreement
15
16Provide a clear, well-reasoned final answer that represents the council's collective wisdom:
17(...)
18
19IMPORTANT: Your final ranking MUST be formatted EXACTLY as follows:
20- Start with the line "FINAL RANKING:" (all caps, with colon)
21- Then list the responses from best to worst as a numbered list
22- Each line should be: number, period, space, then ONLY the response label (e.g., "1. Response A")
23- Do not add any other text or explanations in the ranking section
github_star

Subscribe to our newsletter and never miss an article