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.
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.
- 01
Install the packages. The checkpointer comes from the langgraph package.
Terminalpip install langchain langchain-openai langgraph export SILK_API_KEY=... - 02
Set the model and base URL. ChatOpenAI takes base_url and api_key as arguments.
See agent.py above - 03
Use the Anthropic format instead. ChatAnthropic takes base_url too, from langchain-anthropic.
agent.pyfrom 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
Kimi K3.1 Pro
Long runs, image and video input
- Id
kimi-k3.1-pro-uncensored- Per 1M in / out
- $3.50 / $8.00
DeepSeek V4.1 Flash 1017
Value, image input
- Id
deepseek-v4.1-flash-1017-uncensored- Per 1M in / out
- $0.24 / $0.90
The config uses the Silk Compute base URL, which serves both models with a 1,048,576-token context.