--- id: langchain-cerebras version: "0.8.2" license: MIT license_treatment: permissive maintenance: active --- # langchain-cerebras — An integration package connecting Cerebras and LangChain License: permissive · Maintenance: active · Downloads: 136.4K/mo ## 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 above — 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 pip install langchain-cerebras uv add langchain-cerebras 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_current - Install friction: low - Maintenance: active - Downloads: 136.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cerebras langchain integration, cerebras ai inference, langchain chat model provider, cerebras wse-3 api, ai inference integration, cerebras cloud llm, langchain cerebras chat, llm-integration, inference-provider, cerebras [View on SkillFed](https://skillfed.io/packages/langchain-cerebras) · [View on PyPI](https://pypi.org/project/langchain-cerebras/)