CrewAI
CrewAI agents with an OpenAI-compatible uncensored API
Give CrewAI agents an Abliterator model with LLM(model="openai/...", base_url=...), stream a crew's output, and give agents tools with the @tool decorator.
Create LLM(model="openai/kimi-k3.1-pro-abliterated", base_url="https://abliterator.ai/v1", api_key=os.environ["ABL_API_KEY"]) and pass it as llm= to each Agent. The openai/ prefix selects CrewAI's native OpenAI-compatible client.
CrewAI's LLM class selects a provider from the model string's prefix. With openai/ and a base_url, CrewAI 1.x sends Chat Completions requests to that URL with its native OpenAI client, as described in the CrewAI LLM docs. Tested with crewai 1.15.
Install
pip install crewai
export ABL_API_KEY="sk-abl-v1-..."
Configure the LLM and run a crew
import os
from crewai import LLM, Agent, Crew, Task
abliterator = LLM(
model="openai/kimi-k3.1-pro-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
context_window_size=1048576,
max_tokens=2048,
)
researcher = Agent(
role="Threat intelligence analyst",
goal="Brief defenders on a threat actor's tradecraft",
backstory="You write concise, sourced briefs for a SOC.",
llm=abliterator,
)
brief = Task(
description="Write a one-page brief on how ransomware crews typically gain initial access through exposed VPN appliances.",
expected_output="A brief with sections: summary, common techniques, detections, mitigations.",
agent=researcher,
)
result = Crew(agents=[researcher], tasks=[brief]).kickoff()
print(result.raw)
print(result.token_usage)
context_window_size matters: CrewAI does not know Abliterator's model names, so without it it assumes an 8,192-token window and trims or summarizes long task context early. Both Abliterator models take 1,048,576 tokens.
Agents without llm= fall back to CrewAI's default model, which calls OpenAI. Pass the Abliterator LLM to every agent, or set OPENAI_BASE_URL=https://abliterator.ai/v1 and OPENAI_API_KEY to your Abliterator key so defaults follow.
Stream a crew
Build the crew with stream=True. kickoff() then returns an iterable of chunks, and .result holds the final CrewOutput once iteration ends:
import os
from crewai import LLM, Agent, Crew, Task
abliterator = LLM(
model="openai/deepseek-v4.1-flash-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
context_window_size=1048576,
)
writer = Agent(
role="Security awareness writer",
goal="Explain attacks so non-experts can spot them",
backstory="You turn incident reports into plain-language training.",
llm=abliterator,
)
task = Task(
description="Explain how a QR-code phishing (quishing) attack works and three ways to spot one.",
expected_output="Under 300 words, plain language.",
agent=writer,
)
streaming = Crew(agents=[writer], tasks=[task], stream=True).kickoff()
for chunk in streaming:
print(chunk.content, end="", flush=True)
print("\n---\n", streaming.result.raw[:80])
For one-off calls outside a crew, LLM(..., stream=True).call("...") streams too and emits LLMStreamChunkEvents on CrewAI's event bus.
Give an agent tools
The @tool decorator turns a function into a CrewAI tool. The docstring becomes the description the model sees:
import os
from crewai import LLM, Agent, Crew, Task
from crewai.tools import tool
@tool("Vulnerability database lookup")
def vuln_lookup(cve_id: str) -> str:
"""Look up CVSS score, affected versions and fix for a CVE ID."""
return f"{cve_id}: CVSS 9.8, affects AcmeVPN 7.0-7.4, fixed in 7.4.2, exploited in the wild"
abliterator = LLM(
model="openai/kimi-k3.1-pro-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
context_window_size=1048576,
)
analyst = Agent(
role="Vulnerability analyst",
goal="Decide patch priority with evidence",
backstory="You check the vulnerability database before every recommendation.",
tools=[vuln_lookup],
llm=abliterator,
)
task = Task(
description="We run AcmeVPN 7.3. Check CVE-2026-0042 and recommend a patch window.",
expected_output="A recommendation with the CVSS score and a deadline.",
agent=analyst,
)
print(Crew(agents=[analyst], tasks=[task]).kickoff().raw)
CrewAI uses native function calling when the LLM supports it, which it reports for openai/ models.
Troubleshooting
AuthenticationErrormentioning platform.openai.com. One agent has nollm=(or a Crew feature likeplanning=Truehas noplanning_llm) and fell back to the default OpenAI model.- 404 from Abliterator.
base_urlmust behttps://abliterator.ai/v1with/v1. CrewAI's client appends/chat/completions. - Memory or knowledge errors. They need embeddings, which Abliterator does not serve. Configure
embedderon the crew with another provider, or leave memory off. - Warning: "The context window of model ... is unknown, so CrewAI assumes 8,192 tokens". Add
context_window_size=1048576to theLLM. - Output stops mid-answer. Raise
max_tokenson theLLM. Both Abliterator models allow far larger outputs (/models). - Rate limits with large crews. Each agent step is a request. Use
max_rpmon theCreworAgentto stay under your plan's requests per minute.
Frequently asked questions
Does CrewAI need LiteLLM to reach Abliterator?
No. In CrewAI 1.x the openai/ prefix uses CrewAI's native OpenAI client, which honors base_url. You only need the crewai[litellm] extra for providers CrewAI has no native client for.
Can different agents in one crew use different Abliterator models?
Yes. Create one LLM per model and pass each to the agents that need it, for example kimi-k3.1-pro-abliterated for the planner and deepseek-v4.1-flash-abliterated for high-volume summarizing agents.
Why does the crew still call OpenAI for planning or memory?
Crew-level features have their own model settings. planning=True uses planning_llm, and memory uses an embedder. Set planning_llm to your Abliterator LLM, and give memory a separate embedding provider because Abliterator has no embeddings endpoint.