Docs›LangChain
Agent FrameworkConnect CLōD to LangChain
Use CLōD as the LLM provider in any LangChain chain or agent — fully OpenAI-compatible.
Overview
LangChain is the most widely-used framework for building LLM-powered applications. Since CLōD is OpenAI-compatible, you only need to swap the base_url and api_key — all LangChain chains, agents, tools, and memory modules work without changes.
Prerequisites
- • CLōD account — free at app.clod.io
- • LangChain installed
- • CLōD API key (Dashboard → API Keys → Generate)
Setup
Step 1: Install dependencies
pip install langchain langchain-openai openai
Step 2: Configure CLōD as your LLM
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="meta-llama/Llama-4-Scout-17B-16E-Instruct",
api_key="your_clod_api_key",
base_url="https://api.clod.io/v1",
)
# Use in any chain
from langchain_core.messages import HumanMessage
response = llm.invoke([HumanMessage(content="Hello!")])
print(response.content)
Step 3: Use with chains and agents
from langchain.chains import LLMChain
from langchain_core.prompts import PromptTemplate
prompt = PromptTemplate.from_template("Answer: {question}")
chain = LLMChain(llm=llm, prompt=prompt)
result = chain.run(question="What is energy-aware routing?")
print(result)
Available Models
CLōD supports 50+ models. For agentic tools, use models that support tool calling / function calling.
Browse models →