pi-fable-fusion
v0.1.0
Published
Local Fable Fusion-style multi-model panel and judge for Pi, using already configured Pi providers.
Maintainers
Readme
pi-fable-fusion
Local Fable Fusion-style multi-model pipeline for Pi, using providers already configured in Pi. No OpenRouter account is required.
Inspired by OpenRouter's Fusion announcement: run a panel of models in parallel, have a judge compare them, then stream a synthesis grounded in consensus, contradictions, partial coverage, unique insights, and blind spots. pi-fable-fusion does this locally through Pi's configured providers and credentials.
Install
Drop the directory into ~/.pi/agent/extensions/:
git clone <this-repo> ~/.pi/agent/extensions/pi-fable-fusionReload with /reload.
For one-off local development, run Pi with this extension explicitly:
pi -e ./index.tsThe current docs install Pi as @earendil-works/pi-coding-agent:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentThis workspace is currently compatible with the locally installed @mariozechner/[email protected] package.
Typecheck (optional, pi loads via jiti at runtime):
cd ~/.pi/agent/extensions/pi-fable-fusion
npm install
npx tsc --noEmitSmoke-test the judge parser + preset resolution:
bun test.tsPrerequisites
pi-fable-fusion can use whatever providers you already configured in Pi. At least one provider must be available:
| Provider | How to log in |
|---|---|
| Anthropic (Claude Pro/Max) | /login -> "Claude Pro/Max" |
| OpenAI (ChatGPT Plus/Pro Codex) | /login -> "ChatGPT Plus/Pro (Codex)" |
| Google Gemini | export GEMINI_API_KEY=... or /login |
| DeepSeek, Mistral, Groq, xAI, Kimi | respective API keys |
Run /fable-fusion-status to see which providers are wired up.
Usage
As a slash command
/fable-fusion Should I use Postgres or MongoDB for a read-heavy analytics workload?Streams a synthesis grounded in the panel's structured agreement map.
As a tool the LLM can call
The LLM sees fable_fusion_run and may invoke it for hard questions:
"Compare JWT refresh token rotation strategies in FastAPI"
The LLM calls
fable_fusion_run({question: "..."}), gets a structured analysis, writes the final answer.
As a synthetic model
/model pi-fable-fusion/qualityThen ask anything. The stream handler runs the panel+judge and streams the synthesis as if it were a single model.
Presets
| Preset | Panel | Judge | Cost | Use when |
|---|---|---|---|---|
| budget | Gemini Flash + GPT-5-mini + DeepSeek, filtered to configured providers | Best available configured judge | lower | You want a cheaper diverse panel |
| quality (default) | Opus + GPT-5 + Gemini Pro, filtered to configured providers | Best available configured judge | higher | You want the strongest local panel |
| configured | Pi's current configured model catalog, ranked for strong text models and provider diversity | Best available configured judge | varies | You want Pi to use whatever providers are already set up |
| self | current model × 2 | current model | lowest | You only have one configured provider |
Switch preset with /fable-fusion-preset budget|quality|configured|self.
If a preset has members with no credentials, the runner drops them. If nothing survives, it falls back to self-fusion on the current model, so it works as long as one Pi provider is configured.
What the panel returns
The judge produces a JSON landscape:
{
"consensus": "Points all or most models agreed on (treated as high-confidence).",
"contradictions": [{"models": ["a", "b"], "conflict": "...", "resolution": "..."}],
"partial_coverage": [{"model": "a", "gap": "...", "relevant_for": "..."}],
"unique_insights": [{"model": "a", "insight": "...", "confidence": "high|medium|low"}],
"blind_spots": [{"all_models": ["a","b","c"], "blind_spot": "..."}]
}The outer model uses this as ground truth for the final synthesis. This follows the same contract shape as OpenRouter's Fusion, but runs through local Pi provider configuration.
If the selected outer synthesis model has no cached auth, pi-fable-fusion returns the structured analysis directly. If every judge candidate fails to return parseable JSON, it degrades to a transparent fallback analysis: healthy panel responses are surfaced as low-confidence unique insights, empty responses are marked as non-contributing partial coverage, and the blind spot states that the structured judge did not map contradictions.
Files
index.ts- entry. Registers the provider, tool, and commands.commands.ts- tool and slash command registration.provider.ts- synthetic/model pi-fable-fusion/<preset>provider.state.ts- session model/auth cache.synthesis.ts- final grounded synthesis stream.runner.ts- the panel+judge pipeline (runPanel,runJudge,makeFusionRunner).judge.ts- judge system prompt + tolerant JSON parser.presets.ts-budget/quality/configured/selfpanel configs + availability resolution.
What this is NOT
- Not a perfect reproduction of OpenRouter's pipeline (no server-side
web_search/web_fetchfor panel members; the panel is text-only). - Not a research benchmark. The preset model choices are local heuristics inspired by the OpenRouter blog, not measurements on your hardware.
- Not a
response_format-based JSON judge; the judge prompt asks for JSON and we parse tolerantly. Trade-off: works across all providers without per-provider schema gymnastics. - Not guaranteed to force every configured provider to produce usable text. Empty provider responses are treated as non-contributing panel members.
License
MIT. Use at your own risk. The pipeline calls N+1 models per question, so costs scale accordingly.
