Overview
CerebrasLLMService provides access to Cerebras’s language models through an OpenAI-compatible interface. It inherits from OpenAILLMService and supports streaming responses, function calling, and context management with ultra-fast inference speeds.
Cerebras LLM API Reference
Pipecat’s API methods for Cerebras integration
Example Implementation
Complete example with function calling
Cerebras Documentation
Official Cerebras inference API documentation
Cerebras Platform
Access models and manage API keys
Installation
To use Cerebras services, install the required dependency:Prerequisites
Cerebras Account Setup
Before using Cerebras LLM services, you need:- Cerebras Account: Sign up at Cerebras Cloud
- API Key: Generate an API key from your account dashboard
- Model Selection: Choose from available Cerebras models with ultra-fast inference
Required Environment Variables
CEREBRAS_API_KEY: Your Cerebras API key for authentication
Configuration
Cerebras API key for authentication.
Base URL for Cerebras API endpoint.
Model identifier to use.Deprecated in v0.0.105. Use
settings=CerebrasLLMService.Settings(model=...) instead.Runtime-configurable settings. See Settings below.
Settings
Runtime-configurable settings passed via thesettings constructor argument using CerebrasLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details.
This service uses the same settings as OpenAILLMService. See OpenAI LLM Settings for the full parameter reference.
Usage
Basic Setup
With Custom Settings
Notes
- Cerebras supports a subset of OpenAI parameters. Advanced parameters like
frequency_penaltyandpresence_penaltyare not passed to the API. - Cerebras is known for ultra-fast inference speeds on supported models.