Skip to Content

CrewAI

CrewAI gets a governed LLM, backed by LiteLLM, pointed at the Agent Fabric LLM proxy. The adapter translates the governed connection into LiteLLM’s own model-string and kwarg conventions for you.

What you get

  • A native crewai.LLM, with the proxy auth and attribution headers set.
  • The openai/ model prefix and LiteLLM kwarg names handled automatically.
  • Supported at connection_kwargs(). CrewAI’s model calls go through LiteLLM, so correlation is per client and donkey.last_call is not populated — the same as Google ADK (see Notes).

Install

pip install "donkey-kit[crewai]"

Quickstart

from donkey_kit.integrations.crewai import llm model = llm("gpt-4o")

model is a real crewai.LLM instance. The model string is prefixed with openai/ before it reaches LiteLLM (openai/gpt-4o), which is the prefix LiteLLM’s OpenAI-compatible route expects — you don’t add it yourself.

Three ways to construct

1. Off a shared Donkey instance:

from donkey_kit import Donkey async with Donkey.from_env() as donkey: model = donkey.crewai.llm("gpt-4o")

2. Module-level factory (shortest):

from donkey_kit.integrations.crewai import llm model = llm("gpt-4o")

3. Governed kwargs, native constructor:

from donkey_kit import Donkey from crewai import LLM async with Donkey.from_env() as donkey: model = LLM(model="openai/gpt-4o", **donkey.crewai.connection_kwargs())

Manual equivalent

from crewai import LLM model = LLM( model="openai/gpt-4o", api_base=..., # from DONKEY_LLM_PROXY_URL, no /v1 suffix api_key=..., extra_headers=..., # client_id / client_secret header pair )

LiteLLM uses api_base and extra_headers, not base_url / default_headers — connection_kwargs() already translates for you.

Notes

  • Correlation IDs are per-client, not per-run. CrewAI sends requests through its built-in LiteLLM model layer rather than the SDK’s shared HTTP client, so the correlation ID is set once per client instead of per donkey.run(). Every governance header is still sent on every request. The conformance suite checks this as a documented behaviour.
  • donkey.last_call is unavailable. Because the response is handled by LiteLLM, gateway identity, routing, and usage fields can’t be observed. When every adapter resolved on a Donkey is like this one, donkey.last_call reports status == LastCallStatus.UNAVAILABLE and available == False, and names the resolved adapters in surface.

See the error taxonomy for how proxy rejections surface through CrewAI’s LiteLLM layer.

Last updated on