Skip to main content

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

The CerebrasOpenAI class provides an OpenAI-style interface for Cerebras models: First, install openai:

Configuration Options

The CerebrasOpenAI class accepts the following parameters: CerebrasOpenAI also supports the parameters of OpenAI.

Examples

  • View more examples here.