langchain-cerebras
An integration package connecting Cerebras and LangChain
What it is and what it does
langchain-cerebras is a LangChain integration package that connects Cerebras' AI inference services to the LangChain framework. It exposes Cerebras' WSE-3 processor-powered models through a ChatCerebras class that implements the standard LangChain chat model interface, allowing developers to use Cerebras as an inference backend in LangChain chains and applications.
The package requires an API key from Cerebras Cloud and handles authentication and communication with Cerebras' inference endpoints. It depends on langchain-core for the base chat model interface and langchain-openai for underlying request handling. Developers can compose Cerebras chat models with LangChain prompts, chains, and agents using the standard LangChain pipe syntax, making it straightforward to swap Cerebras in for other LLM providers.
Use it for:
- Build LangChain applications that use Cerebras' inference for high-throughput generative AI workloads.
- Integrate Cerebras models into multi-step LangChain chains and agents without provider-specific code.
- Prototype and deploy chat applications leveraging Cerebras' WSE-3 performance for faster inference.
- Replace other LangChain inference providers with Cerebras by swapping the model class in existing chains.
- Access large open-source models like Llama through Cerebras' managed inference service via LangChain.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Cerebras AI inference services with LangChain, enabling chat models powered by Cerebras' WSE-3 processor through a standard LangChain interface.
Yes, if you have access to Cerebras Cloud and want to use Cerebras inference within LangChain. Low install friction, active maintenance, no known vulnerabilities, and permissive MIT license make it a straightforward addition. Not applicable if you don't have a Cerebras API key or prefer other inference providers.
Install
langchain-cerebras on PyPI
pip
pip install langchain-cerebrasuv
uv add langchain-cerebraspoetry
poetry add langchain-cerebrasInstalling langchain-cerebras
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent commits; last release 263 days ago suggests regular updates. Depends on langchain-core and langchain-openai, both established LangChain packages.
License in practice
MIT license permits commercial and private use with minimal restrictions—standard permissive terms suitable for most projects.
Quickstart
pip install langchain-cerebras
from langchain_cerebras import ChatCerebras
from langchain_core.prompts import ChatPromptTemplate
chat = ChatCerebras(model="llama-3.3-70b")
prompt = ChatPromptTemplate.from_messages([("system", "You are helpful."), ("human", "Hello")])
chain = prompt | chat
chain.invoke({"text": "example"})
Requires a valid CEREBRAS_API_KEY environment variable set from cloud.cerebras.ai; Python 3.11 or 3.12.
Verify before relying
- Which Cerebras models are available through the API beyond llama-3.3-70b.
- Pricing and rate limits for Cerebras Cloud inference.
- Whether streaming or async chat methods are supported.
- Performance benchmarks compared to other LangChain inference providers.
Package facts
| License | MIT (permissive) |
| Python support | capped below the current Python release (<3.13,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — langchain-core, langchain-openai |
| Maintenance | actively maintained — 263 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,420/month — #11,397 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_cerebras-0.8.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
cerebras-cloud-sdkProvides a Python client library for accessing…
permissive · top 5,000 on PyPI
langchain-groqConnects Groq's inference API to LangChain,…
permissive · top 5,000 on PyPI
langchain-redisIntegrates Redis with LangChain to provide…
permissive · top 15,000 on PyPI
langchain-cohereConnects LangChain applications to Cohere's…
permissive · top 5,000 on PyPI
langchain-weaviateIntegrates Weaviate vector database with…
permissive · top 15,000 on PyPI
langchain-google-genaiIntegrates Google's Gemini AI models (chat,…
permissive · top 5,000 on PyPI
langchain-databricksConnects LangChain applications to Databricks…
permissive · top 15,000 on PyPI
langchain-azure-aiIntegrates Microsoft Foundry (Azure AI)…
permissive · top 5,000 on PyPI
langchain-fireworksIntegrates Fireworks.ai language models with…
permissive · top 5,000 on PyPI
langchain-nvidia-ai-endpointsIntegrates NVIDIA AI Foundation Models and chat…
permissive · top 5,000 on PyPI