AI Models Reference & Configuration

Comprehensive guide to AI model versions, changes, and configuration across the monorepo

AI Models Reference & Configuration

🎯 Purpose

This document serves as:

  1. Model Version Tracker - Current and historical AI model versions
  2. Change Log - Track when models change/deprecate
  3. Configuration Guide - How to update models across the monorepo
  4. Troubleshooting - Common model-related issues and solutions

🚨 Critical: Model Deprecations (October 2025)

⚠️ BREAKING CHANGE: Claude 3.5 Sonnet Models Retired

Effective Date: October 28, 2025

Deprecated Models (No longer available):

Migration Path:

If you're still using deprecated models, you'll see:

Status: 404
Error: {"type":"not_found_error","message":"model: claude-3-5-sonnet-20241022"}

🚨 Recent Issues & Solutions

Issue: November 20, 2025 - Model Version Compatibility

Problem: Multiple model versions returned 404 errors

Status: 404
Error: {"type":"not_found_error","message":"model: claude-3-5-sonnet-latest"}
Error: {"type":"not_found_error","message":"model: claude-3-5-sonnet-20241022"}
Error: {"type":"not_found_error","message":"model: claude-3-5-sonnet-20240620"}

Root Cause: Claude 3.5 Sonnet models were DEPRECATED on October 28, 2025

Solution: Use claude-3-opus-20240229 (legacy but widely available and stable)

Files Updated:

Verification: Successfully translated "Poop-1" → "Caca 1" using Claude 3 Opus

Lesson Learned:

  1. Claude 3.5 models are DEPRECATED - Use Claude 4.5 or Claude 3 instead
  2. Never use -latest aliases - They point to unpredictable models
  3. Use dated versions - Explicit control and compatibility
  4. Test with legacy models first - e.g., claude-3-opus-20240229 works everywhere
  5. Check deprecation notices - Anthropic retired Claude 3.5 with minimal notice

📚 Current Model Versions (Updated November 20, 2025)

Anthropic (Claude)

Model Availability by API Tier

🔴 Critical Information: Not all Claude models are available for all API keys. Availability depends on:

Production Models (Verified November 2025)

Model Name Status API Tier Use Case Notes
claude-3-opus-20240229 ✅ VERIFIED WORKING All Tiers Production translation, complex reasoning Our default - Most reliable, widely available
claude-3-sonnet-20240229 ✅ Stable All Tiers Balanced tasks Reliable for all accounts
claude-3-haiku-20240307 ✅ Stable All Tiers Fast, simple tasks Lowest cost, fastest
claude-3-5-sonnet-20241022 ⚠️ Tier-Restricted Scale+ Latest improvements Requires higher tier
claude-3-5-sonnet-20240620 ⚠️ Tier-Restricted Build+ General use Requires Build tier or higher
claude-3-5-haiku-20241022 ⚠️ Tier-Restricted Build+ Fast tasks May not work for free tier
claude-sonnet-4-20250514 ⚠️ Tier-Restricted Scale+ Thinking model Requires Scale tier
claude-opus-4-20250514 ⚠️ Tier-Restricted Scale+ Advanced thinking Highest tier only
claude-3-7-sonnet-20250219 ⚠️ Experimental Beta Access First thinking model Beta access required
claude-3-5-sonnet-latest ❌ Alias N/A N/A Avoid - Points to tier-restricted model

Model Naming Convention

claude-{version}-{variant}-{YYYYMMDD}

Examples:
✅ claude-3-opus-20240229        (stable, works for all tiers)
✅ claude-3-sonnet-20240229      (stable, works for all tiers)
✅ claude-3-haiku-20240307       (stable, works for all tiers)
⚠️ claude-3-5-sonnet-20241022    (requires higher API tier)
⚠️ claude-3-5-sonnet-20240620    (requires Build tier+)
❌ claude-3-5-sonnet-latest      (avoid - points to restricted model)

Best Practices:

  1. Use dated versions (not -latest) for production
  2. Test model availability with your specific API key before deploying
  3. Start with Claude 3 models (20240229/20240307) - they work everywhere
  4. Upgrade models gradually after verifying access

API Tier Comparison

Tier Monthly Cost Claude 3 Access Claude 3.5 Access Claude 4 Access Best For
Free $0 ✅ Full ❌ Limited/None ❌ No Testing, personal projects
Build $5 ✅ Full ✅ Partial ❌ No Small teams, startups
Scale Volume-based ✅ Full ✅ Full ✅ Yes Production, enterprises

Note: This information is based on November 2025 testing. Always verify with Anthropic's pricing page for current details.


