Docs›LangGraph
Agent FrameworkConnect CLōD to LangGraph
Build stateful multi-agent graphs with LangGraph — backed by CLōD's cheaper inference.
Overview
LangGraph is a library for building stateful, multi-actor applications with LLMs. Since CLōD is OpenAI-compatible, drop it in as the LLM backend for any LangGraph agent or workflow — tool calling, streaming, and structured output all work out of the box.
Prerequisites
- • CLōD account — free at app.clod.io
- • LangGraph installed
- • CLōD API key (Dashboard → API Keys → Generate)
Setup
Step 1: Install dependencies
pip install langgraph langchain-openai openai
Step 2: Configure CLōD LLM
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="gpt-4o",
api_key="your_clod_api_key",
base_url="https://api.clod.io/v1",
)
Step 3: Build a LangGraph agent
from langgraph.graph import StateGraph, END
from typing import TypedDict, Annotated
import operator
class AgentState(TypedDict):
messages: Annotated[list, operator.add]
def call_model(state):
response = llm.invoke(state["messages"])
return {"messages": [response]}
graph = StateGraph(AgentState)
graph.add_node("agent", call_model)
graph.set_entry_point("agent")
graph.add_edge("agent", END)
app = graph.compile()
result = app.invoke({"messages": [("user", "Plan a multi-step task")]})
Available Models
CLōD supports 50+ models. For agentic tools, use models that support tool calling / function calling.
Browse models →