Intelligence Handoff Protocol
Stop paying GPT-4 prices for 'Hello World'. Use cheap models for chat and route only complex tasks to smart models. Use Ctxfy to transfer context between them instantly and cheaply.
The 'All-or-Nothing' Dilemma
The Expensive Way
Using GPT-4 for everything. Great intelligence, but you burn $10 per user just on chit-chat and simple queries.
The Dumb Way
Using Llama-70b for everything. Fast and cheap, but it fails on complex reasoning or coding tasks.
The Handoff Pipeline
Front-Line Model
User chats with Claude Haiku (Cheap). Fast responses for general questions.
Intent Trigger
Router detects complex intent (e.g., 'Refactor this code'). Handoff initiated.
Ctxfy Compression
History is compressed into a 500-token State Object. No need to send 20k raw tokens.
Smart Model Execution
GPT-4 receives the State + New Prompt. Solves the task with full context but 95% less cost.
The Token Tax Savings
Cost of switching a 30k token conversation to GPT-4o:
async function handleUserMessage(history, newMessage) {
// 1. Cheap Classifier
const intent = await classifier.detect(newMessage);
if (intent === 'SIMPLE') {
return haiku.chat(history, newMessage);
}
// 2. Complex Task -> Handoff
if (intent === 'COMPLEX') {
// Create source with CONTENT, receive postback with processed data
const res = await fetch(`/v1/spaces/${spaceId}/sources`, {
method: "POST",
body: JSON.stringify({ type: "CONTENT", initial_data: { data: formatHistory(history) }, instructions: {} })
});
const { data } = await res.json();
const source = await waitForPostback(data.id);
return gpt4.complete({ system: `Context: ${source.content}`, prompt: newMessage });
}
}Just 5 Lines of Code
Implementing a router doesn't require complex infrastructure. It's a simple conditional check in your backend logic.
- Detect Intent
- Compress History (Ctxfy)
- Call Expensive Model
Related features
Resume in 30 Seconds
Your job: get back to productive work. Ctxfy turns 2 hours of re-reading into one paste. Load the minimal state you need—no full history. Works with ChatGPT, Claude, Gemini, and any AI tool.
Find Any Code or Decision
Your job: reuse what you already created. Stop losing 15 minutes scrolling. Ctxfy extracts code, schemas, and decisions—searchable when you need them.
Maintain Consistency
Keep AI aligned with your architectural rules and constraints across long projects
Frequently asked questions
Cheap models are bad summarizers. They miss nuance, hallucinate facts, or lose code constraints. Ctxfy uses a specialized pipeline guaranteed to preserve state variables.
The compression happens in parallel or effectively instantaneously compared to the inference time of a large reasoning model like Opus or GPT-4.
Yes. Start in Anthropic, switch to OpenAI, finish in Local Mistral. The Ctxfy State Object is universal natural language.
Route smarter, not harder.
Combine the speed of Haiku with the brain of Opus.
