docs/integrate-crewai.md
Use Nexa SDK’s OpenAI-compatible server with CrewAI.
nexa pull NexaAI/Qwen3-4B-GGUF
nexa serve
pip install crewai
python cookbook/crewai/example.py
from crewai import Agent, Task, Crew, LLM
# Point CrewAI to Nexa's OpenAI-compatible endpoint
llm = LLM(
model="huggingface/NexaAI/Qwen3-4B-GGUF",
base_url="http://localhost:18181/v1",
)
agent = Agent(
role="Python Developer",
goal="Write clean and efficient Python code",
backstory="Expert Python developer",
llm=llm,
)
task = Task(
description="Write a Python function to calculate the sum of a list",
expected_output="A working function with docstring",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result)
Notes:
nexa pull.