Skip to main content

Fuse multiple AI models and judge the best answer for coding

Project description

Fuse Fable

🌐 Languages: English · ไทย (Thai)

Fan out a coding prompt to many AI models in parallel, then let a judge pick the single best answer — total latency ≈ x2 (slowest model + one judge pass), not x7–x15.

Works three ways: as a CLI, as an MCP server (connect Cursor / VS Code / Claude), and as a subagent / pipe (callable by other tools and scripts).

Install

pip install fusefable            # core
pip install "fusefable[mcp]"     # if you want the MCP server

From source:

git clone https://github.com/proultrax9/fusefable.git
cd fusefable
pip install -e ".[mcp]"

Setup (first run)

fusefable config
  • Choose AI Gateway → one key for everything, then it asks "how many models?" and prompts for each one.
    • Known gateways (base URL auto-filled): openrouter, groq, together, fireworks, deepinfra, novita, hyperbolic, aimlapi, portkey, deepseek, openai — any other works too, just type its base URL.
  • Or Single providers → it asks how many, then the API kind of each:
    • openai_compat — any OpenAI-compatible endpoint (you provide the base URL)
    • anthropic — Anthropic native (/v1/messages, base URL auto-filled)
    • google — Google Gemini native (generateContent, base URL auto-filled)

Set your API key as an environment variable named as the wizard asks:

export OPENROUTER_API_KEY=sk-...      # macOS/Linux
setx OPENROUTER_API_KEY "sk-..."      # Windows (open a new terminal afterwards)

Config is stored at ~/.fusefable/config.yaml.

1) Use as a CLI

fusefable ask "Write a quicksort function in Python"
fusefable ask --show-all "..."                   # show every answer + judge reason
fusefable ask --models gpt-5,qwen3-coder "..."   # restrict to specific models
fusefable ask --cheap "..."                      # use cheap_models from config
ff ask "..."                                      # short alias

2) Use as a subagent / in a pipe

fusefable ask --quiet "..."                # print only the answer (no headers)
echo "Explain this code" | fusefable ask --quiet   # read the prompt from stdin
cat bug.py | fusefable ask -q "Find the bug in this code"
fusefable ask --json "..."                 # JSON output: answer, chosen_model, reason, cost, candidates

--json is ideal for scripts/agents that parse the result; --quiet is ideal for piping.

3) Use as an MCP server (Cursor / VS Code / Claude / other agents)

Run as an MCP server over stdio:

fusefable mcp

Exposes a tool fuse_ask(question, models?, cheap?) for any MCP client.

Cursor

~/.cursor/mcp.json (or Settings → MCP):

{
  "mcpServers": {
    "fusefable": {
      "command": "fusefable",
      "args": ["mcp"],
      "env": { "OPENROUTER_API_KEY": "sk-..." }
    }
  }
}

VS Code (Copilot / MCP-compatible extension)

.vscode/mcp.json in your project:

{
  "servers": {
    "fusefable": {
      "command": "fusefable",
      "args": ["mcp"],
      "env": { "OPENROUTER_API_KEY": "sk-..." }
    }
  }
}

Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "fusefable": {
      "command": "fusefable",
      "args": ["mcp"],
      "env": { "OPENROUTER_API_KEY": "sk-..." }
    }
  }
}

Requires pip install "fusefable[mcp]" and a completed fusefable config. If fusefable isn't on the app's PATH, use a full path such as python -m fusefable.cli.

How it works

  1. Fan-out — every model is called concurrently via asyncio (total time = slowest model).
  2. Any model that times out or fails is dropped — it never slows the whole run.
  3. Judge — model names are anonymized (Answer A/B/C...) and a judge model picks the best.
  4. Returns the best answer plus an estimated cost.

Development

pip install -e ".[dev,mcp]"
pytest -q

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fusefable-0.1.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fusefable-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file fusefable-0.1.1.tar.gz.

File metadata

  • Download URL: fusefable-0.1.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fusefable-0.1.1.tar.gz
Algorithm Hash digest
SHA256 84987b2f3bbae2b5cb4078ee2529047206226ff895bcc8c4947ca6c9c146d591
MD5 29c67f3e41967f7234228a8f0a958bcc
BLAKE2b-256 15709876e2eba943d61ac65f4c05820c23f458cb28b43ad7fd59c092b1d99bb7

See more details on using hashes here.

File details

Details for the file fusefable-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fusefable-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fusefable-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2dd1c946eab76cf610f3b6d75aff4392b83f590293b5ef6d67f5955fd03177ee
MD5 eaf4fdb3a06735ba30ef18731306ac58
BLAKE2b-256 1f0d8d7d6408fe5937452162d958fb6f902e7f5799672c81e51288e15d140a92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page