⚡ You're viewing a live demo of ChimerAI. Data resets daily at midnight UTC.Get the CLI →

AI Models — Integration Guide

Overview

ChimerAI supports multiple AI providers out of the box. The Models page lets you browse all configured models, their capabilities, and switch between them in the chat interface.


Quick Start

npx chimerai add model-providers

This scaffolds:

  • app/api/models/route.ts — returns active models from the database
  • lib/model-providers/ — provider adapters (OpenAI, Anthropic, Google, …)
  • prisma/schema.prismaModelConfig table

Supported Providers

ProviderModels
OpenAIGPT-4o, GPT-4o Mini, GPT-3.5 Turbo
AnthropicClaude 3.5 Sonnet, Claude 3 Haiku
GoogleGemini 1.5 Pro, Gemini 1.5 Flash
MistralMistral Large, Mistral 7B
CustomAny OpenAI-compatible endpoint

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI models
ANTHROPIC_API_KEYAnthropic models
GOOGLE_GENERATIVE_AI_API_KEYGoogle models
MISTRAL_API_KEYMistral models
CUSTOM_AI_BASE_URLCustom / local model base URL
CUSTOM_AI_API_KEYCustom model API key

Database Model

model ModelConfig {
  id           String   @id @default(cuid())
  name         String
  modelId      String   @unique
  providerType String   // "openai" | "anthropic" | "google" | "custom"
  providerName String
  isActive     Boolean  @default(true)
  createdAt    DateTime @default(now())
}

API Endpoint

// GET /api/models
export async function GET() {
  const models = await prisma.modelConfig.findMany({
    where: { isActive: true },
    orderBy: { createdAt: 'asc' },
  });
  return Response.json(models);
}

Using a Model in Chat

import { openai } from '@ai-sdk/openai';
import { anthropic } from '@ai-sdk/anthropic';

function getModel(providerType: string, modelId: string) {
  switch (providerType) {
    case 'anthropic':
      return anthropic(modelId);
    case 'google':
      return google(modelId);
    default:
      return openai(modelId);
  }
}

Further Reading

ChimerAI Docs · Back to Demo