Multi-agent systems sound incredible in demos but the economics are brutal. A CrewAI crew with three agents making five calls each means 15+ LLM invocations per task. If every agent is hitting GPT-4o, a single crew.kickoff() can cost $0.50-2.00 depending on context length. Run that crew on a schedule or in a production loop and you are hemorrhaging money on agents that are doing fundamentally different levels of work โ the researcher genuinely needs a smart model, but the formatter is just rearranging text.
Antbase was practically designed for this use case. When your CrewAI agents talk through Antbase, each LLM call gets classified independently. The researcher agent asking complex analytical questions gets routed to a premium model. The writer agent doing straightforward prose generation gets a mid-tier model. The coordination overhead โ agents delegating tasks, summarizing their output for the next agent โ goes to fast free models. Same crew, same output quality, dramatically lower cost.
There is a reliability angle too. Multi-agent workflows are fragile โ if one LLM call fails, the whole crew can stall. Antbase adds automatic failover across providers, so if GPT-4o times out on the researcher step, it retries with Claude or another capable model. Your crews become both cheaper and more resilient, which is what it takes to run multi-agent systems in production rather than just in demos.
CrewAI lets you orchestrate multiple AI agents that collaborate on tasks. Each agent has a role, goal, and backstory. By using Antbase as the LLM backend, each agent call gets routed to the best model โ a researcher agent might get a large-context model while a formatter agent gets a fast one.
Installation
pip install crewaiConfigure the LLM
import os
os.environ["OPENAI_API_BASE"] = "https://antbase.ai/v1"
os.environ["OPENAI_API_KEY"] = "ant_your-api-key"
os.environ["OPENAI_MODEL_NAME"] = "auto"Build a Research Crew
from crewai import Agent, Task, Crew
researcher = Agent(
role="Senior Researcher",
goal="Find comprehensive information on the given topic",
backstory="You are an expert researcher with deep analytical skills.",
verbose=True,
)
writer = Agent(
role="Technical Writer",
goal="Create clear, concise technical content",
backstory="You write documentation that developers love to read.",
verbose=True,
)
research_task = Task(
description="Research the latest developments in {topic}. "
"Focus on practical applications and key trends.",
expected_output="A detailed research summary with key findings.",
agent=researcher,
)
writing_task = Task(
description="Write a blog post based on the research findings.",
expected_output="A well-structured blog post of 500-800 words.",
agent=writer,
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
verbose=True,
)
result = crew.kickoff(inputs={"topic": "edge computing"})
print(result)Per-Agent Model Pinning
For fine-grained control, assign specific models to specific agents while letting others use auto-routing:
from langchain_openai import ChatOpenAI
premium_llm = ChatOpenAI(
base_url="https://antbase.ai/v1",
api_key="ant_your-api-key",
model="gpt-4o", # pin researcher to GPT-4o
)
fast_llm = ChatOpenAI(
base_url="https://antbase.ai/v1",
api_key="ant_your-api-key",
model="auto", # let Antbase route the writer
)
researcher = Agent(role="Researcher", goal="...", backstory="...", llm=premium_llm)
writer = Agent(role="Writer", goal="...", backstory="...", llm=fast_llm)Tips
- โขCrewAI agents make many LLM calls during delegation and collaboration. Auto-routing keeps costs down on the coordination overhead.
- โขUse verbose=True during development to see which models Antbase selects for each agent call.
- โขFor sequential crews, each task builds on the previous output. Antbase sees the growing context and may route later tasks to larger-context models.

