Skip to main content

LlamaIndex Llms Integration: Cerebras

At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

With Cerebras as your inference provider, you can:

  • Achieve unprecedented speed for AI inference workloads
  • Build commercially with high throughput
  • Effortlessly scale your AI workloads with our seamless clustering technology

Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

Want to experience the power of Cerebras? Check out our website for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!

For more information about Cerebras Cloud, visit cloud.cerebras.ai. Our API reference is available at inference-docs.cerebras.ai.

Installation

using poetry:

poetry add llama-index-llms-cerebras

or using pip:

pip install llama-index-llms-cerebras

Basic Usage

Get an API Key from cloud.cerebras.ai and add it to your environment variables:

export CEREBRAS_API_KEY=<your api key>

Then try out one of these examples:

import os

from llama_index.core.llms import ChatMessage
from llama_index.llms.cerebras import Cerebras

llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

messages = [
    ChatMessage(
        role="system", content="You are a pirate with a colorful personality"
    ),
    ChatMessage(role="user", content="What is your name"),
]
resp = llm.chat(messages)
print(resp)

Or alternatively with streaming:

import os

from llama_index.llms.cerebras import Cerebras

llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

response = llm.stream_complete("What is Generative AI?")
for r in response:
    print(r.delta, end="")

Metadata

Release files for llama-index-llms-cerebras 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-llms-cerebras 0.5.0
File Size Uploaded
llama_index_llms_cerebras-0.5.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-llms-cerebras 0.5.0
File Interpreter ABI Platform
llama_index_llms_cerebras-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / llama_index_llms_cerebras-0.5.0.tar.gz

Download URL llama_index_llms_cerebras-0.5.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
950227a0166f0ac34c2bd4afa75cf5b74d97e3f9cfe32bb47a2af3387cda887d
BLAKE2b-256 checksum
How to use checksums
cbc77ae4f393d77b8bb9b80cc7aca36dbdeec3ca3a5163efae5cff7e08017bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_llms_cerebras-0.5.0-py3-none-any.whl

Download URL llama_index_llms_cerebras-0.5.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8fdc2f9bacefbe1dc0ae0238a646180140b31c5079c1caca6c6d00412487412
BLAKE2b-256 checksum
How to use checksums
9be3b0b1ebec3fdeb9a20d069bd4cb338a6a4bdcc84ce6cc570bff0afb6e722e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page