CrewAI is a framework for orchestrating autonomous AI agents — enabling you to create AI teams where each agent has specific roles, tools, and goals, working together to accomplish complex tasks. You can deploy your CrewAI scripts to Blaxel with minimal code edition (and zero configuration), enabling you to use Serverless DeploymentsAgentic ObservabilityPolicies, and more.

Get started with CrewAI on Blaxel

If you already have a CrewAI agentic application, adapt your code with Blaxel SDK commands to use Blaxel features at deployment and runtime. All commands in this section will be referred to in Python syntax.

1- open your CrewAI folder and add a folder agent.py with the following code. Import the main function that is the entry point for your CrewAI agentic workflow. This code wraps the execution of the CrewAI code with the Blaxel SDK to serve the agent. Don’t forget to add all necessary API keys for the execution of your agentic system.

from blaxel.agents import agent
from fastapi import Request

from sales_pdf.main import run

@agent(agent={"metadata": {"name": "sales-pdf"}, "spec": {"runtime": {"envs": [{"name":"EXAMPLE_API_KEY", "value": "${secrets.EXAMPLE_API_KEY}"}]}}}, override_agent=True)
async def main(request: Request):
    return run(await request.json())

2- Update the pyproject.toml file with the Blaxel dependency and set Python version ≥ 3.12.

requires-python = ">=3.12,<=3.13"
dependencies = [
    "blaxel>=0.0.53"
]

3- Serve locally and deploy the agent as described in this documentation.

Use Blaxel features with CrewAI

Currently, some Blaxel features aren’t available out-of-the-box with CrewAI, though we’re actively working to complete this support.

You can deploy your CrewAI package as a single endpoint on Blaxel, which results in a monolithic Agent deployment rather than separate models and tools.