메인 콘텐츠로 건너뛰기
CrewAI는 전문화된 AI 에이전트들이 복잡한 작업에 협력하는 자율 멀티 에이전트 시스템을 구축할 수 있게 해줍니다. Venice AI는 OpenAI 호환 덕분에 LLM 공급자로 그대로 끼워 넣을 수 있습니다.

설정

pip install crewai crewai-tools

기본 구성

OpenAI 호환 인터페이스로 Venice를 CrewAI의 LLM 공급자로 설정하세요:
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"
또는 LLM 객체로 에이전트별로 구성하세요:
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,
)

# 복잡한 추론 작업용
venice_flagship = LLM(
    model="openai/zai-org-glm-5-1",
    api_key="your-venice-api-key",
    base_url="https://api.venice.ai/api/v1",
    temperature=0.3,
)

첫 번째 Crew

두 에이전트로 구성된 간단한 리서치 crew를 만들어 봅시다:
from crewai import Agent, Task, Crew

# 에이전트 1: 연구원
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,
)

# 에이전트 2: 작가
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,
)

# 태스크 1: 리서치
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,
)

# 태스크 2: 글 작성
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],  # research_task의 출력을 사용
)

# 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)

멀티 에이전트 제품 분석 Crew

전문화된 에이전트로 구성된 더 복잡한 예시:
from crewai import Agent, Task, Crew, Process

# 에이전트 역량에 맞는 다른 모델들
fast_llm = LLM(model="openai/qwen3-5-9b", api_key="your-key", base_url="https://api.venice.ai/api/v1")
smart_llm = LLM(model="openai/zai-org-glm-5-1", api_key="your-key", base_url="https://api.venice.ai/api/v1")
uncensored_llm = LLM(model="openai/venice-uncensored-1-2", api_key="your-key", base_url="https://api.venice.ai/api/v1")

# 시장 분석가 - 지능이 필요
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 - 비검열 사고가 도움이 됨
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,  # 솔직한 비판을 위해 비검열 모델 사용
    verbose=True,
)

# 전략가 - 추론이 필요
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,
)

# 태스크
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)

도구 사용하기

웹 검색 등 도구로 에이전트를 강화하세요:
SerperDevToolserper.dev에서 발급받는 SERPER_API_KEY 환경 변수가 필요합니다. 대안으로 model_kwargs를 통해 venice_parameters: {"enable_web_search": "auto"}를 전달하면 추가 API 키 없이 Venice의 내장 웹 검색을 사용할 수 있습니다. 예시는 LangChain 가이드의 Web Search Integration을 참고하세요.
from crewai_tools import SerperDevTool, WebsiteSearchTool
from crewai import Agent, Task, Crew

# 웹 검색 도구 (SERPER_API_KEY 환경변수 필요)
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"})

CrewAI를 위한 모델 선택 가이드

각 에이전트 역할에 맞는 Venice 모델을 선택하세요:
Agent RoleRecommended ModelWhy
복잡한 추론 / 전략zai-org-glm-5-1최고의 프라이빗 추론 모델
비검열 분석 / Red teamvenice-uncensored-1-2콘텐츠 필터링 없음
대량 / 빠른 작업qwen3-5-9b100만 input 토큰당 0.10,output토큰당0.10, output 토큰당 0.15로 가장 저렴
코드 생성 에이전트qwen3-coder-480b-a35b-instruct코드에 최적화
비전/멀티모달 작업qwen3-vl-235b-a22b고급 비전 이해
예산 절약 팀qwen3-5-9b(빠른 모델) + venice-uncensored-1-2(메인)저렴한 조합

비용 최적화 팁

  1. 단순한 에이전트에는 더 저렴한 모델을 사용: 모든 에이전트가 플래그십 모델일 필요는 없습니다. 포매팅, 요약, 단순 추출에는 qwen3-4b를 사용하세요.
  2. 창의적/비판적 역할에는 venice-uncensored 사용: 빠르고 저렴하며 불편한 분석을 거부하지 않습니다.
  3. 플래그십 모델은 추론용으로만: 복잡한 추론이나 신뢰성 있는 함수 호출이 필요한 에이전트에만 zai-org-glm-5-1을 사용하세요.
  4. 최대 반복 횟수 제한: 토큰 사용 폭주를 막기 위해 에이전트에 max_iter를 설정하세요:
    agent = Agent(role="...", goal="...", backstory="...", llm=venice_llm, max_iter=5)
    

프라이버시 이점

Venice의 프라이버시 보증은 다음과 같은 CrewAI 사용 사례에 이상적입니다:
  • 기밀 비즈니스 전략 — 데이터 보존 제로(zero retention) 덕분에 경쟁 분석이 비공개로 유지됩니다
  • 민감 데이터 처리 — 프라이빗 모델은 사용자 데이터를 로그하거나 저장하지 않습니다
  • Red team 훈련 — 비검열 모델은 콘텐츠 필터링 없이 솔직한 피드백을 제공합니다

CrewAI 문서

공식 CrewAI 문서

Venice 모델

모든 Venice 모델 둘러보기