One API call. A team of models. One superior answer.
A dynamic multi-model deliberation engine that fuses the best of every AI model into a single, structured output.
No single AI model is best at everything. DeepSeek V4 excels at coding but misses nuance in creative work. Claude Sonnet 4 is a brilliant writer but weaker at structured reasoning. Kimi K2.7 leads code benchmarks but struggles with broad analysis. Picking one model means accepting its blind spots.
Today's "model routing" tools pick one model per task. Multi-model "fusion" products give identical prompts to every model — wasting tokens on duplicate work. Neither captures the power of collaborative intelligence: different models tackling different aspects of a problem, then merging their insights.
Chimera is a dynamic deliberation engine. A single "dispatcher" model analyzes your prompt, designs a custom processing pipeline (DAG), assigns domain-specific subtasks to the best models for each, and an aggregator merges their work using dispatcher-written instructions. The result: an answer that's stronger than any single model could produce — at a fraction of the cost of running every model on every query.
┌─────────────────────────────────────────────────────────────┐ │ CLIENT │ │ POST /v1/chat/completions │ │ { "model": "auto", "messages": [...] } │ └────────────────────────┬────────────────────────────────────┘ ▼ ┌─────────────────────────────────────────────────────────────┐ │ DISPATCHER (1 call) │ │ Analyzes task → Designs DAG → Picks models by category │ │ → Writes per-worker custom prompts → Writes merge recipe │ └──────┬──────────────┬──────────────┬────────────────────────┘ ▼ ▼ ▼ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ Worker A │ │ Worker B │ │ Worker C │ │ Code-focused │ │ Design-focus │ │ Analysis │ │ (DeepSeek │ │ (Claude │ │ (GLM-5.2) │ │ V4 Pro) │ │ Sonnet 4) │ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬────────┘ │ │ │ └────────────────┼────────────────┘ ▼ ┌─────────────────────────────────────────────────────────────┐ │ AGGREGATOR (1 call) │ │ Merges heterogeneous results using dispatcher's recipe │ │ → Structured output (JSON Schema) → Final answer │ └─────────────────────────────────────────────────────────────┘
Dispatcher → Workers (parallel) → Aggregator. One dispatcher designs the entire run.
Models scored on 32 hierarchical category paths (code, analysis, reasoning, design, audit). The dispatcher matches task domains to model strengths automatically — with per-request overrides.
Not a fixed pipeline. The dispatcher designs the optimal processing graph per query: simple (2 workers), debate (3+merge), audit (workers→merge→audit→refine), or fully custom.
End-to-end JSON Schema enforcement. Client passes response_format → dispatcher designs schema → aggregator enforces it via provider-native structured modes (json_schema, json_object).
Worker failures degrade gracefully (not crash). Circuit breakers per provider. Token limit detection. Retry with exponential backoff. Budget exhaustion protection.
Smart defaults use DeepSeek V4 Pro/Flash — high quality at 10-50× lower cost than premium models. Premium models (Claude, GPT) available via overrides when the task justifies it.
Every deliberation returns a complete trace: model per stage, tokens in/out, cost, duration. structlog + optional Langfuse integration. Web UI with live DAG visualization.
| # | Interface | Entry | Use Case |
|---|---|---|---|
| 1 | CLI | chimera "prompt" | Terminal one-shots, quick queries |
| 2 | REST API | POST /v1/chat/completions | OpenAI-compatible drop-in for any app |
| 3 | REST API | POST /v1/deliberate | Full control: DAG, overrides, trace |
| 4 | Python SDK | from chimera import Engine | Embedded in Python apps |
| 5 | MCP Server | chimera-mcp (stdio) | AI agent integration (Hermes, Claude, etc.) |
| 6 | Web UI | /web/ (SPA) | Multi-turn chat with live DAG visualization |
Via LiteLLM gateway with automatic provider routing. Direct API routes for DeepSeek and Z.AI (lower latency); OpenRouter for everything else.
| Provider | Models | Routing | Strengths |
|---|---|---|---|
| DeepSeek | V4 Pro, V4 Flash | Direct API | Budget-optimized, strong coding & reasoning |
| Anthropic | Claude Sonnet 4, Opus 4.7/4.8, Haiku 4.5 | OpenRouter | Creative writing, nuanced analysis, design |
| Z.AI | GLM-5.2 | Direct API | Strong reasoning, multilingual, coding |
| OpenAI | GPT-5.5, GPT-5.1, GPT-5.1-mini | OpenRouter | Broad capability, structured outputs |
| MoonshotAI | Kimi K2.7 Code, K2.6 | OpenRouter | Top-tier coding benchmarks |
| Gemini 3.5 Flash, 3.1 Pro, 2.5 Flash | OpenRouter | Multimodal, large context windows | |
| xAI | Grok 4.20 | OpenRouter | Real-time knowledge, reasoning |
| MiniMax | M3 | OpenRouter | Multimodal, 1M context |
| Meta | Llama 4 Maverick | OpenRouter | Open-source, strong general performance |
Structure → parallel domain-specific writing → merge → gap audit → refinement. Produces exhaustive technical specs with Mermaid diagrams, test scenarios, and error paths.
Multiple models critique and improve design outputs (CSS, UI, branding) through iterative refinement. Beats solo model output on visual identity tasks.
Tech stack evaluations, architecture decisions, competitive analysis. Different models analyze different dimensions (performance, security, DX, ecosystem) → merged recommendation.
AI coding agents (Hermes, Claude Code) use Chimera as a "super-consult" tool. The agent delegates complex reasoning to Chimera's model panel, gets back a structured, multi-perspective answer.
Client-defined DAGs for content pipelines: research → draft → fact-check → polish → publish. Each stage uses the optimal model for that specific subtask.
Python 3.11+, asyncio, Pydantic v2, structlog
LiteLLM — 100+ providers, OpenAI-compatible, automatic format negotiation
FastAPI + Uvicorn — async, OpenAPI auto-docs, SSE streaming, CORS
FastMCP (stdio) — 3 tools: deliberate, formations, models
models.dev auto-discovery — 145 providers, $/MTok pricing, 24h cache
Docker with built-in config. Single command: docker compose up -d
Chimera is MIT-licensed open source — you pay only for the underlying model API calls. No per-request markup, no platform fees.
| Formation | Typical Calls | Budget (~$0.0002/1K tok) | Premium (up to ~$0.015/1K tok) |
|---|---|---|---|
| Simple | 1 dispatch + 2 workers + 1 aggregator = 4 calls | ~$0.003 | ~$0.08 |
| Debate | 1 dispatch + 3 workers + 2 aggregators + 1 merge = 7 calls | ~$0.006 | ~$0.18 |
| Spec-Writer | 1 structure + 2 writers + 1 merge + 1 audit + 1 refine = 6 calls | ~$0.008 | ~$0.25 |
Actual costs vary by prompt length and model selection. Budget formations use DeepSeek V4 Flash (~$0.00014/1K tokens). Premium formations can include Claude Sonnet 4 or GPT-5.5. The dispatcher picks models based on category-weighted scoring with configurable price sensitivity (0.0 = pure quality, 1.0 = pure bang-for-buck).
git clone https://github.com/totalwindupflightsystems/chimera.git cd chimera export DEEPSEEK_KEY=sk-... # only required credential docker compose up -d # → REST API on :8765, Web UI on :8765/web/
pip install chimera-deliberation[full] cp chimera.yaml.example chimera.yaml # add API keys chimera serve # start server
Every setting is overridable via environment variables or CLI flags. No YAML editing required for common deployments:
CHIMERA_PORT=8080 CHIMERA_DISPATCHER=deepseek/deepseek-v4-pro chimera serve
309+ unit tests, 54 integration tests (real API calls), 7-model compat suite. CI runs on every push to main.
Per-provider state machine (CLOSED→OPEN→HALF_OPEN). Failing providers are isolated automatically; healthy ones keep working.
In-memory token bucket per API key. Configurable limits prevent runaway costs.
API key auth (env or list mode). Optional per-endpoint. /v1/health/live always open for orchestration.
Async throughout (asyncio + FastAPI). Workers run in parallel. 50-request stress tests pass cleanly.
Automated CI/CD pipeline. Tag a version → lint → test → integration test → publish to PyPI. Zero manual steps.
| Status | Item |
|---|---|
| ✅ Done | v2 architecture — single dispatcher, category-weighted selection, budget-first defaults |
| ✅ Done | 6 interfaces: CLI, REST, MCP, Python SDK, OpenAI-compatible, Web UI |
| ✅ Done | Structured output pipeline (json_schema → json_object fallback) |
| ✅ Done | Failure resilience: degradation, circuit breakers, retry, budget protection |
| ✅ Done | Custom DAGs + per-stage model overrides |
| ✅ Done | Provider auto-discovery (models.dev, 145 providers) |
| ✅ Done | Config-defined formations (spec-writer, etc.) |
| ✅ Done | Docker one-command deploy with built-in config |
| ✅ Done | CI/CD: lint → test → integration → PyPI publish |
| ✅ Done | Web UI: multi-turn chat, live DAG viz (Mermaid.js), token/cost dashboard |
| ✅ Done | Configurable timeout hierarchy (request header → admin ceiling → default) |
| 🔄 Near-term | Persistent session storage (SQLite/Postgres backend for Web UI sessions) |
| 🔄 Near-term | OpenRouter key auto-provisioning for multi-tenant deployments |
| 📋 Planned | Streaming responses (SSE token-by-token from aggregator) |
| 📋 Planned | Model benchmark auto-refresh pipeline (scores update from live eval results) |
| 📋 Planned | Multi-tenant SaaS mode with per-tenant API key + budget isolation |