OpenAI (GPT)

Production Models (Updated November 20, 2025)

Model Name Status Release Date Context Cost (per 1M tokens) Notes
gpt-5.1 ✅ LATEST Nov 12, 2025 128K $5.00 / $20.00 Eight personalities, reduced hallucinations
gpt-5 ✅ Current Aug 7, 2025 128K $5.00 / $20.00 Multimodal reasoning model
gpt-4o ✅ Stable May 2024 128K $2.50 / $10.00 Vision, function calling, multimodal
gpt-4o-mini ✅ Efficient 2024 128K $0.15 / $0.60 Fast and cost-effective

Deprecated Models (No longer available):

Notes:

Model Naming Convention

gpt-{version}-{variant}

Examples:
✅ gpt-4-turbo-preview
✅ gpt-4
✅ gpt-3.5-turbo

Google (Gemini)

Production Models (Updated November 20, 2025)

Model Name Status Release Date Context Cost (per 1M tokens) Notes
gemini-3 ✅ LATEST Nov 18, 2025 2M $2.00 / $4.00 Enhanced coding, Gemini Agent
gemini-2.5-pro ✅ Current March 2025 2M $1.25 / $5.00 Pre-Gemini 3, proven stable
gemini-1.5-pro ✅ Legacy 2024 2M $1.25 / $5.00 Massive context, older gen
gemini-1.5-flash ✅ Cost-Effective 2024 1M $0.075 / $0.30 Fast and cheap
gemini-1.5-flash-8b ✅ Ultra-Fast 2024 1M $0.0375 / $0.15 Cheapest option

Deprecated/Removed Models:

Notes:

Model Naming Convention

gemini-{variant}

Examples:
✅ gemini-pro
✅ gemini-pro-vision

🎯 Model Selection Guide

Decision Tree: Which Model Should I Use?

START
│
├─ Need vision/image analysis?
│  ├─ YES → Use: gpt-4o, gemini-1.5-pro, gemini-2.0-flash-exp
│  └─ NO → Continue
│
├─ Need massive context (>200K tokens)?
│  ├─ YES → Use: gemini-1.5-pro (2M), gemini-1.5-flash (1M)
│  └─ NO → Continue
│
├─ Need deep reasoning/thinking?
│  ├─ YES → Use: claude-opus-4-20250514 (if tier allows), o1-preview
│  └─ NO → Continue
│
├─ Budget priority?
│  ├─ HIGH (need cheapest) → Use: gemini-1.5-flash-8b, gpt-4o-mini, claude-3-haiku
│  ├─ MEDIUM (balance) → Use: claude-3-opus-20240229, gpt-4o, gemini-1.5-flash
│  └─ LOW (quality first) → Use: claude-opus-4, gpt-4o, claude-3-5-sonnet
│
├─ Speed priority?
│  ├─ CRITICAL → Use: gpt-4o-mini, gemini-1.5-flash-8b, claude-3-haiku
│  ├─ IMPORTANT → Use: gemini-1.5-flash, gpt-4o-mini
│  └─ NOT CRITICAL → Any model
│
└─ Task type?
   ├─ Translation → claude-3-opus-20240229 ✅ (verified working)
   ├─ Code generation → gpt-4o, claude-3-5-sonnet, gemini-2.0-flash
   ├─ Long documents → gemini-1.5-pro, claude-3-opus
   ├─ Chat/conversation → gpt-4o, claude-3-5-sonnet
   └─ Data analysis → gemini-1.5-pro, gpt-4o, claude-3-opus

Model Performance Comparison

Use Case Best Choice Alternative Budget Option Notes
Translation claude-3-opus-20240229 gpt-4o gemini-1.5-flash Opus verified working
Code Generation gpt-4o claude-3-5-sonnet gpt-4o-mini GPT-4o excels at code
Long Documents gemini-1.5-pro claude-3-opus gemini-1.5-flash Gemini's huge context
Complex Reasoning claude-opus-4 o1-preview claude-3-opus Thinking models best
Fast Responses gemini-1.5-flash-8b gpt-4o-mini claude-3-haiku Milliseconds matter
Multimodal gpt-4o gemini-2.0-flash gemini-1.5-flash Vision + text
Cost-Effective gemini-1.5-flash-8b gpt-4o-mini claude-3-haiku Pennies per 1M tokens
Production (Reliable) claude-3-opus-20240229 gpt-4o gemini-1.5-flash Battle-tested

Cost Comparison (per 1M tokens)

