Docs

LangChain OpenAI-compatible Python integration

Use LangChain OpenAI integrations with abliteration.ai. Configure ChatOpenAI with base_url, api_key, abliterated-model, and the OpenAI-compatible chat completions endpoint.

Updated 2026-06-06

LangChain can call any OpenAI-compatible endpoint. Configure ChatOpenAI from langchain_openai with the abliteration.ai base URL and your API key.

Your chains, tools, agents, retrievers, and prompts stay the same. Only the LangChain OpenAI provider configuration changes.

This is useful for enterprise research pipelines that need less-restricted model behavior for AI red teaming, synthetic eval data, trust and safety classifier work, and ML behavior analysis.

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="abliterated-model",
    base_url="https://api.abliteration.ai/v1",
    api_key="YOUR_ABLIT_KEY",
)

response = llm.invoke("Give me a one-sentence summary of Stonehenge.")
print(response.content)

LangChain OpenAI settings

Production governance

For red-team, cybersecurity, trust and safety, synthetic data, or regulated research workflows, keep LangChain orchestration separate from policy enforcement.