Documentation
Everything you need to use TemuClaude — 8 models, 10-layer pipeline, one superior answer.
Quickstart
Get started with TemuClaude in under 5 minutes.
Option 1 — Use the playground (no installation):
Open the playground → — ask anything, get a superior answer. No signup, no setup. 20 free queries/day.
Option 2 — API access:
curl -X POST https://temuclaude.com/api/chat \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "What is 9.9 vs 9.11?"}]}'
# Response: SSE stream with answer + orchestration metadataTip: The playground runs the full 10-layer orchestration stack — you get the same quality as our API. Free tier: 20 queries/day, no signup required.
Architecture
TemuClaude is one endpoint that orchestrates 8 AI models behind the scenes. When you ask a question, it:
- Classifies your query (math, coding, reasoning, knowledge, creative, legal, health, agentic)
- Estimates difficulty (trivial, medium, hard)
- Routes to the best strategy:
- Trivial (60%) → single cheap model (Hy3 Preview, free models)
- Medium (30%) → specialist model (DeepSeek V4 Pro, GLM-5.2, Gemini 3 Flash)
- Hard (10%) → full 10-layer fusion stack (3 models parallel + cross-review + aggregate + verify + QA + debate)
- Returns one clean answer — orchestration is invisible but visible in the playground
Note: All of this happens server-side. The user never picks models, modes, or parameters. They just ask TemuClaude.
Model Pool
TemuClaude uses 8 models, each with a specific role:
| Model | Role | IQ | Context |
|---|---|---|---|
| GLM-5.2 | Orchestrator + Aggregator | 51 | 1M |
| DeepSeek V4 Pro | Hard reasoning + Math + Coding | 44 | 1M |
| Hy3 Preview | Trivial router (cheapest) | — | 262K |
| Gemini 3 Flash | Legal + Health specialist | 50 | 1M |
| MiniMax M3 | Vision + Creative | 44 | 1M |
| MiMo-V2.5 | Multimodal (text+image+video) | 40 | 1M |
| Claude Sonnet 5 | Frontier fallback (hardest 2%) | 53 | 1M |
| Nemotron 3 Ultra | QA Gate (FREE, 550B MoE) | 38 | 128K |
Tip: Nemotron 3 Ultra is free on OpenRouter — the quality gate costs nothing. Claude Sonnet 5 (IQ 53) is only used for the hardest 2% of queries where all other layers fail.
10-Layer Pipeline
For hard queries, TemuClaude runs up to 10 quality layers. Each is independently validated by published research:
- Web Search — DuckDuckGo for knowledge queries (free, unlimited)
- MoA 3-Layer Fusion — Propose → Cross-Review → Aggregate (65.1% AlpacaEval vs GPT-4o 57.5%)
- Self-Consistency — PRM-weighted voting across N samples (+18.4% MATH)
- Code Verification — Execute Python, verify output (ground truth)
- Reflexion — Verbal reflection on failure, retry with context (91% HumanEval)
- Self-QA Gate — 5-rubric score (LC, FC, CM, GA, CL), retry if < 8/10
- Z3/SMT Verification — Logical consistency check with SMT solver
- Budget Forcing — Append "Wait" to force longer reasoning (s1 paper)
- Step-Level Verification — Verify each reasoning step independently (rStar-Math)
- Frontier Fallback — Escalate to Claude Sonnet 5 (IQ 53) for hardest 2%
3-Tier Routing
TemuClaude routes queries by difficulty to minimize cost without sacrificing quality:
Difficulty estimation:
Word count → 0-5 points
Task type (math/reasoning/coding) → +2 points
Keywords (explain, analyze, compare) → +1-2 points
Total → 0-10 scale
Routing:
Trivial (60% of queries) → 1 cheap model, 500 tokens
Models: Hy3 Preview, free models ($0.00)
Medium (30% of queries) → 1 specialist model, 4096 tokens
Math/Coding → DeepSeek V4 Pro
Knowledge → GLM-5.2
Legal/Health → Gemini 3 Flash
Creative → MiniMax M3
Hard (10% of queries) → Full 10-layer fusion stack, 8192 tokens
3 models in parallel → cross-review → aggregate
+ code verification + self-QA + reflexion + debateNote: 60% of queries cost $0 (free models or cache). 30% cost $0.06-0.14/M. Only 10% use the full pipeline. Average cost: $0.05/M tokens.
MoA 3-Layer Fusion
For hard queries, TemuClaude uses Mixture-of-Agents (MoA) with 3 layers:
Layer 1: 3 models propose independently
GLM-5.2 → response A
DeepSeek V4 Pro → response B
Gemini 3 Flash → response C
Layer 2: Cross-Review
GLM-5.2 reviews B and C → improved A'
DeepSeek reviews A and C → improved B'
Gemini reviews A and B → improved C'
Layer 3: Aggregation
GLM-5.2 synthesizes A' + B' + C' → final answer
With structured analysis: consensus, contradictions, insights, blind spotsNote: Research: 3-layer MoA achieves 65.1% on AlpacaEval 2.0 vs GPT-4o's 57.5%. Each layer adds measurable quality.
Self-Consistency
For math and reasoning questions, TemuClaude generates N samples and votes:
- Math: 3 samples at temperature 0.7
- Reasoning: 2 samples
- Each sample scored by Nemotron (PRM-weighted voting)
- Highest-scoring answer selected as final
Code Verification
For math and coding questions, TemuClaude generates Python code, executes it in a sandbox, and returns the verified output:
- Model generates code to solve the problem
- Code executed in sandboxed subprocess (no network, temp dir, timeout)
- If output matches → answer is verified (ground truth)
- If execution fails → trigger Reflexion: model reflects, retries
Self-QA Gate
Every answer is scored on 5 rubrics (USVA framework, extended from ATTS):
- LC — Logical Coherence (is the reasoning consistent?)
- FC — Factual Correctness (are the facts right?)
- CM — Completeness (does it address all parts?)
- GA — Goal Alignment (does it answer what was asked?)
- CL — Clarity (is it clear, concise, accessible?)
Score = average × 10. If score < 8/10, TemuClaude retries with Reflexion feedback — up to 2 times.
Reflexion
When the QA gate fails, TemuClaude generates a verbal reflection on what went wrong, then retries with that context:
1. QA gate fails (score < 8/10)
2. Nemotron generates reflection:
"The answer has a logical error in step 3.
The formula should use integration by parts,
not substitution. Fix this and retry."
3. Original model retries with reflection as context
4. New answer is re-scored on all 5 rubrics
5. If still failing, retry once more (max 2 retries)Tip: Reflexion achieves 91% on HumanEval (vs 80% without). The difference between a model that gives up and one that learns from mistakes.
Budget Forcing
If the answer is suspiciously short for a hard problem, TemuClaude appends "Wait" to force the model to continue reasoning (s1 paper, arXiv:2501.19393):
Model answer: "The answer is 42."
→ Too short for a hard math problem
→ Append "Wait"
→ Model continues: "Let me verify... [longer reasoning]"Z3 Logical Verification
For reasoning questions, TemuClaude extracts logical claims and checks them with a Z3 SMT solver:
- Extracts "if X then Y", "X implies Y" patterns
- Encodes as Z3 boolean constraints
- Checks satisfiability (no contradictions)
- If contradiction found → triggers multi-agent debate
Note: Requires z3-solver: pip install z3-solver. Falls back gracefully if not installed.
Frontier Fallback
For the hardest 2% of queries where all other layers score low, TemuClaude escalates to Claude Sonnet 5 (IQ 53 — the highest available):
- Only triggers when QA score < 0.75 after all retries
- Query must match frontier criteria (prove, derive, theorem, system design, refactor)
- Frontier model gets the previous best answer as context
- Re-scored — if better, replaces the answer
Methodology
TemuClaude's benchmark scores are projected from:
- Individual model scores from ArtificialAnalysis Intelligence Index
- Proven improvement numbers from published research papers
- Stack effects: each technique's proven gain applied to the baseline
- Conservative estimates (lower bounds of published ranges)
Warning: These are projected scores, not live-verified. We will publish live results after ArtificialAnalysis testing. We are committed to transparency.
Reproducibility
Full benchmark scripts are available on GitHub (MIT licensed). Run them yourself:
# Clone the repo
git clone https://github.com/notSaiful/temuclaude.git
cd temuclaude-research
# Install dependencies
pip install -r requirements.txt
# Run TemuClaude on HLE benchmark
python benchmarks/run_temuclaude.py --dataset hle --sample 100
# Run on GPQA Diamond
python benchmarks/run_temuclaude.py --dataset gpqa --sample 100Projected Scores
TemuClaude vs frontier models across 8 benchmarks:
| Benchmark | TemuClaude* | Claude Sonnet 5 | GPT-5.5 |
|---|---|---|---|
| GPQA Diamond | 95-98% | 88% | 94% |
| LiveCodeBench | 96-99% | 87% | 91% |
| SWE-Bench Pro | 75-85% | 70% | 68% |
| Terminal-Bench | 91-96% | 85% | 82% |
| GDPval-AA v2 | 1824+ | 1783 | 1700 |
| MultiChallenge | 87-94% | 82% | 85% |
| MRCR v2 | 0.8-1.0 | 0.72 | 0.68 |
| HLE | 45-55% | 53% | 41% |
* Projected from research analysis. Live results pending ArtificialAnalysis verification.
REST API
TemuClaude exposes a single endpoint:
POST /api/chat
Request:
{
"messages": [
{"role": "user", "content": "What is 9.9 vs 9.11?"}
]
}
Response: SSE stream
data: {"chunk": "9.9"}
data: {"chunk": " is"}
data: {"chunk": " larger"}
...
data: {"orchestration": {...}}
data: [DONE]Streaming
TemuClaude uses Server-Sent Events (SSE) for streaming responses:
- POST request with messages array
- SSE response — chunks stream as
data: {chunk} - Orchestration data — sent after all chunks, before [DONE]
- [DONE] — signals stream end
Orchestration Data
The final SSE event contains orchestration metadata showing exactly how the answer was built:
{
"orchestration": {
"taskType": "math",
"tier": "hard",
"models": [
{"name": "glm-5.2", "response": "...", "latency": 3.2, "correct": true},
{"name": "deepseek-v4-pro", "response": "...", "latency": 8.3, "correct": true},
{"name": "gemini-3-flash", "response": "...", "latency": 13.9, "correct": true}
],
"aggregator": "glm-5.2",
"consensus": 3,
"qaScore": 8,
"codeVerified": true,
"totalLatency": "48.2",
"cost": "$0.015",
"techniques": ["moa-3-layer", "cross-review", "structured-aggregation",
"self-consistency", "prm-weighted-voting", "code-verification",
"reflexion", "usva-5-rubric-qa", "s1-budget-forcing"]}
}
}Tip: The techniques array shows exactly which layers were activated. Full transparency — no black boxes.
Authentication
Free tier: no authentication needed. Paid plans use Bearer token:
curl -X POST https://temuclaude.com/api/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Hello"}]}'Rate Limits
| Plan | Requests/min | Queries/day |
|---|---|---|
| Free | 10 | 20 |
| Developer | 100 | 50,000/mo |
| Pro | 1,000 | 500,000/mo |
| Enterprise | 10,000 | Unlimited |
Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad request — missing messages field |
| 401 | Unauthorized — invalid or missing API key |
| 429 | Rate limit exceeded — upgrade your plan |
| 500 | Internal error — all models unavailable |
Media Orchestration
TemuClaude also orchestrates media generation — images, video, text-to-speech, and music. Same 10-stage pipeline (cache, intent, tier, parallel generation, judge, quality gate, reflexion, memory, return). Each media type has its own model pool, routing logic, and quality gates.
Note: Media orchestration requires an AIML API key (set AIML_API_KEY env var). The LLM orchestration works with just OpenRouter.
Image Generation
3-tier routing with best-of-N generation and LLM judge:
| Tier | Models | Cost/image |
|---|---|---|
| Draft | Z-Image-Turbo (ELO 1105) | $0.005 |
| Standard | Reve Image (ELO 1281), FLUX-2 Pro (ELO 1186), MAI Image 2.5 (ELO 1272) | $0.031-0.048 |
| Premium | Reve, MAI 2.5, Nano Banana 2, FLUX-2 Max, GPT Image 2 (ELO 1340) | $0.031-0.211 |
Unique routing for special cases:
- Vector/SVG output → Recraft V3
- Text in images → FLUX-2 Flex, GPT Image 2
- Extreme aspect ratios → Nano Banana 2
- Character consistency → Nano Banana 2, GPT Image 2
- Multilingual text → Seedream 4.5
# Generate an image
curl -X POST https://temuclaude.com/api/media/generate \
-H "Content-Type: application/json" \
-d '{"type": "image", "prompt": "a cat on a windowsill", "tier": "standard"}'Video Generation
3-tier routing with async submit/poll pattern:
| Tier | Models | Cost/min |
|---|---|---|
| Draft | LTXV-2 Fast (ELO 976) | $2.40 |
| Standard | Seedance 2.0 (ELO 1225), HappyHorse 1.0 (ELO 1131) | $9.07-13.20 |
| Premium | Seedance 2.0, HappyHorse, Kling V3 Pro (4K/60fps) | $9.07-20.16 |
Unique routing for special cases:
- 4K video → Kling V3 Pro
- Dialogue/lip-sync → Google Veo 3.1
- Multi-input (images + clips + audio) → Seedance 2.0
- Long-form video → LTXV-2
Text-to-Speech
3-tier routing with voice selection and quality gating:
| Tier | Models | Cost/1K chars |
|---|---|---|
| Draft | Qwen3-TTS Flash (119 languages, 80ms latency) | $0.013 |
| Standard | ElevenLabs Turbo V2.5, MiniMax Speech 2.6, VibeVoice 7B | $0.052-0.117 |
| Premium | ElevenLabs V3 Alpha, Hume Octave 2, MiniMax Speech 2.6 HD | $0.078-0.234 |
Music Generation
3-tier routing with lyrics support and quality gating:
| Tier | Models | Cost/song |
|---|---|---|
| Draft | MiniMax Music 2.0 (vocals, 240s max) | $0.032 |
| Standard | MiniMax Music 2.0 + Music 1.5 (ethnic instruments) | $0.032-0.15 |
| Premium | Music 2.0 + Music 1.5 + Music 2.6 (frontier, 300s max) | $0.032-0.20 |
Tip: All music models support lyrics input. TemuClaude's judge scores musicality, prompt adherence, vocal quality, audio quality, and structure — same 5-rubric quality gate as the LLM pipeline.
Docker
Run TemuClaude with Docker (MIT licensed):
# Build the image
docker build -t temuclaude .
# Run on port 8000 with OpenRouter
docker run -p 8000:8000 -e OPENROUTER_API_KEY=your-key temuclaude
# Or with Ollama backend
docker run -p 8000:8000 -e OLLAMA_API_BASE=http://host.docker.internal:11434 temuclaudeFly.io
Deploy to Fly.io (Mumbai region for lowest latency to India):
# Install flyctl
curl -L https://fly.io/install.sh | sh
# Login and create app
fly auth login
fly launch --image temuclaude
# Deploy
fly deploy
# Set secrets
fly secrets set OPENROUTER_API_KEY=your-keyTip: Fly.io's Mumbai region gives ~20ms latency to India.
Environment Variables
| Variable | Required | Description |
|---|---|---|
| OPENROUTER_API_KEY | Yes | OpenRouter API key for model access |
| AIML_API_KEY | No | AIML API key (fallback backend) |
| TEMUCLAUDE_MASTER_KEY | No | Master key for API authentication |
Edit this page on GitHub → · MIT Licensed