
Truthroute
io.github.RudrenduPaul由 GitHub 帳號 RudrenduPaul 發布v0.1.4更新於 Oct 24, 2026
Sends the same prompt to multiple LLM providers in parallel and returns a divergence score via MCP.
概覽
一個本機 MCP 伺服器,把同一個提示詞送給多個 LLM 供應商,並回傳衡量回答差異程度的分歧分數。
- 可以做什麼
- 平行向 OpenAI、Anthropic 和 Gemini 送出提示詞,收集每個回答及其狀態與模型名稱。以本機句子嵌入計算分歧分數,並可透過重複執行提供信賴區間。當可用回答少於兩個時回報部分完成或失敗,並將拒答排除在評分之外。回傳代理可直接使用的結構化結果。
- 適用情境
- 適合 AI 安全與評估工作:需要為各供應商對某提示詞的一致或分歧程度提供可引用的數字,並希望從代理、指令碼或 CI 工作呼叫,而不必自行架設服務。
- 執行需求
- 透過 npx 從 npm 套件 truthroute-cli 以 stdio 在本機執行,需要 Node.js。所比較的供應商需以環境變數設定 API 金鑰(OPENAI_API_KEY、ANTHROPIC_API_KEY、GEMINI_API_KEY),只需為實際請求的供應商設定。需要連線至各廠商 API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Truthroute,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TruthRoute
[npm version] [CI] [License: MIT] [Node]
Send one prompt to multiple LLMs. Get a real, validated divergence score back. Not a vibe: a number computed from local sentence embeddings, checked against a hand-labeled agree/disagree/negation/paraphrase test set before it shipped.
Why this exists
AI-safety and eval researchers who want to know how much LLMs from different vendors agree or disagree on a given prompt currently have two bad options: build a one-off comparison script themselves, or use a hosted, non-programmable dashboard. Neither is embeddable in an eval pipeline, and neither publishes a checked methodology. TruthRoute is a scriptable primitive built for the second use case. Call it from a script, a CI job, or an MCP-capable agent, and get back a number you can actually cite.
Install
Or run it without installing:
You need API keys for whichever providers you compare, set as environment variables:
Only the providers you actually request need a key set.
[!WARNING] Every
comparecall makes real, billed calls against the vendor APIs for the providers you request. There is no free tier, because there is no hosted component at all. Use--dry-runto see the call count before spending anything.
Quickstart
For an agent to consume programmatically:
CLI reference
--json output shape
status is one of complete (all providers succeeded), partial (at least 2 usable responses, but not all providers succeeded, or one was excluded for refusal), or failed (fewer than 2 usable responses, so divergence_score is null; divergence has no meaning against a single data point).
Methodology, stated plainly
- Scoring: local sentence embeddings (
fastembed, modelBGESmallENV15). No paid API for scoring, only the 3 providers being compared. Divergence is1 - average pairwise cosine similarityacross all response pairs, in[0.0, 1.0]. - Validated, not assumed. The model was checked against a hand-labeled test set (
test/fixtures/validation-set.json) covering agreement, paraphrase, negation, and clear disagreement before shipping. A smaller embedding model (MiniLM-L6) was tried first and rejected during that check: it scored negation pairs as less divergent than paraphrases, the opposite of correct.BGESmallENV15was chosen because it passes that check. - Refusals are excluded from scoring, not just flagged. A refusal's text distance from a real answer is not factual disagreement, and would otherwise dominate the score.
- Responses are normalized before scoring (markdown and formatting stripped) so verbosity differences between providers aren't measured as semantic divergence.
- Determinism, stated plainly: all provider calls use
temperature=0, which reduces but does not eliminate run-to-run variance. Vendor-side inference infrastructure (GPU batching, floating-point non-associativity) can still cause drift independent of anything this tool controls. Use--repeats Nto get a confidence band instead of trusting a single score as exactly reproducible.
- A compressed score range is expected, not a bug. Cosine-similarity scores between two responses to the same topically-related prompt naturally compress into a smaller range than a naive 0-to-1 intuition suggests. The signal that matters is relative ordering (agreement scores lower than disagreement), which is what the validation set actually checks.
How this compares
duh is a full multi-model consensus platform: a propose/challenge/revise/commit debate protocol across 5 providers plus local models, with a web UI, REST API, WebSocket streaming, persistent SQLite/Postgres storage, auth, cost tracking, and PDF export. It is more mature and far more feature-complete than TruthRoute. TruthRoute is not trying to be a smaller version of it. TruthRoute does one narrow thing: score how much N providers' responses to the same prompt diverge, as a stateless CLI/MCP primitive with no server, no database, and no accounts to set up. If you want debate, dissent-tracking, and a full decision-audit platform, use duh. If you want a scriptable divergence number to drop into an existing eval pipeline or CI job with nothing to host, that is what TruthRoute is for.
TruthRoute is not an LLM gateway or router (see LiteLLM and Portkey). It does no routing, failover, or cost optimization. If you need those, use one of those tools. TruthRoute measures disagreement between providers; it doesn't route between them.
FAQ
What does this actually measure? How much the substantive content of N LLM responses to the same prompt differs, using local sentence-embedding similarity. It is not a fact-checker. It tells you providers disagree, not which one is right.
Do I need my own API keys? Yes. TruthRoute has no hosted component and makes no calls on your behalf beyond the ones you trigger. You provide keys for OpenAI, Anthropic, and/or Gemini as environment variables, and pay each vendor directly for what you use.
Is this safe to run against sensitive prompts? Any prompt you compare is sent to each vendor's API, the same as if you called them directly. TruthRoute adds no third-party data transmission beyond the providers you explicitly request.
Can an agent call this directly, not through a human running the CLI?
Yes. truthroute mcp runs an MCP server exposing compare as a typed tool over stdio for another agent to call. --json output is also available for scripts that shell out to the CLI directly.
Is this a library or just a CLI?
Both. It ships as an npm package with a CLI entry point (truthroute) and can be run via npx with no global install.
Why is the divergence score so much lower than I expected for two responses I'd say clearly disagree? See "A compressed score range is expected" above. This is a known property of cosine-similarity scoring on topically-related text, not a bug. The validated signal is relative ordering, not the absolute number.
Contributing
Issues and PRs welcome. Run npm test before submitting. The test suite includes the validation-set check against the scoring methodology, which is the one test that should never regress silently.
License
MIT
來源:README.md,提交 49c5150
工具
0版本歷史
1- v0.1.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分