AutoGen
AutoGen AgentChat with an OpenAI-compatible uncensored API
Run AutoGen AgentChat on Abliterator: OpenAIChatCompletionClient with base_url and the required model_info, streaming to Console, and a tool-using AssistantAgent.
Create OpenAIChatCompletionClient(model="kimi-k3.1-pro-abliterated", base_url="https://abliterator.ai/v1", api_key=..., model_info={...}). AutoGen raises ValueError without model_info for any non-OpenAI model name.
AutoGen's AgentChat layer uses OpenAIChatCompletionClient from autogen-ext for any OpenAI-compatible endpoint. The AutoGen models tutorial notes that non-OpenAI models must declare their capabilities in model_info. Tested with autogen-agentchat and autogen-ext 0.7.5.
Install
pip install autogen-agentchat "autogen-ext[openai]"
export ABL_API_KEY="sk-abl-v1-..."
Create the model client
import asyncio
import os
from autogen_core.models import UserMessage
from autogen_ext.models.openai import OpenAIChatCompletionClient
client = OpenAIChatCompletionClient(
model="kimi-k3.1-pro-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
model_info={
"vision": True,
"function_calling": True,
"json_output": True,
"structured_output": True,
"family": "unknown",
},
)
async def main() -> None:
result = await client.create(
[UserMessage(content="Outline a purple-team exercise for testing detection of LSASS access.", source="user")]
)
print(result.content)
print(result.usage)
await client.close()
asyncio.run(main())
model_info replaces AutoGen's lookup table of OpenAI models. If you leave it out, the constructor raises ValueError: model_info is required when model name is not a valid OpenAI model.
Stream an agent to the console
model_client_stream=True makes AssistantAgent emit token chunks, and Console renders them:
import asyncio
import os
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
client = OpenAIChatCompletionClient(
model="deepseek-v4.1-flash-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
model_info={"vision": True, "function_calling": True, "json_output": True, "structured_output": True, "family": "unknown"},
)
agent = AssistantAgent(
"analyst",
model_client=client,
system_message="You explain security concepts to engineers. Be concrete.",
model_client_stream=True,
)
async def main() -> None:
await Console(agent.run_stream(task="Explain how SSRF reaches cloud metadata endpoints and how IMDSv2 mitigates it."))
await client.close()
asyncio.run(main())
Without Console, iterate agent.run_stream(...) yourself; token chunks arrive as ModelClientStreamingChunkEvent messages and the final item is a TaskResult.
A tool-using AssistantAgent
Plain async functions become tools. Set reflect_on_tool_use=True so the model turns the tool output into an answer, and raise max_tool_iterations if it may need several calls:
import asyncio
import os
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def get_sigma_rule(technique_id: str) -> str:
"""Return the detection rule the SOC has deployed for a MITRE ATT&CK technique."""
return f"{technique_id}: rule 'Suspicious LSASS handle', process_access GrantedAccess 0x1010, deployed 2026-06"
client = OpenAIChatCompletionClient(
model="kimi-k3.1-pro-abliterated",
base_url="https://abliterator.ai/v1",
api_key=os.environ["ABL_API_KEY"],
model_info={"vision": True, "function_calling": True, "json_output": True, "structured_output": True, "family": "unknown"},
)
agent = AssistantAgent(
"detection_engineer",
model_client=client,
tools=[get_sigma_rule],
reflect_on_tool_use=True,
max_tool_iterations=3,
system_message="You review detection coverage. Check deployed rules before answering.",
)
async def main() -> None:
result = await agent.run(task="Do we detect T1003.001? Name one gap in the deployed rule.")
print(result.messages[-1].content)
await client.close()
asyncio.run(main())
Troubleshooting
ValueError: model_info is required when model name is not a valid OpenAI model. Add themodel_infodict shown above.ValueError: The model does not support function calling.model_info["function_calling"]isFalsewhile the agent has tools. Set it toTrue.- The agent's last message is the tool's raw output. Set
reflect_on_tool_use=True. ValueError: Model does not support vision and image was provided. AutoGen checksmodel_info["vision"]before sending aMultiModalMessage. Abliterator models accept images, so set it toTrue(/docs/vision).- Replies end with the word TERMINATE. AssistantAgent's default
system_messagetells the model to say it when done, for use with termination conditions. Pass your ownsystem_messageif you do not want it.
Frequently asked questions
What should model_info say for Abliterator's models?
Both Abliterator models take images, call tools and follow JSON schemas, so vision, function_calling, json_output and structured_output can all be True. Use family "unknown" so AutoGen applies no model-specific quirks.
Why does my AssistantAgent return the raw tool output instead of an answer?
With tools and no output_content_type, AssistantAgent ends its turn with a summary of the tool result by default. Set reflect_on_tool_use=True to have the model read the result and write a reply.
Do AutoGen teams like RoundRobinGroupChat work with Abliterator?
Yes. Teams only orchestrate agents; each agent's model_client makes ordinary Chat Completions calls, so give every agent a client configured as on this page.