Skip to main content

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)

# 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

# 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

# export DEEPSEEK_API_KEY=your-api-key
from praisonaiagents import Agent, Task, Agents

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 = Agents(agents=[researcher, writer], tasks=[task1, task2])
agents.start()

Python (Local via Ollama)

# 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

# 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

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