Skip to main content

CrewAI on a VDS: a Team of AI Agents for Complex Tasks

AI Agents on VPS · 19.04.2026 · 4 min read
Illustration for “CrewAI on a VDS: a Team of AI Agents for Complex Tasks”

What is CrewAI?

CrewAI is a Python framework for building teams of AI agents. Each agent has a role, a goal, and a set of tools. Agents interact with each other, passing tasks down the chain to achieve a shared goal.

Installation

pip install crewai crewai-tools langchain-ollama

Creating a team of agents

from crewai import Agent, Task, Crew, Process
from langchain_ollama import OllamaLLM

llm = OllamaLLM(model="llama3.2", base_url="http://localhost:11434")

# Researcher agent
researcher = Agent(
    role="Researcher",
    goal="Collect up-to-date information on the topic",
    backstory="An experienced analyst with a broad outlook",
    llm=llm,
    verbose=True
)

# Writer agent
writer = Agent(
    role="Technical writer",
    goal="Produce clear articles based on the research",
    backstory="An expert in technical documentation",
    llm=llm
)

# Tasks
task1 = Task(
    description="Research the advantages of VDS hosting",
    expected_output="A list of 5 key advantages",
    agent=researcher
)
task2 = Task(
    description="Write an article based on the research",
    expected_output="A 300-word article",
    agent=writer
)

# Run
crew = Crew(agents=[researcher, writer], tasks=[task1, task2], process=Process.sequential)
result = crew.kickoff()
print(result)
Process types: Sequential — tasks run one after another. Hierarchical — a manager agent distributes tasks among the executors.

Built-in CrewAI tools

  • SerperDevTool — Google search
  • FileReadTool, FileWriterTool — file operations
  • WebsiteSearchTool — search within a specific site
  • CodeInterpreterTool — execute Python code

Common Configuration Errors

Some CrewAI errors look like LLM problems but actually come from the framework's own internals — memory and the execution process.

OpenAI Authentication Error Even Though You Use Ollama

openai.AuthenticationError: Incorrect API key provided

By default, CrewAI uses OpenAI embeddings for agents' short-term memory even when the main model is a local one through Ollama. If the OPENAI_API_KEY variable is not set, this error appears the first time memory is accessed. The fix is to explicitly configure a local embedder for the Crew, or disable memory if the task does not need it.

Attribute manager_llm Is Required for Process.hierarchical

The hierarchical process needs a separate model for the manager agent that distributes tasks. If you pass only process=Process.hierarchical without manager_llm, the Crew fails validation before it even starts. Add manager_llm=llm when creating the Crew object.

Sequential vs Hierarchical: Comparing Processes

Parameter Process.sequential Process.hierarchical
Task order Strictly follows the tasks list Decided by the manager at runtime
Needs manager_llm No Yes, required
Predictability High Lower, depends on manager decisions
When to use Known sequence of steps Tasks can be redistributed dynamically

When CrewAI Is Not a Good Fit

  • You just need one direct model call without roles or memory — the framework's overhead does not pay off, so it is simpler to call Ollama directly.
  • You need fine-grained control over every step of the call chain — LangChain with explicit chains fits this better.
  • Agents need to write and run arbitrary code themselves in a dialogue — that is the strength of AutoGen, not CrewAI.
  • Latency of tens of milliseconds is critical — each agent in the crew costs a separate LLM call, and total time grows with the number of agents.

Verifying the Crew Works

python3 -c "import crewai; print(crewai.__version__)"
ollama list

Run the crew with verbose=True and confirm the log shows handoffs between agents: each agent should clearly receive a task, produce an intermediate result, and pass it on. If the log stops after the first agent without an error, check that expected_output is specific enough — a vague description of the desired result can make an agent stall while trying to refine it.

Another practical point is runtime cost. Even with a free local model through Ollama, each agent in the crew adds a separate sequential LLM call, and total crew execution time grows almost linearly with the number of agents and tasks. Before adding a fourth or fifth agent to the crew, measure how much the overall response time increased and decide whether the added role specialization is worth that extra latency. In practice, it rarely pays off to keep more than three or four agents in one sequential chain — beyond that point, reworking one large task into a dedicated agent is usually more effective than splitting it even further.

Was this article helpful?
← Back to Knowledge Base Ask Support