Skip to main content

llama-index llms cerebras integration

Project description

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="llama3.1-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="llama3.1-70b", api_key=os.environ["CEREBRAS_API_KEY"])

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_cerebras-0.2.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_cerebras-0.2.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_cerebras-0.2.1.tar.gz.

File metadata

  • Download URL: llama_index_llms_cerebras-0.2.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for llama_index_llms_cerebras-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8b4df30d5f70c158efaa1c7a74d14db44d3b2771079e5442d27cf09d385ac077
MD5 85b4d9c45cc2ee35eb6c13ea1265f26c
BLAKE2b-256 995c67977f994587bf0c602becf9bc1268f49916ed54bd51dd46749d11b44a4d

See more details on using hashes here.

File details

Details for the file llama_index_llms_cerebras-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_cerebras-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d22e168618f30746561170075ea318d6c07df7d3daeb244159f6620db71cdf15
MD5 757f0e8dfbc809ea45541a16ad991007
BLAKE2b-256 8da018afbdab13ad2a7402196233dc9e8eda7caf5c7971b5f115830a6e1d8732

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page