Skip to content

CerebrasProvider

Namespace: Vercel.AI.Cerebras

public sealed class CerebrasProvider : OpenAICompatibleProvider

Cerebras provider. OpenAI Chat Completions compatible at https://api.cerebras.ai/v1.

Inheritance: object → ProviderBase → OpenAICompatibleProvider

View source

CerebrasProvider(HttpClient, OpenAICompatibleOptions?)

Section titled “CerebrasProvider(HttpClient, OpenAICompatibleOptions?)”
public CerebrasProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options OpenAICompatibleOptions

View source

public const string ApiKeyVariable = "CEREBRAS_API_KEY"

Environment variable for the API key.

Value: string

View source

public const string DefaultBaseUrl = "https://api.cerebras.ai/v1"

Default API origin.

Value: string

View source

public const string ProviderId = "cerebras"

Provider id.

Value: string

View source

Create(OpenAICompatibleOptions?, HttpMessageHandler?)

Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”
public static CerebrasProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)

Creates a provider. Pass a handler from tests.

Parameters

Name Type Description
options OpenAICompatibleOptions
handler HttpMessageHandler

Returns: CerebrasProvider

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product