llm-council

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LLM Council

LLM Council

Karpathy's LLM Council pattern with Anthropic and OpenAI-compatible providers.
Karpathy 的 LLM Council 模式,支持 Anthropic 和兼容 OpenAI 的提供商。

When to use

何时使用

  • High-stakes plan review (
    /plan
    crosses N-file threshold)
  • Conflicting learning-rules → re-resolve via vote
  • User invokes
    /council "<query>"
    or
    /wiki council
  • Architecture decisions where you want multiple viewpoints captured
  • Persisting deliberation as a wiki page for future reference
  • 高风险计划评审(
    /plan
    跨越 N 文件阈值)
  • 学习规则存在冲突 → 通过投票重新裁决
  • 用户调用
    /council "<query>"
    或
    /wiki council
  • 希望在架构决策中记录多个观点
  • 将协商记录持久化为 wiki 页面,供日后参考

Three phases

三个阶段

  1. Independent: each model answers in parallel
  2. Ranking: each model ranks anonymized peer responses
  3. Synthesis: chairman model reads all responses + rankings → final answer
  1. 独立回答:每个模型并行作答
  2. 排名:每个模型对匿名的同级回答进行排名
  3. 综合:主席模型读取所有回答和排名 → 最终答案

Provider config

提供商配置

Configure optional keys in the plugin configuration dialog. Use the
providers
MCP server's
run_provider_task
tool with
task: "council"
and
args: ["run", "<query>", "--provider", "openai"]
. For provider status, pass
args: ["providers"]
. Never request keys in chat or read them from existing credentials or shell configuration.
For standalone CLI use, explicitly set a pro-workflow-specific variable below. The first configured provider is the default;
--provider
selects one explicitly. See provider configuration.
Standalone CLI variableProviderDefault base URL
PRO_WORKFLOW_ANTHROPIC_API_KEY
Anthropic
https://api.anthropic.com
PRO_WORKFLOW_OPENAI_API_KEY
OpenAI
https://api.openai.com/v1
PRO_WORKFLOW_OPENROUTER_API_KEY
OpenRouter
https://openrouter.ai/api/v1
PRO_WORKFLOW_FIREWORKS_API_KEY
Fireworks
https://api.fireworks.ai/inference/v1
LLM_COUNCIL_BASE_URL
+
PRO_WORKFLOW_LLM_COUNCIL_API_KEY
Custom OpenAI-compat(user-supplied)
Override per-run with
--provider openai|anthropic|openrouter|fireworks|custom
.
Default model rosters per provider live in
scripts/council.js
and can be overridden via
--models
CSV and
--chairman <id>
.
在插件配置对话框中配置可选的 API 密钥。使用
providers
MCP 服务器的
run_provider_task
工具,并设置
task: "council"
和
args: ["run", "<query>", "--provider", "openai"]
。若要查询提供商状态,请传入
args: ["providers"]
。切勿在聊天中索要密钥,也不要从现有凭据或 shell 配置中读取它们。
对于独立 CLI 使用场景,请显式设置下面的 pro-workflow 专用变量。首个已配置的提供商为默认提供商;
--provider
可显式选择某个提供商。请参阅提供商配置。
独立 CLI 变量提供商默认基础 URL
PRO_WORKFLOW_ANTHROPIC_API_KEY
Anthropic
https://api.anthropic.com
PRO_WORKFLOW_OPENAI_API_KEY
OpenAI
https://api.openai.com/v1
PRO_WORKFLOW_OPENROUTER_API_KEY
OpenRouter
https://openrouter.ai/api/v1
PRO_WORKFLOW_FIREWORKS_API_KEY
Fireworks
https://api.fireworks.ai/inference/v1
LLM_COUNCIL_BASE_URL
+
PRO_WORKFLOW_LLM_COUNCIL_API_KEY
自定义 OpenAI 兼容提供商(用户提供)
每次运行均可通过
--provider openai|anthropic|openrouter|fireworks|custom
覆盖。
各提供商的默认模型名单位于
scripts/council.js
中,也可通过
--models
CSV 和
--chairman <id>
覆盖。

