{"id":146,"library":"cerebras-cloud-sdk","title":"Cerebras Cloud SDK","description":"Official Python SDK for the Cerebras Cloud inference API. Provides access to ultra-fast LLM inference on Cerebras Wafer-Scale Engine hardware. OpenAI-compatible API surface. Generated with Stainless. Current version: 1.67.0 (Mar 2026). Requires Python 3.9+. Note: separate from cerebras-sdk (PyPI) which is a hardware kernel development tool — completely different product.","status":"active","version":"1.67.0","language":"python","source_language":"en","source_url":"https://github.com/Cerebras/cerebras-cloud-sdk-python","tags":["cerebras","llm","inference","python","fast-inference","llama"],"install":[{"cmd":"pip install cerebras-cloud-sdk","lang":"bash","label":"Python"}],"dependencies":[{"reason":"HTTP client. Installed automatically.","package":"httpx","optional":false},{"reason":"Optional async HTTP backend for improved concurrency. Use instead of default httpx for high-throughput async workloads.","package":"aiohttp","optional":true}],"imports":[{"wrong":"from cerebras import Cerebras","symbol":"Cerebras","correct":"import cerebras"}],"quickstart":{"code":"# pip install cerebras-cloud-sdk\nfrom cerebras.cloud.sdk import Cerebras\nimport os\n\nclient = Cerebras(\n    api_key=os.environ.get('CEREBRAS_API_KEY')\n)\n\nresponse = client.chat.completions.create(\n    model='llama3.1-8b',\n    messages=[\n        {'role': 'system', 'content': 'You are a helpful assistant.'},\n        {'role': 'user', 'content': 'What is fast inference?'}\n    ]\n)\nprint(response.choices[0].message.content)","lang":"python","description":"Minimal Cerebras inference call using cerebras-cloud-sdk 1.x."},"warnings":[{"fix":"pip install cerebras-cloud-sdk for cloud inference. cerebras-sdk is for hardware kernel development.","message":"cerebras-sdk on PyPI is a completely different package — it is Cerebras's hardware kernel development SDK for WSE systems. Do not confuse with cerebras-cloud-sdk for cloud inference API.","severity":"breaking","affected_versions":"all"},{"fix":"client = Cerebras(api_key=..., warm_tcp_connection=False) — and reuse a single client instance rather than reconstructing.","message":"SDK sends TCP warming requests to /v1/tcp_warming on client construction to reduce time-to-first-token. Creates network traffic at import time. Disable with warm_tcp_connection=False if reconstructing client frequently.","severity":"gotcha","affected_versions":"all"},{"fix":"Create a module-level singleton client. Do not instantiate Cerebras() inside request handlers or loops.","message":"Reconstructing the Cerebras client instance repeatedly causes poor performance due to repeated TCP warming. Construct once and reuse.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3.9 or higher.","message":"Requires Python 3.9+. Will fail to install on Python 3.8 with no clear error message.","severity":"gotcha","affected_versions":"all"},{"fix":"Use cerebras-cloud-sdk directly, not openai with base_url='https://api.cerebras.ai'.","message":"LLMs with no training data on Cerebras will hallucinate OpenAI-style base_url override pattern. Cerebras has its own SDK — do not use openai with base_url for Cerebras.","severity":"gotcha","affected_versions":"all"},{"fix":"Initialize the Cerebras client with client = Cerebras(api_key='YOUR_API_KEY') or set the CEREBRAS_API_KEY environment variable before running the application.","message":"The Cerebras client requires an API key, which must be passed as an argument (api_key=...) or set via the CEREBRAS_API_KEY environment variable. Without it, the client cannot be initialized.","severity":"breaking","affected_versions":"all"},{"fix":"Set the CEREBRAS_API_KEY environment variable (e.g., `export CEREBRAS_API_KEY='your_api_key'`) or pass `api_key='your_api_key'` when instantiating the Cerebras client (e.g., `client = Cerebras(api_key='your_api_key')`).","message":"The Cerebras client requires an API key for authentication. This can be provided by setting the CEREBRAS_API_KEY environment variable or by passing the 'api_key' argument directly to the Cerebras client constructor.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.67.0':38 '2026':40 '3.9':43 'access':14 'api':12,31 'cerebra':1,9,22,48,61 'cerebras-sdk':47 'cloud':2,10 'compat':30 'complet':58 'current':36 'develop':56 'differ':59 'engin':26 'fast':18,66 'fast-infer':65 'generat':33 'hardwar':27,54 'infer':11,20,63,67 'kernel':55 'llama':68 'llm':19,62 'mar':39 'note':44 'offici':4 'openai':29 'openai-compat':28 'product':60 'provid':13 'pypi':50 'python':5,42,64 'requir':41 'scale':25 'sdk':3,6,49 'separ':45 'stainless':35 'surfac':32 'tool':57 'ultra':17 'ultra-fast':16 'version':37 'wafer':24 'wafer-scal':23","created_at":"2026-03-24T04:07:52.586474+00:00","updated_at":"2026-04-16T01:44:28.283495+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"1.67.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://cloud.cerebras.ai","github":"https://github.com/Cerebras/cerebras-cloud-sdk-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/cerebras-cloud-sdk/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml","http-networking","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":"verified"}}