> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LiteLLM Reasoning Agent Example

> Use reasoning models through LiteLLM.

Use reasoning models through LiteLLM. The reasoning\_content from the model response is extracted and displayed.

```python reasoning_agent.py theme={null}
"""
LiteLLM Reasoning Agent Example

This example demonstrates using reasoning models through LiteLLM.
The reasoning_content from the model response is extracted and displayed.

Supported reasoning models through LiteLLM:
- deepseek/deepseek-reasoner (DeepSeek R1)
"""

from agno.agent import Agent
from agno.models.litellm import LiteLLM

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

task = "9.11 and 9.9 -- which is bigger?"

# Using DeepSeek R1 through LiteLLM
agent = Agent(
    model=LiteLLM(
        id="deepseek/deepseek-reasoner",
    ),
    markdown=True,
)

agent.print_response(task, stream=True, stream_events=True, show_reasoning=True)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

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

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

  <Step title="Export your LiteLLM API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export LITELLM_API_KEY="your_litellm_api_key_here"
      ```

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

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

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

Full source: [cookbook/90\_models/litellm/reasoning\_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/litellm/reasoning_agent.py)
