Skip to main content
CrewAI enables you to build autonomous multi-agent systems where specialized AI agents collaborate on complex tasks. Venice AI works as a drop-in LLM provider thanks to OpenAI compatibility.

Setup

pip install crewai crewai-tools

Basic Configuration

Configure Venice as CrewAI’s LLM provider using the OpenAI-compatible interface:
import os

os.environ["OPENAI_API_KEY"] = "your-venice-api-key"
os.environ["OPENAI_API_BASE"] = "https://api.venice.ai/api/v1"
os.environ["OPENAI_MODEL_NAME"] = "venice-uncensored"
Or configure per-agent with the LLM object:
from crewai import LLM

venice_llm = LLM(
    model="openai/venice-uncensored",
    api_key="your-venice-api-key",
    base_url="https://api.venice.ai/api/v1",
    temperature=0.7,
)

# For complex reasoning tasks
venice_flagship = LLM(
    model="openai/zai-org-glm-4.7",
    api_key="your-venice-api-key",
    base_url="https://api.venice.ai/api/v1",
    temperature=0.3,
)

Your First Crew

Create a simple research crew with two agents:
from crewai import Agent, Task, Crew

# Agent 1: Researcher
researcher = Agent(
    role="Senior Research Analyst",
    goal="Find comprehensive, accurate information on the given topic",
    backstory="You are an expert researcher with a keen eye for detail. "
              "You excel at finding and synthesizing information from multiple sources.",
    llm=venice_flagship,
    verbose=True,
)

# Agent 2: Writer
writer = Agent(
    role="Content Strategist",
    goal="Create engaging, well-structured content from research findings",
    backstory="You are a skilled writer who transforms complex research "
              "into clear, compelling content that readers love.",
    llm=venice_llm,
    verbose=True,
)

# Task 1: Research
research_task = Task(
    description="Research the topic: {topic}. "
                "Find key facts, recent developments, and expert opinions. "
                "Provide a structured summary with sources.",
    expected_output="A detailed research summary with key findings, "
                    "organized by subtopic, with at least 5 key points.",
    agent=researcher,
)

# Task 2: Write article
write_task = Task(
    description="Using the research provided, write a compelling blog post "
                "about {topic}. Include an introduction, main sections, and conclusion.",
    expected_output="A well-written blog post of 500-800 words with clear sections.",
    agent=writer,
    context=[research_task],  # Uses output from research_task
)

# Create and run the crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    verbose=True,
)

result = crew.kickoff(inputs={"topic": "The future of privacy-preserving AI"})
print(result)

Multi-Agent Product Analysis Crew

A more complex example with specialized agents:
from crewai import Agent, Task, Crew, Process

# Different models for different agent capabilities
fast_llm = LLM(model="openai/qwen3-4b", api_key="your-key", base_url="https://api.venice.ai/api/v1")
smart_llm = LLM(model="openai/zai-org-glm-4.7", api_key="your-key", base_url="https://api.venice.ai/api/v1")
uncensored_llm = LLM(model="openai/venice-uncensored", api_key="your-key", base_url="https://api.venice.ai/api/v1")

# Market Analyst - needs intelligence
market_analyst = Agent(
    role="Market Research Analyst",
    goal="Analyze market trends and competitive landscape",
    backstory="You are a veteran market analyst with 15 years of experience "
              "in tech markets. You provide unbiased, data-driven insights.",
    llm=smart_llm,
    verbose=True,
)

# Red Team - benefits from uncensored thinking
red_team = Agent(
    role="Red Team Critic",
    goal="Find weaknesses, risks, and potential failures in business strategies",
    backstory="You are a brutally honest critic who stress-tests ideas. "
              "You find every possible flaw and risk, no matter how uncomfortable.",
    llm=uncensored_llm,  # Uncensored for honest criticism
    verbose=True,
)

