OpenAI-Compatible Integration
Cerebras can also be used via an OpenAI-compatible interface, making it easy to integrate with tools and libraries that expect the OpenAI API.Using the OpenAI-Compatible Class
TheCerebrasOpenAI class provides an OpenAI-style interface for Cerebras models:
First, install openai:
Configuration Options
TheCerebrasOpenAI class accepts the following parameters:
CerebrasOpenAI also supports the parameters of OpenAI.
Examples
- View more examples here.