> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dedaluslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Handoffs

> Route tasks to different models based on their strengths

Different models excel at different tasks. GPT handles reasoning and tool use well. Claude writes better prose. Specialized models exist for code, math, and domain-specific work. Handoffs let agents route subtasks to the right model.

If you've already built an MCP + tools workflow, handoffs let you keep a fast "coordinator" model most of the time and route to stronger models only when needed.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import asyncio
  from dedalus_labs import AsyncDedalus, DedalusRunner
  from dotenv import load_dotenv

  load_dotenv()

  async def main():
      client = AsyncDedalus()
      runner = DedalusRunner(client)

      result = await runner.run(
          input=(
              "Find me the nearest basketball games in January in San Francisco, then write a concise plan for attending."
          ),
          model=["openai/gpt-5.2", "anthropic/claude-opus-4-5"],
          mcp_servers=["tsion/exa"],  # Web search via Exa
      )

      print(result.final_output)

  if __name__ == "__main__":
      asyncio.run(main())
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import Dedalus from 'dedalus-labs';
  import { DedalusRunner } from 'dedalus-labs';

  const client = new Dedalus();
  const runner = new DedalusRunner(client);

  async function main() {
    const result = await runner.run({
      input:
        'Find me the nearest basketball games in January in San Francisco, then write a concise plan for attending.',
      model: ['openai/gpt-5.2', 'anthropic/claude-opus-4-5'],
      mcpServers: ['tsion/exa'], // Web search via Exa
    });

    console.log(result.finalOutput);
  }

  main();
  ```
</CodeGroup>

## When to Use Handoffs

Handoffs shine when a task has distinct phases requiring different capabilities:

* **Research -> Writing**: GPT gathers information, Claude writes the final piece
* **Analysis -> Code**: A reasoning model plans the approach, a code model implements it
* **Triage -> Specialist**: A general model routes to domain-specific models

For simple tasks where one model handles everything, stick to a single model.

## Model Strengths

A rough guide to model selection:

| Task                    | Good Models                                       |
| ----------------------- | ------------------------------------------------- |
| Tool calling, reasoning | `openai/gpt-5.2`, `xai/grok-4-1-fast-reasoning`   |
| Writing, creative work  | `anthropic/claude-opus-4-5`                       |
| Code generation         | `anthropic/claude-opus-4-5`, `openai/gpt-5-codex` |
| Fast, cheap responses   | `openai/gpt-5-mini`                               |

## Next steps

* **Add multimodality**: [Images & Vision](/sdk/images) -- Add image generation/vision to your workflow
* **See workflows**: [Use Cases](/sdk/use-cases/data-analyst) -- Multi-capability patterns

<Tip icon="terminal" iconType="regular">
  [Connect these docs programmatically](/contextual/use-these-docs) to Claude, VSCode, and more via
  MCP for real-time answers.
</Tip>
