import type { ModelsDevProvider } from './types.js'

export const LLM_CATALOG_SNAPSHOT: Record<string, ModelsDevProvider> = {
  openai: {
    id: 'openai',
    name: 'OpenAI',
    npm: '@ai-sdk/openai',
    api: 'https://api.openai.com/v1',
    env: ['OPENAI_API_KEY'],
    doc: 'https://ai-sdk.dev/providers/ai-sdk-providers/openai',
    models: {
      'gpt-4o-mini': { id: 'gpt-4o-mini', name: 'GPT-4o Mini', tool_call: true, reasoning: false, limit: { context: 128000, output: 16384 } },
      'gpt-4o': { id: 'gpt-4o', name: 'GPT-4o', tool_call: true, reasoning: false, limit: { context: 128000, output: 16384 } },
      'gpt-4.1': { id: 'gpt-4.1', name: 'GPT-4.1', tool_call: true, reasoning: false, limit: { context: 1047576, output: 32768 } },
    },
  },
  anthropic: {
    id: 'anthropic',
    name: 'Anthropic',
    npm: '@ai-sdk/anthropic',
    api: 'https://api.anthropic.com/v1',
    env: ['ANTHROPIC_API_KEY'],
    doc: 'https://ai-sdk.dev/providers/ai-sdk-providers/anthropic',
    models: {
      'claude-3-5-sonnet-latest': { id: 'claude-3-5-sonnet-latest', name: 'Claude 3.5 Sonnet', tool_call: true, reasoning: false, limit: { context: 200000, output: 8192 } },
      'claude-3-5-haiku-latest': { id: 'claude-3-5-haiku-latest', name: 'Claude 3.5 Haiku', tool_call: true, reasoning: false, limit: { context: 200000, output: 8192 } },
      'claude-sonnet-4': { id: 'claude-sonnet-4', name: 'Claude Sonnet 4', tool_call: true, reasoning: true, limit: { context: 983040, output: 64000 } },
    },
  },
  openrouter: {
    id: 'openrouter',
    name: 'OpenRouter',
    npm: '@openrouter/ai-sdk-provider',
    api: 'https://openrouter.ai/api/v1',
    env: ['OPENROUTER_API_KEY'],
    doc: 'https://openrouter.ai/models',
    models: {
      'openai/gpt-4o-mini': { id: 'openai/gpt-4o-mini', name: 'OpenAI / GPT-4o Mini', tool_call: true, reasoning: false },
      'anthropic/claude-3.5-sonnet': { id: 'anthropic/claude-3.5-sonnet', name: 'Anthropic / Claude 3.5 Sonnet', tool_call: true, reasoning: false },
      'deepseek/deepseek-chat': { id: 'deepseek/deepseek-chat', name: 'DeepSeek / DeepSeek Chat', tool_call: true, reasoning: false },
    },
  },
  google: {
    id: 'google',
    name: 'Google',
    npm: '@ai-sdk/google',
    env: ['GOOGLE_GENERATIVE_AI_API_KEY', 'GEMINI_API_KEY'],
    doc: 'https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai',
    models: {
      'gemini-2.0-flash': { id: 'gemini-2.0-flash', name: 'Gemini 2.0 Flash', tool_call: true, reasoning: false, limit: { context: 990000, output: 8192 } },
      'gemini-2.5-flash': { id: 'gemini-2.5-flash', name: 'Gemini 2.5 Flash', tool_call: true, reasoning: true, limit: { context: 1065535, output: 65535 } },
      'gemini-2.5-pro': { id: 'gemini-2.5-pro', name: 'Gemini 2.5 Pro', tool_call: true, reasoning: true, limit: { context: 1065535, output: 65535 } },
    },
  },
  deepseek: {
    id: 'deepseek',
    name: 'DeepSeek',
    npm: '@ai-sdk/openai-compatible',
    api: 'https://api.deepseek.com',
    env: ['DEEPSEEK_API_KEY'],
    doc: 'https://api-docs.deepseek.com/',
    models: {
      'deepseek-chat': { id: 'deepseek-chat', name: 'DeepSeek Chat', tool_call: true, reasoning: false, limit: { context: 128000, output: 8192 } },
      'deepseek-reasoner': { id: 'deepseek-reasoner', name: 'DeepSeek Reasoner', tool_call: true, reasoning: true, limit: { context: 128000, output: 8192 } },
    },
  },
  groq: {
    id: 'groq',
    name: 'Groq',
    npm: '@ai-sdk/groq',
    api: 'https://api.groq.com/openai/v1',
    env: ['GROQ_API_KEY'],
    doc: 'https://console.groq.com/docs/models',
    models: {
      'llama-3.1-8b-instant': { id: 'llama-3.1-8b-instant', name: 'Llama 3.1 8B Instant', tool_call: true, reasoning: false, limit: { context: 131072, output: 8192 } },
      'llama-3.3-70b-versatile': { id: 'llama-3.3-70b-versatile', name: 'Llama 3.3 70B Versatile', tool_call: true, reasoning: false, limit: { context: 131072, output: 32768 } },
    },
  },
  mistral: {
    id: 'mistral',
    name: 'Mistral',
    npm: '@ai-sdk/mistral',
    api: 'https://api.mistral.ai/v1',
    env: ['MISTRAL_API_KEY'],
    doc: 'https://docs.mistral.ai/',
    models: {
      'ministral-8b-latest': { id: 'ministral-8b-latest', name: 'Ministral 8B', tool_call: true, reasoning: false },
      'mistral-large-latest': { id: 'mistral-large-latest', name: 'Mistral Large', tool_call: true, reasoning: false, limit: { context: 128000, output: 131072 } },
    },
  },
  cohere: {
    id: 'cohere',
    name: 'Cohere',
    npm: '@ai-sdk/cohere',
    api: 'https://api.cohere.com/v2',
    env: ['COHERE_API_KEY'],
    doc: 'https://docs.cohere.com/',
    models: {
      'command-r': { id: 'command-r', name: 'Command R', tool_call: true, reasoning: false, limit: { context: 128000, output: 4096 } },
      'command-r-plus': { id: 'command-r-plus', name: 'Command R+', tool_call: true, reasoning: false, limit: { context: 128000, output: 4096 } },
    },
  },
  deepinfra: {
    id: 'deepinfra',
    name: 'DeepInfra',
    npm: '@ai-sdk/deepinfra',
    api: 'https://api.deepinfra.com/v1/openai',
    env: ['DEEPINFRA_API_KEY'],
    doc: 'https://deepinfra.com/docs',
    models: {
      'meta-llama/Meta-Llama-3.1-70B-Instruct': { id: 'meta-llama/Meta-Llama-3.1-70B-Instruct', name: 'Meta Llama 3.1 70B Instruct', tool_call: true, reasoning: false },
      'Qwen/Qwen2.5-Coder-32B-Instruct': { id: 'Qwen/Qwen2.5-Coder-32B-Instruct', name: 'Qwen 2.5 Coder 32B Instruct', tool_call: true, reasoning: false },
    },
  },
  xai: {
    id: 'xai',
    name: 'xAI',
    npm: '@ai-sdk/xai',
    api: 'https://api.x.ai/v1',
    env: ['XAI_API_KEY'],
    doc: 'https://docs.x.ai/',
    models: {
      'grok-2-1212': { id: 'grok-2-1212', name: 'Grok 2', tool_call: true, reasoning: false },
      'grok-beta': { id: 'grok-beta', name: 'Grok Beta', tool_call: true, reasoning: false },
    },
  },
  togetherai: {
    id: 'togetherai',
    name: 'Together AI',
    npm: '@ai-sdk/togetherai',
    api: 'https://api.together.xyz/v1',
    env: ['TOGETHER_API_KEY'],
    doc: 'https://docs.together.ai/',
    models: {
      'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo': { id: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo', name: 'Llama 3.1 70B Instruct Turbo', tool_call: true, reasoning: false },
      'Qwen/Qwen2.5-Coder-32B-Instruct': { id: 'Qwen/Qwen2.5-Coder-32B-Instruct', name: 'Qwen 2.5 Coder 32B Instruct', tool_call: true, reasoning: false },
    },
  },
  cerebras: {
    id: 'cerebras',
    name: 'Cerebras',
    npm: '@ai-sdk/cerebras',
    api: 'https://api.cerebras.ai/v1',
    env: ['CEREBRAS_API_KEY'],
    doc: 'https://inference-docs.cerebras.ai/',
    models: {
      'llama3.1-8b': { id: 'llama3.1-8b', name: 'Llama 3.1 8B', tool_call: true, reasoning: false, limit: { context: 8192, output: 8192 } },
      'llama3.3-70b': { id: 'llama3.3-70b', name: 'Llama 3.3 70B', tool_call: true, reasoning: false, limit: { context: 32768, output: 8192 } },
    },
  },
  perplexity: {
    id: 'perplexity',
    name: 'Perplexity',
    npm: '@ai-sdk/perplexity',
    api: 'https://api.perplexity.ai',
    env: ['PERPLEXITY_API_KEY'],
    doc: 'https://docs.perplexity.ai/',
    models: {
      'sonar-small-chat': { id: 'sonar-small-chat', name: 'Sonar Small Chat', tool_call: true, reasoning: false },
      'sonar-pro': { id: 'sonar-pro', name: 'Sonar Pro', tool_call: true, reasoning: false },
    },
  },
}
