{"id":27106,"library":"langchain-cerebras","title":"LangChain Cerebras","description":"An integration package that connects Cerebras AI models with the LangChain framework, currently at version 0.8.2. Releases are frequent, with minor and patch updates roughly every few weeks.","status":"active","version":"0.8.2","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/langchain-cerebras","tags":["langchain","cerebras","llm","integration","ai"],"install":[{"cmd":"pip install langchain-cerebras","lang":"bash","label":"Latest PyPI release"}],"dependencies":[{"reason":"Core LangChain dependency, minimal version >=1.1.0 as of 0.8.2","package":"langchain-core","optional":false},{"reason":"Required for OpenAI-compatible API calls, version >=1.0.0","package":"langchain-openai","optional":false}],"imports":[{"note":"","wrong":"","symbol":"Cerebras","correct":"from langchain_cerebras import Cerebras"},{"note":"","wrong":"","symbol":"ChatCerebras","correct":"from langchain_cerebras import ChatCerebras"},{"note":"Community package is deprecated; use langchain-cerebras directly.","wrong":"from langchain_community.embeddings import CerebrasEmbeddings","symbol":"CerebrasEmbeddings","correct":"from langchain_cerebras import CerebrasEmbeddings"}],"quickstart":{"code":"import os\nfrom langchain_cerebras import ChatCerebras\n\nllm = ChatCerebras(\n    model=\"llama3.1-8b\",\n    api_key=os.environ.get(\"CEREBRAS_API_KEY\", \"\"),\n    temperature=0.7\n)\nresponse = llm.invoke(\"Hello, how are you?\")\nprint(response.content)","lang":"python","description":"Initialize ChatCerebras with an API key and model name, then invoke a simple prompt."},"warnings":[{"fix":"Review the changelog and adjust calls to include additional parameters like 'reasoning_effort' if needed.","message":"Version 0.8.0 introduced reasoning parameters support, which may require updates to existing code if using the previous simple generation interface.","severity":"breaking","affected_versions":">=0.8.0,<0.9.0"},{"fix":"Use the new import from langchain_cerebras instead.","message":"The old import path 'from langchain_community.llms import Cerebras' is deprecated in favor of 'from langchain_cerebras import Cerebras'.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Use Python 3.11 or 3.12.","message":"The library requires Python 3.11 or 3.12; Python 3.13 is not supported as of version 0.8.2.","severity":"gotcha","affected_versions":">=0.7.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install langchain-cerebras and import from there: from langchain_cerebras import Cerebras","cause":"The Cerebras integration has been moved out of langchain-community into its own package.","error":"ImportError: cannot import name 'Cerebras' from 'langchain_community'"},{"fix":"Run: pip install langchain-openai","cause":"langchain-cerebras depends on langchain-openai for making API calls, but it might not be installed automatically.","error":"ModuleNotFoundError: No module named 'langchain_openai'"},{"fix":"Upgrade langchain-cerebras to >=0.8.0: pip install --upgrade langchain-cerebras","cause":"Attempting to use reasoning parameters with an older version of langchain-cerebras (before 0.8.0) that doesn't support them.","error":"TypeError: ChatCerebras.__init__() got an unexpected keyword argument 'reasoning_effort'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}