LangGraph with an uncensored model

To run LangChain and LangGraph with an uncensored model, give ChatOpenAI or ChatAnthropic a custom base URL and an abliterated model id, then pass it to create_agent.

Updated November 18, 2026By unrestrictedaiagent
agent.pyPython
import os, shutil
from langchain.agents import create_agent
from langchain_openai import ChatOpenAI
from langgraph.checkpoint.memory import InMemorySaver

model = ChatOpenAI(
    model="kimi-k3.1-pro-uncensored",
    base_url="https://api.silkcompute.com",
    api_key=os.environ["SILK_API_KEY"],
)

def disk_usage(path: str) -> str:
    """Report disk usage for a folder on this machine."""
    total, used, free = shutil.disk_usage(path)
    return f"{used / total:.0%} used, {free // 2**30} GB free"

agent = create_agent(model=model, tools=[disk_usage],
                     checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "ops-1"}}
reply = agent.invoke(
    {"messages": [{"role": "user", "content": "Is / almost full?"}]}, config)
print(reply["messages"][-1].content)
OpenAI format
ChatOpenAI(base_url=)
Anthropic format
ChatAnthropic(base_url=)
Tool calling
create_agent(tools=)
Streaming
agent.stream
Browser use
Deep Agents add-on
Memory
Checkpointer

Labels link to LangChain and LangGraph's own docs, read November 18, 2026. Compare all 11

Point the agent only at systems, files and accounts you own or are allowed to test.

Deploy it

3 steps, with Kimi K3.1 Pro.

  1. 01

    Install the packages. The checkpointer comes from the langgraph package.

    Terminal
    pip install langchain langchain-openai langgraph
    export SILK_API_KEY=...
  2. 02

    Set the model and base URL. ChatOpenAI takes base_url and api_key as arguments.

    See agent.py above
  3. 03

    Use the Anthropic format instead. ChatAnthropic takes base_url too, from langchain-anthropic.

    agent.py
    from langchain_anthropic import ChatAnthropic
    
    model = ChatAnthropic(model="kimi-k3.1-pro-uncensored",
                          base_url="https://api.silkcompute.com",
                          api_key=os.environ["SILK_API_KEY"])

Which model

The config uses the Silk Compute base URL, which serves both models with a 1,048,576-token context.

Sources

More frameworks