Model Input Cost Output Cost Total (1M in + 1M out) Relative Cost
gemini-1.5-flash-8b $0.04 $0.15 $0.19 💰 Cheapest
gemini-1.5-flash $0.08 $0.30 $0.38 💰💰 Very Cheap
gpt-4o-mini $0.15 $0.60 $0.75 💰💰 Cheap
claude-3-haiku $0.25 $1.25 $1.50 💰💰 Affordable
gemini-2.0-flash-exp $1.00 $2.00 $3.00 💰💰💰 Budget
gpt-4o $2.50 $10.00 $12.50 💰💰💰 Moderate
claude-3-opus-20240229 $15.00 $75.00 $90.00 💰💰💰💰 Premium
claude-opus-4 $15.00 $75.00 $90.00 💰💰💰💰 Premium

Real-World Example (1,000 translations, 100 tokens each):

Speed Comparison (Typical Response Times)

Model Simple Query Complex Query Long Document Stream Latency
gemini-1.5-flash-8b <100ms 200-500ms 500ms-1s Ultra-low
gpt-4o-mini 100-200ms 300-700ms 700ms-1.5s Very low
claude-3-haiku 150-300ms 400-800ms 800ms-2s Low
gemini-1.5-flash 200-400ms 500ms-1s 1-2s Low
gpt-4o 300-600ms 800ms-2s 2-4s Medium
claude-3-opus 500ms-1s 1-3s 3-6s Medium
claude-opus-4 (thinking) 1-3s 5-15s 15-30s High (thinking)

🔧 Centralized Model Configuration

Configuration File Location

Primary: apis/backend-api/src/app/ai/ai-models.config.ts

// apis/backend-api/src/app/ai/ai-models.config.ts
export const AI_MODELS_CONFIG = {
  anthropic: {
    default: 'claude-3-5-sonnet-latest',
    translation: 'claude-3-5-sonnet-latest',
    reasoning: 'claude-3-opus-latest',
    fast: 'claude-3-haiku-latest',
  },
  openai: {
    default: 'gpt-4-turbo-preview',
    fast: 'gpt-3.5-turbo',
  },
  google: {
    default: 'gemini-pro',
    vision: 'gemini-pro-vision',
  },
} as const;

export type AnthropicModel = typeof AI_MODELS_CONFIG.anthropic[keyof typeof AI_MODELS_CONFIG.anthropic];
export type OpenAIModel = typeof AI_MODELS_CONFIG.openai[keyof typeof AI_MODELS_CONFIG.openai];
export type GoogleModel = typeof AI_MODELS_CONFIG.google[keyof typeof AI_MODELS_CONFIG.google];

Usage Across Monorepo

// In any service
import { AI_MODELS_CONFIG } from './ai-models.config';

const model = AI_MODELS_CONFIG.anthropic.translation; // 'claude-3-5-sonnet-latest'

📍 Where Models Are Used

Backend API

File: apis/backend-api/src/app/ai/ai.service.ts

// Line ~93
const model = request.model || 'claude-3-5-sonnet-latest';

Usage:


Translation Scripts

File: tools/scripts/translation/fully-automated-translator.js

// Line ~287
model: 'claude-3-5-sonnet-latest',

Usage:


Future: Centralized Config (Recommended)

Create libs/libs-ai/ai-config/src/lib/models.config.ts:

export const AI_MODELS = {
  translation: {
    provider: 'anthropic',
    model: 'claude-3-5-sonnet-latest',
  },
  codeGeneration: {
    provider: 'openai',
    model: 'gpt-4-turbo-preview',
  },
  imageAnalysis: {
    provider: 'google',
    model: 'gemini-pro-vision',
  },
} as const;

🔍 How to Update Models Globally

Step 1: Check Current Usage

# Find all model references
grep -r "claude-3" apps/ tools/ libs/
grep -r "gpt-" apps/ tools/ libs/
grep -r "gemini" apps/ tools/ libs/

Step 2: Update Configuration

If using centralized config:

// Update one place
AI_MODELS_CONFIG.anthropic.translation = 'claude-3-5-sonnet-latest';

If NOT centralized (current state):

  1. Update apis/backend-api/src/app/ai/ai.service.ts
  2. Update tools/scripts/translation/fully-automated-translator.js
  3. Search for other usages

Step 3: Test Changes

# Restart backend
yarn serve:backend

# Test translation
yarn translate:fix

# Test AI endpoint
curl -H "Authorization: Bearer $SYSTEM_TOKEN" \  # Set from .env.local
  -H "Content-Type: application/json" \
  -X POST http://localhost:3000/api/ai/anthropic/messages \
  -d '{"messages":[{"role":"user","content":"test"}],"model":"claude-3-5-sonnet-latest","maxTokens":5}'

