Skip to main content

Overview

Providers are the bridge between core-ai and LLM services like OpenAI, Azure OpenAI, Anthropic, Google GenAI, Vertex AI, and Mistral. Each provider implements a unified interface that abstracts away provider-specific details, allowing you to switch between providers with minimal code changes.

Provider Interface

All providers implement methods to create model instances:
Not all providers support all model types. For example, Anthropic only supports chat models, while OpenAI and Google GenAI support chat, embedding, and image models.

OpenAI

OpenAI is one of the most popular providers, offering chat, embedding, and image generation models.

Creating a Provider

Provider Options

Getting Models

createOpenAI().chatModel() uses the Responses API. openai.chat.chatModel() uses strict Chat Completions. Use @core-ai/openai-compat for third-party compatible endpoints.

Azure OpenAI

Azure OpenAI provides chat models deployed in your Azure resource. Azure v1 uses Responses by default and exposes Chat Completions through azure.chat.chatModel(). Classic mode supports Chat Completions only.

Creating a Provider

Provider Options

Getting Models

Use your Azure OpenAI deployment name as the model id.

Anthropic

Anthropic provides powerful chat models like Claude, with advanced capabilities for extended thinking and reasoning.

Creating a Provider

Provider Options

Getting Models

Anthropic requires a maxTokens value for all requests. The defaultMaxTokens option sets a default value that can be overridden per request.

Anthropic on Vertex AI

Anthropic on Vertex AI provides Claude models hosted on Google Cloud, sharing its request, streaming, and reasoning behavior with the direct Anthropic provider.

Creating a Provider

Provider Options

Getting Models

Without explicit credentials, the provider uses Application Default Credentials (ADC). A provider instance targets a single region — create separate providers for models hosted in different regions.

Google GenAI

Google GenAI provides access to Gemini models for chat, embeddings, and native image generation, plus dedicated Imagen models.

Creating a Provider

Provider Options

Getting Models

Google on Vertex AI

Google on Vertex AI provides Gemini chat, embedding, and native image models plus Imagen through regional Google Cloud endpoints.

Creating a Provider

Provider Options

Getting Models

Without explicit credentials, the provider uses Application Default Credentials (ADC). A provider instance targets a single region.

Mistral

Mistral provides efficient open-source and proprietary models for chat and embeddings.

Creating a Provider

Provider Options

Getting Models

Omnifact

Omnifact provides access to the Omnifact API Gateway — an OpenAI-compatible endpoint for chat completions backed by your organization’s enabled models.

Creating a Provider

Provider Options

Getting Models

Use model IDs enabled for your organization in Omnifact. Pass providerOptions.openai for supported Chat Completions options. Omnifact also accepts the nonstandard reasoning fields documented by @core-ai/openai-compat.

Kimi

Kimi provides access to Moonshot AI models through the Kimi API, including native reasoning_content support for thinking models.

Creating a Provider

Getting Models

Pass providerOptions.kimi for Kimi-specific Chat Completions options. Kimi K2.7 Code always runs in thinking mode; core-ai preserves reasoning_content across turns via resultToMessage().

Using Custom Clients

All providers support bringing your own client instance, which is useful for advanced configuration:

Provider Comparison

Next Steps

  • Learn about Models to understand different model types
  • Explore Messages to see how to structure conversations
  • Configure models with Configuration options