Setup: installing CrewAI
CrewAI is one pip package that brings the agent, task, crew and flow classes and the OpenAI SDK.
Last updated: 28 Sep, 2026 · CrewAI 1.15
The introduction drew the map. Before the first crew, install the package and turn off the calls CrewAI makes to its own servers, so a run stays offline.
Installing the package
The crewai package brings the agent, task, crew and flow classes, and OpenAI's SDK, which CrewAI also uses to reach OpenRouter. Other providers, such as Anthropic and Gemini, need one more package.
pip install "crewai==1.15.22"Check which version Python finds:
from importlib.metadata import version
print(version("crewai"))1.15.22
CrewAI also ships a crewai command that generates a project folder of YAML files and classes. Plain Python files are used below, so every lesson is one script you can run; the generated layout is the same pieces in a different shape.
Turning off telemetry and version checks
CrewAI collects anonymous usage data, such as agent roles and tool names, and sends it to its own servers. Setting CREWAI_DISABLE_TELEMETRY to true turns that off. Two more variables keep a run offline: CREWAI_TRACING_ENABLED=false declines the trace upload a first run offers, and CREWAI_DISABLE_VERSION_CHECK=true stops the check against PyPI that a verbose run makes. The model you write in the custom-LLM lesson sets all three.
A hosted model from a free providerOptional
Every lesson runs on the stand-in model from the custom-LLM lesson. To use a hosted model instead, set its key as an environment variable and, for some providers, install one more package. The real-model lesson makes the switch with LLM.
| Provider | Key | Variable | Package and model id |
|---|---|---|---|
| OpenRouter | free models end in :free, openrouter.ai/keys | OPENROUTER_API_KEY | none; a model id from openrouter.ai/models |
| Gemini | free, aistudio.google.com/apikey | GEMINI_API_KEY | crewai[google-genai]; a gemini/... id from the provider's list |
| Groq | free, console.groq.com/keys | GROQ_API_KEY | crewai[litellm]; a groq/... id from the provider's list |
Model ids change often, so read each provider's current model list rather than copying one from a tutorial. Set the key as an environment variable:
export OPENROUTER_API_KEY=sk-or-...Stand-in or hosted: which to use
- The stand-in from the custom-LLM lesson for every lesson here: no key, no cost, the same output each run.
- A hosted model when you want real language quality, wired in with one argument in the real-model lesson.
Related
- Previous: Introduction to CrewAI
- Next: A support desk in plain Python
- Run
pip show crewaiand findopenaiandpydanticin itsRequiresline.
Little by little, you're building something great.