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

# DeepSeek

> Use DeepSeek models with PraisonAI Agents

## Models

DeepSeek offers powerful reasoning models:

* **Recommended**: `deepseek-chat` (via DeepSeek API)
* **Reasoning**: `deepseek-reasoner` (advanced reasoning)
* **Local**: `ollama/deepseek-r1` (via Ollama)

## Python (DeepSeek API)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# export DEEPSEEK_API_KEY=your-api-key
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a helpful assistant",
    llm="deepseek/deepseek-chat"
)
agent.start("Explain reinforcement learning")
```

### With Tools

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# export DEEPSEEK_API_KEY=your-api-key
from praisonaiagents import Agent

def solve_math(problem: str) -> str:
    """Solve a math problem."""
    return f"Solution for: {problem}"

agent = Agent(
    instructions="You are a math tutor",
    llm="deepseek/deepseek-chat",
    tools=[solve_math]
)
agent.start("Solve: What is the derivative of x^3?")
```

### Multi-Agent

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# export DEEPSEEK_API_KEY=your-api-key
from praisonaiagents import Agent, Task, AgentTeam

researcher = Agent(
    instructions="You research topics thoroughly",
    llm="deepseek/deepseek-chat"
)
writer = Agent(
    instructions="You write clear explanations",
    llm="deepseek/deepseek-chat"
)

task1 = Task(description="Research deep learning optimization", agent=researcher)
task2 = Task(description="Write a beginner's guide", agent=writer)

agents = AgentTeam(agents=[researcher, writer], tasks=[task1, task2])
agents.start()
```

## Python (Local via Ollama)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# No API key needed - runs locally
# First: ollama pull deepseek-r1
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a reasoning assistant",
    llm="ollama/deepseek-r1"
)
agent.start("Solve this logic puzzle step by step")
```

## CLI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Using DeepSeek API
export DEEPSEEK_API_KEY=your-api-key
python -m praisonai "Explain AI" --llm deepseek/deepseek-chat

# Using Ollama (local)
python -m praisonai "Solve this problem" --llm ollama/deepseek-r1

# Run agents.yaml
python -m praisonai
```

## YAML

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: praisonai
topic: AI reasoning research
agents:
  researcher:
    role: AI Researcher
    goal: Research reasoning techniques
    instructions: You are an expert in AI reasoning
    llm:
      model: deepseek/deepseek-chat
    tasks:
      research_task:
        description: Research the latest reasoning techniques in AI
        expected_output: Comprehensive reasoning research report

  analyst:
    role: Technical Analyst
    goal: Analyze and explain findings
    instructions: You analyze technical concepts clearly
    llm:
      model: deepseek/deepseek-chat
    tasks:
      analysis_task:
        description: Analyze the research and create explanations
        expected_output: Clear technical analysis
```