Commands

命令

In a plugin session, pass these runner arguments through
run_provider_task
. The direct commands below are for standalone CLI installations with explicit credentials.
node $SKILL_ROOT/scripts/council.js run "<query>" [--models id1,id2,id3] [--chairman id] [--provider <name>] [--wiki <slug>]
node $SKILL_ROOT/scripts/council.js providers
node $SKILL_ROOT/scripts/council.js show <session-id>
--wiki <slug>
writes the full transcript to
<wiki>/derived/council/<session-id>.md
and registers it via
wiki-cli.js page
so it shows in FTS5 search.
在插件会话中,通过
run_provider_task
传递以下 runner 参数。以下直接命令用于安装了独立 CLI 且已显式配置凭据的环境。
node $SKILL_ROOT/scripts/council.js run "<query>" [--models id1,id2,id3] [--chairman id] [--provider <name>] [--wiki <slug>]
node $SKILL_ROOT/scripts/council.js providers
node $SKILL_ROOT/scripts/council.js show <session-id>
--wiki <slug>
会将完整的协商记录写入
<wiki>/derived/council/<session-id>.md
,并通过
wiki-cli.js page
注册,使其显示在 FTS5 搜索结果中。

Output

输出

Each session writes:
~/.pro-workflow/council/<session-id>/
├── config.json           # query, models, chairman, provider
├── phase1_responses.json # raw API responses per model
├── phase2_rankings.json  # anonymized ranking outputs
├── phase3_synthesis.txt  # chairman's final answer
└── final_output.md       # human-readable bundle
Console prints the markdown bundle. Pipe to
pbcopy
/
tee
as needed.
每次会话会写入:
~/.pro-workflow/council/<session-id>/
├── config.json           # query, models, chairman, provider
├── phase1_responses.json # raw API responses per model
├── phase2_rankings.json  # anonymized ranking outputs
├── phase3_synthesis.txt  # chairman's final answer
└── final_output.md       # human-readable bundle
控制台会打印 Markdown 包。可根据需要通过
pbcopy
/
tee
进行管道传输。

Hard rules

硬性规则

  1. Never skip the ranking phase. It's the core of the council pattern.
  2. Save raw responses to disk verbatim. No summarization in storage.
  3. Anonymize responses for ranking — models see
    Response A/B/C/...
    , not peer names.
  4. The chairman sees both real names AND rankings.
  5. Display all three phases to the user. No phase elision.
  1. 绝不能跳过排名阶段。这是 council 模式的核心。
  2. 将原始响应原样保存到磁盘。存储时不得进行摘要处理。
  3. 排名时必须匿名处理响应——模型看到的是
    Response A/B/C/...
    ,而不是同级模型的名称。
  4. 主席模型必须同时看到真实名称和排名。
  5. 向用户展示全部三个阶段,不得省略任何阶段。

Cost awareness

成本注意事项

The script logs per-call latency + tokens on supported providers. Multiply by your provider rate to estimate. Council cost grows linearly with
len(models)^2
(each model ranks all others) plus the chairman.
Default council size: 3-5 models. More models = exponentially more ranking calls.
对于受支持的提供商,脚本会记录每次调用的延迟和 token 数。乘以相应提供商的费率即可估算费用。LLM Council 的成本随
len(models)^2
线性增长(每个模型都要对其他所有模型进行排名),另加主席模型的调用成本。
默认 council 规模:3–5 个模型。模型越多,排名调用次数就会呈指数级增长。

Use with wiki

与 wiki 配合使用

/wiki council agent-memory "should we adopt episodic memory in our agents?"
Loads
agent-memory
wiki context as system prompt prefix, runs council, persists transcript as
wiki/derived/council/<id>.md
. The transcript becomes searchable via
/wiki ask
.
/wiki council agent-memory "should we adopt episodic memory in our agents?"
加载
agent-memory
wiki 上下文作为 system prompt 前缀,运行 council,并将协商记录持久化为
wiki/derived/council/<id>.md
。该记录可通过
/wiki ask
搜索。