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

# Reasoning Effort

> Set DeepSeek's reasoning_effort to control how much it reasons before answering.

## Code

Set `reasoning_effort` to `"high"` or `"max"`. The API defaults to `"high"`; DeepSeek recommends `"max"` for demanding agent tasks. While thinking is active, `temperature`, `top_p`, `presence_penalty` and `frequency_penalty` are ignored by the API.

```python reasoning_effort.py theme={null}
from agno.agent import Agent
from agno.models.deepseek import DeepSeek

agent = Agent(
    model=DeepSeek(id="deepseek-v4-pro", reasoning_effort="max"),
    markdown=True,
)

task = (
    "A farmer needs to cross a river with a fox, a chicken and a sack of grain. "
    "The boat only fits the farmer and one item. The fox cannot be left alone with "
    "the chicken, and the chicken cannot be left alone with the grain. "
    "Provide a step-by-step solution."
)

if __name__ == "__main__":
    agent.print_response(task, stream=True, show_full_reasoning=True)
```

## Usage

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

  <Step title="Set your API key">
    ```bash theme={null}
    export DEEPSEEK_API_KEY=xxx
    ```
  </Step>

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

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

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