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

# DeepSeek

> Use DeepSeek models with Agno agents.

DeepSeek provides endpoints for large language models.
See their library of models [here](https://api-docs.deepseek.com/quick_start/pricing).

We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:

* `deepseek-v4-flash` (default): fast V4 model, 1M context. Hybrid thinking + non-thinking.
* `deepseek-v4-pro`: flagship V4 model, 1M context. Hybrid thinking + non-thinking.

DeepSeek does not have rate limits. See their [docs](https://api-docs.deepseek.com/quick_start/rate_limit) for information about how to deal with slower responses during high traffic.

## Installation

```bash theme={null}
uv pip install -U openai agno
```

## Authentication

Set your `DEEPSEEK_API_KEY` environment variable. Get your key from [here](https://platform.deepseek.com/api_keys).

```bash Mac theme={null}
export DEEPSEEK_API_KEY=***
```

```bash Windows theme={null}
setx DEEPSEEK_API_KEY ***
```

## Example

Use `DeepSeek` with your `Agent`:

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

agent = Agent(model=DeepSeek(id="deepseek-v4-flash"), markdown=True)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")

```

> [!NOTE]
>
> View more examples [here](https://agno-v2.mintlify.site/models/providers/native/deepseek/usage/basic.md).

## Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"deepseek-v4-flash"` | The id of the DeepSeek model to use |
| `name` | `str` | `"DeepSeek"` | The name of the model |
| `provider` | `str` | `"DeepSeek"` | The provider of the model |
| `api_key` | `Optional[str]` | `None` | The API key for DeepSeek (defaults to `DEEPSEEK_API_KEY` env var) |
| `base_url` | `str` | `"https://api.deepseek.com"` | The base URL for the DeepSeek API |
| `use_thinking` | `Optional[bool]` | `None` | Control thinking mode. See [Thinking mode](#thinking-mode). |

`DeepSeek` extends the OpenAI-compatible interface and supports most parameters from the [OpenAI model](https://agno-v2.mintlify.site/models/providers/native/openai/completion/overview.md).

**Note**: DeepSeek supports JSON mode but not native `json_schema` structured outputs, so `supports_native_structured_outputs` is set to `False`. Use `use_json_mode=True` for structured output.

## Available Models

| Model id | Notes |
| - | - |
| `deepseek-v4-flash` | Fast V4 model (default), 1M context. Hybrid thinking + non-thinking. |
| `deepseek-v4-pro` | Flagship V4 model, 1M context. Hybrid thinking + non-thinking. |

> [!WARNING]
>
> The legacy ids `deepseek-chat` and `deepseek-reasoner` still work and route server-side to the V4 models (`deepseek-chat` to non-thinking, `deepseek-reasoner` to thinking), but you should migrate to `deepseek-v4-flash` / `deepseek-v4-pro`.

## Thinking mode

V4 models run with thinking enabled by default, so you get `reasoning_content` out of the box. Control it with the `use_thinking` flag:

| Value | Behavior |
| - | - |
| `None` (default) | V4 models think by default; legacy `deepseek-chat` does not. |
| `True` | Force thinking on. The model returns `reasoning_content`. |
| `False` | Force thinking off for a faster, cheaper response. |

For agent scenarios, DeepSeek recommends `reasoning_effort="max"`. The API default is `"high"`. While thinking is active, `temperature`, `top_p`, `presence_penalty` and `frequency_penalty` are ignored by the API.

```python 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,
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.