Skip to content

BasetenProvider

Namespace: Vercel.AI.Baseten

public sealed class BasetenProvider : OpenAICompatibleProvider

Baseten provider. OpenAI Chat Completions compatible at https://inference.baseten.co/v1.

Inheritance: object → ProviderBase → OpenAICompatibleProvider

View source

BasetenProvider(HttpClient, OpenAICompatibleOptions?)

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

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options OpenAICompatibleOptions

View source

public const string ApiKeyVariable = "BASETEN_API_KEY"

Environment variable for the API key.

Value: string

View source

public const string DefaultBaseUrl = "https://inference.baseten.co/v1"

Default API origin.

Value: string

View source

public const string ProviderId = "baseten"

Provider id.

Value: string

View source

Create(OpenAICompatibleOptions?, HttpMessageHandler?)

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

Creates a provider. Pass a handler from tests.

Parameters

Name Type Description
options OpenAICompatibleOptions
handler HttpMessageHandler

Returns: BasetenProvider

View source

public override OpenAICompatibleLanguageModel CreateChatModel(string modelId)

Creates a chat model. Providers override this when support differs by model id.

Parameters

Name Type Description
modelId string

Returns: OpenAICompatibleLanguageModel

View source

public override IEmbeddingModel EmbeddingModel(string modelId)

Returns an embedding model.

Parameters

Name Type Description
modelId string

Returns: IEmbeddingModel

View source

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