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

# Escalation: Small Primary, Large Advisors

> A common pattern: run a small, fast, cheap model as the primary agent and let it escalate hard sub-problems to larger models.

```python escalation.py theme={null}
"""
Escalation: Small Primary, Large Advisors
=========================================
A common pattern: run a small, fast, cheap model as the primary agent and
let it escalate hard sub-problems to larger models.

Advisors can be defined as model strings ("provider:model-id") instead of
Model instances. They are resolved via `agno.models.utils.get_model`, so you
do not need to import each model class.

Benefits:
- Most turns are handled by the cheap model
- The agent only pays for the large models when it actually needs them
- Descriptions steer which advisor gets which kind of question
"""

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.advisor import AdvisorTools

# ---------------------------------------------------------------------------
# Create Agent: small primary model, large advisors via model strings
# ---------------------------------------------------------------------------

agent = Agent(
    model=OpenAIResponses(id="gpt-5-mini"),
    tools=[
        AdvisorTools(
            advisors=["anthropic:claude-sonnet-4-6", "openai:gpt-5.5"],
            descriptions={
                "claude-sonnet-4-6": "Escalate tricky code and correctness questions here",
                "gpt-5.5": "Escalate open-ended reasoning and planning questions here",
            },
        )
    ],
    instructions=[
        "You are a fast assistant. Handle easy questions yourself.",
        "When a question is hard or high-stakes, escalate it to the most suitable advisor.",
        "Always give the advisor a self-contained prompt with the relevant context.",
    ],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    agent.print_response(
        "Write a Python function that merges overlapping intervals. "
        "Before finalizing, get your implementation reviewed by an advisor "
        "and incorporate any corrections.",
        stream=True,
    )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `escalation.py`, then run:

    ```bash theme={null}
    python escalation.py
    ```
  </Step>
</Steps>

Full source: [cookbook/91\_tools/advisor\_tools/03\_escalation.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/advisor_tools/03_escalation.py)