# Strategist - needs reasoning
strategist = Agent(
    role="Business Strategist",
    goal="Synthesize analysis into actionable strategy recommendations",
    backstory="You are a McKinsey-trained strategist who creates clear, "
              "actionable plans from complex analyses.",
    llm=smart_llm,
    verbose=True,
)

# Tasks
market_task = Task(
    description="Analyze the market opportunity for: {product_idea}. "
                "Cover market size, competitors, trends, and target audience.",
    expected_output="Structured market analysis with TAM/SAM/SOM estimates, "
                    "top 5 competitors, and 3 key market trends.",
    agent=market_analyst,
)

critique_task = Task(
    description="Critically evaluate this product idea and market analysis. "
                "Find every weakness, risk, and potential failure mode. Be brutally honest.",
    expected_output="A list of at least 5 critical risks, 3 potential failure modes, "
                    "and honest assessment of whether this idea will succeed.",
    agent=red_team,
    context=[market_task],
)

strategy_task = Task(
    description="Based on the market analysis and red team critique, "
                "create a go-to-market strategy that addresses the identified risks.",
    expected_output="A clear go-to-market strategy with: positioning statement, "
                    "3 key differentiators, launch timeline, and risk mitigations.",
    agent=strategist,
    context=[market_task, critique_task],
)

crew = Crew(
    agents=[market_analyst, red_team, strategist],
    tasks=[market_task, critique_task, strategy_task],
    process=Process.sequential,
    verbose=True,
)

result = crew.kickoff(inputs={
    "product_idea": "A privacy-first AI coding assistant that runs on Venice API"
})
print(result)

Using Tools

Enhance agents with web search and other tools:
SerperDevTool requires a SERPER_API_KEY environment variable from serper.dev. As an alternative, you can use Venice’s built-in web search by passing venice_parameters: {"enable_web_search": "auto"} via model_kwargs — no extra API key needed. See the LangChain guide’s Web Search Integration for an example.
from crewai_tools import SerperDevTool, WebsiteSearchTool
from crewai import Agent, Task, Crew

# Web search tool (requires SERPER_API_KEY env var)
search_tool = SerperDevTool()

researcher = Agent(
    role="Web Researcher",
    goal="Find the latest information on any topic",
    backstory="You are an expert web researcher.",
    llm=venice_flagship,
    tools=[search_tool],
    verbose=True,
)

task = Task(
    description="Research the latest developments in {topic} from the past week.",
    expected_output="A summary of 5 recent developments with dates and sources.",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task], verbose=True)
result = crew.kickoff(inputs={"topic": "decentralized AI"})

Model Selection Guide for CrewAI

Choose the right Venice model for each agent role:
Agent RoleRecommended ModelWhy
Complex reasoning / Strategyzai-org-glm-4.7Best private reasoning model
Uncensored analysis / Red teamvenice-uncensoredNo content filtering
High-volume / Fast tasksqwen3-4bCheapest at $0.05/1M tokens
Code generation agentsqwen3-coder-480b-a35b-instructOptimized for code
Vision/multimodal tasksqwen3-vl-235b-a22bAdvanced vision understanding
Budget-conscious teamsqwen3-4b (fast) + venice-uncensored (main)Low cost combination

Cost Optimization Tips

  1. Use cheaper models for simpler agents: Not every agent needs a flagship model. Use qwen3-4b for formatting, summarizing, or simple extraction.
  2. Use venice-uncensored for creative/critical roles: It’s fast, cheap, and won’t refuse uncomfortable analyses.
  3. Reserve flagship models for reasoning: Use zai-org-glm-4.7 only for agents that need complex reasoning or reliable function calling.
  4. Limit max iterations: Set max_iter on agents to prevent runaway token usage:
    agent = Agent(role="...", goal="...", backstory="...", llm=venice_llm, max_iter=5)
    

Privacy Advantage

Venice’s privacy guarantees make it ideal for CrewAI use cases involving:
  • Confidential business strategy — Zero data retention means your competitive analysis stays private
  • Sensitive data processing — Private models never log or store your data
  • Red team exercises — Uncensored models give honest feedback without content filtering