🐛 Troubleshooting Model Issues

Error: "model: {model-name}" (404)

Symptoms:

Status: 404
Error: {"type":"not_found_error","message":"model: claude-3-5-sonnet-20241022"}

Diagnosis:

  1. Most Common: Your API key tier doesn't have access to this model
  2. Model version doesn't exist for any tier
  3. Model name is misspelled
  4. Provider deprecated the model
  5. Regional restrictions

Solution:

Step 1: Verify API Tier Access

# Test with a known-working model first
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: YOUR_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-3-opus-20240229","messages":[{"role":"user","content":"test"}],"max_tokens":10}'

# If this works, your key is valid but may have tier restrictions

Step 2: Try Alternative Models (in order of availability):

  1. claude-3-opus-20240229 (works for all tiers) ✅
  2. claude-3-sonnet-20240229 (works for all tiers) ✅
  3. claude-3-haiku-20240307 (works for all tiers) ✅
  4. claude-3-5-sonnet-20240620 (requires Build tier+) ⚠️
  5. claude-3-5-sonnet-20241022 (requires Scale tier+) ⚠️

Step 3: Update Configuration

// apis/backend-api/src/app/ai/ai-models.config.ts
anthropic: {
  default: 'claude-3-opus-20240229', // Safe default
  translation: 'claude-3-opus-20240229', // Verified working
}

Step 4: Check Account Tier


Error: "invalid x-api-key" (401)

Symptoms:

Status: 401  
Error: {"type":"authentication_error","message":"invalid x-api-key"}

Diagnosis:

  1. API key is wrong/expired
  2. API key has extra whitespace
  3. API key not set in .env.local

Solution:

  1. Check .env.local has correct key
  2. Ensure no quotes or spaces
  3. Create fresh key if needed

Error: Rate Limit (429)

Symptoms:

Status: 429
Error: {"type":"rate_limit_error"}

Solution:

  1. Add retry logic with exponential backoff
  2. Reduce request frequency
  3. Upgrade API tier

📖 Provider Documentation Links

Anthropic

OpenAI

Google AI


🔄 Model Version History

2025-11-20: Model Compatibility Resolution ✅

Changes:

Current Working Models:

What Worked:

  1. Used dated version instead of -latest
  2. Rebuilt backend after config change (nx build backend-api)
  3. Removed model parameter from translation script
  4. Let backend use centralized default

Performance:


✅ Best Practices

1. Always Use Dated Versions (Not "latest")

// ❌ BAD - Points to tier-restricted model
model: 'claude-3-5-sonnet-latest'

// ✅ GOOD - Explicit, verifiable, works everywhere
model: 'claude-3-opus-20240229'

// ⚠️ RISKY - May require higher tier
model: 'claude-3-5-sonnet-20241022'

Why Avoid -latest?

Why Use Dated Versions?

2. Centralize Configuration

// ✅ Good - one place to update
import { AI_MODELS_CONFIG } from './config';
const model = AI_MODELS_CONFIG.anthropic.translation;

// ❌ Bad - scattered hardcoded values
const model = 'claude-3-5-sonnet-latest'; // duplicated everywhere

3. Add Error Handling

// ✅ Good - catches model issues
try {
  const response = await callAI(model);
} catch (error) {
  if (error.status === 404) {
    logger.error(`Model ${model} not found. Check models-information.md`);
  }
}

4. Log Model Usage

// ✅ Good - helps debugging
logger.log(`Using model: ${model} (provider: ${provider})`);

🚀 Roadmap

Phase 1: Current State (✅ Complete)

Phase 2: Centralized Config (📋 Planned)

Phase 3: Dynamic Model Selection (📋 Planned)

Phase 4: Monitoring (📋 Planned)


📝 Change Log Template

When updating models, add entry here:

### YYYY-MM-DD: Brief Description

**Changes**:
- What changed
- Why it changed
- Impact

**Models Updated**:
- Provider: old-model → new-model

**Files Modified**:
- path/to/file1.ts
- path/to/file2.js

**Testing**:
- How was it tested
- Results

🆘 Need Help?

  1. Check Provider Docs: Links above
  2. Check This Doc: Model versions and common issues
  3. Check Backend Logs: Detailed error information
  4. Create Issue: Document new issues here

Last Updated: November 20, 2025 - 1:25 PM
Session ID: 11.25.1.1
Maintainer: AI Agents / Development Team