Integrations
CrewAI
CrewAI is a Python framework for teams of AI agents that share tasks. Connect it to DEVUP AI with CrewAI's built-in OpenAI client: set base_url to the DEVUP AI API and every agent in your crew runs on DEVUP AI models.
Requirements
- Python 3.10 to 3.13
- A DEVUP AI API key from https://devupai.com/dashboard/api-keys.
Install CrewAI
pip install crewaiCrewAI does not install on Python 3.14 yet. Create a Python 3.13 environment instead, for example with uv:
uv venv --python 3.13 .venvSet environment variables
export DEVUP_API_KEY="your-key"| Variable | Required | Purpose |
|---|---|---|
| DEVUP_API_KEY | Yes | Your DEVUP AI API key, read by the examples below. |
| CREWAI_DISABLE_TELEMETRY | No | Set to true to turn off CrewAI's anonymous telemetry. |
Connect CrewAI to an OpenAI-compatible API
import os
from crewai import LLM
llm = LLM(
model="deepseek-ai/DeepSeek-V4-Pro",
base_url="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
custom_openai=True,
)
print(llm.call("Reply with exactly: Salam DEVUP"))Output: Salam DEVUP
LLM parameters
| Parameter | Value | Why |
|---|---|---|
| model | deepseek-ai/DeepSeek-V4-Pro | The exact DEVUP AI catalog ID. |
| base_url | https://api.devupai.com/v1 | Sends requests to DEVUP AI. |
| api_key | os.environ["DEVUP_API_KEY"] | Keeps the key out of your code. |
| custom_openai | True | Uses CrewAI's built-in OpenAI client for this endpoint; no LiteLLM install is needed. |
Build a multi-agent crew
The researcher answers first; context passes its result to the writer, and Process.sequential runs the tasks in order.
from crewai import Agent, Crew, Process, Task
researcher = Agent(
role="Researcher",
goal="Find short, accurate facts",
backstory="You answer with facts only.",
llm=llm,
)
writer = Agent(
role="Writer",
goal="Turn facts into one clear sentence",
backstory="You write short, plain English.",
llm=llm,
)
research = Task(
description="What is the capital of Algeria?",
expected_output="The city name only.",
agent=researcher,
)
write = Task(
description="Write one sentence that introduces the city from the research.",
expected_output="One sentence.",
agent=writer,
context=[research],
)
crew = Crew(agents=[researcher, writer], tasks=[research, write], process=Process.sequential)
result = crew.kickoff()
print(result.raw) Example output: Algiers is the capital city of Algeria, located on the Mediterranean coast.
Give CrewAI agents custom tools
Decorate a function with @tool and pass it in the agent's tools. The tracking number only exists inside the tool, so seeing it in the answer shows the tool was called.
from crewai.tools import tool
@tool("get_order_status")
def get_order_status(order_id: str) -> str:
"""Look up the delivery status of an order by its ID."""
return f"Order {order_id} has shipped. Tracking number: DZ-4471."
support = Agent(
role="Support agent",
goal="Answer order questions using the order system",
backstory="You always check the order system before answering.",
tools=[get_order_status],
llm=llm,
)
lookup = Task(
description="What is the status of order A-100?",
expected_output="One sentence with the order status.",
agent=support,
)
print(Crew(agents=[support], tasks=[lookup]).kickoff().raw)Output: Order A-100 has shipped. Tracking number: DZ-4471.
Structured output with Pydantic
Set output_pydantic on a task and read result.pydantic.
from pydantic import BaseModel
class Capital(BaseModel):
city: str
country: str
capital_task = Task(
description="What is the capital of Algeria?",
expected_output="The capital city and its country.",
agent=researcher,
output_pydantic=Capital,
)
print(Crew(agents=[researcher], tasks=[capital_task]).kickoff().pydantic)Output: city='Algiers' country='Algeria'
output_pydantic sends a JSON-schema response format. Prefer descriptive field names such as city over name. See Structured Outputs.
Choosing models
Use the exact catalog ID as model. Tool calling needs a model whose catalog entry supports it. See Models and Tool Calling.
Troubleshooting
- Authentication error (401)Set DEVUP_API_KEY in the same terminal that runs your script, without a Bearer prefix.
- pip finds no matching distribution for crewaiCrewAI supports Python 3.10 to 3.13. On Python 3.14, create a 3.13 environment, for example with uv venv --python 3.13.
- A structured field comes back as an identifierWith a JSON-schema response format, a field called name can be filled with an identifier instead of a value. Use a descriptive key such as city.
- The agent answers without calling your toolModels can answer simple questions on their own. Use tools for data the model cannot know, and a model whose catalog entry supports tool calling.
FAQ
Does CrewAI work with DEVUP AI?
Yes. Create an LLM with base_url set to https://api.devupai.com/v1, your DEVUP AI key, and custom_openai=True, then pass it to your agents.
Do I need LiteLLM to use CrewAI with DEVUP AI?
No. With custom_openai=True, CrewAI uses its built-in OpenAI client for the DEVUP AI endpoint.
How is CrewAI usage billed on DEVUP AI?
Every request your crew makes is a regular DEVUP AI API call, metered in Algerian Dinar on your account.
Which Python versions does CrewAI support?
Python 3.10 to 3.13. On Python 3.14, create a 3.13 environment, for example with uv venv --python 3.13.
Can CrewAI agents use tools and return Pydantic models on DEVUP AI?
Yes. Tools decorated with @tool and tasks with output_pydantic both work with DEVUP AI models that support tool calling and structured output.
How do I turn off CrewAI telemetry?
Set the environment variable CREWAI_DISABLE_TELEMETRY to true before running your crew.
Related integrations
- LangChain: Chains and agents with LangChain.
- AutoGen: Multi-agent conversations with AutoGen.
- Pydantic AI: Type-safe agents with Pydantic AI.
- Deep Agents: Long, multi-step tasks with Deep Agents.
- LlamaIndex: Retrieval and RAG with LlamaIndex.