skillfed

langchain-cerebras

An integration package connecting Cerebras and LangChain

langchain-cerebras v0.8.2 136.4K downloads/30d#11,397 on PyPI7
Permissive license MIT Active released

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-cerebras

uv

uv add langchain-cerebras

poetry

poetry add langchain-cerebras

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

cerebras langchain integrationcerebras ai inferencelangchain chat model providercerebras wse-3 apiai inference integrationcerebras cloud llmlangchain cerebras chat
llm-integrationinference-providercerebras

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

cerebras-cloud-sdk

Provides a Python client library for accessing…

permissive · top 5,000 on PyPI

langchain-groq

Connects Groq's inference API to LangChain,…

permissive · top 5,000 on PyPI

langchain-redis

Integrates Redis with LangChain to provide…

permissive · top 15,000 on PyPI

langchain-cohere

Connects LangChain applications to Cohere's…

permissive · top 5,000 on PyPI

langchain-weaviate

Integrates Weaviate vector database with…

permissive · top 15,000 on PyPI

langchain-google-genai

Integrates Google's Gemini AI models (chat,…

permissive · top 5,000 on PyPI

langchain-databricks

Connects LangChain applications to Databricks…

permissive · top 15,000 on PyPI

langchain-azure-ai

Integrates Microsoft Foundry (Azure AI)…

permissive · top 5,000 on PyPI

langchain-fireworks

Integrates Fireworks.ai language models with…

permissive · top 5,000 on PyPI

langchain-nvidia-ai-endpoints

Integrates NVIDIA AI Foundation Models and chat…

permissive · top 5,000 on PyPI