<?php

use Cognesy\Config\Env;

return [
    'defaultPreset' => 'openai',

    'presets' => [
        'a21' => [
            'driver' => 'a21',
            'apiUrl' => 'https://api.ai21.com/studio/v1',
            'apiKey' => Env::get('A21_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'jamba-mini',
            'maxTokens' => 1024,
            'contextLength' => 256_000,
            'maxOutputLength' => 4096,
        ],
        'anthropic' => [
            'driver' => 'anthropic',
            'apiUrl' => 'https://api.anthropic.com/v1',
            'apiKey' => Env::get('ANTHROPIC_API_KEY', ''),
            'endpoint' => '/messages',
            'metadata' => [
                'apiVersion' => '2023-06-01',
                'beta' => 'prompt-caching-2024-07-31',
            ],
            'model' => 'claude-3-haiku-20240307',
            'maxTokens' => 1024,
            'contextLength' => 200_000,
            'maxOutputLength' => 8192,
        ],
        'azure' => [
            'driver' => 'azure',
            'apiUrl' => 'https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}',
            'apiKey' => Env::get('AZURE_OPENAI_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'metadata' => [
                'apiVersion' => '2024-08-01-preview',
                'resourceName' => 'instructor-dev',
                'deploymentId' => 'gpt-4o-mini',
            ],
            'model' => 'gpt-4o-mini',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 16384,
        ],
        'cerebras' => [
            'driver' => 'cerebras',
            'apiUrl' => 'https://api.cerebras.ai/v1',
            'apiKey' => Env::get('CEREBRAS_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'llama3.1-8b',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 2048,
        ],
        'cohere' => [
            'driver' => 'cohere',
            'apiUrl' => 'https://api.cohere.ai/v2',
            'apiKey' => Env::get('COHERE_API_KEY', ''),
            'endpoint' => '/chat',
            'model' => 'command-r-plus-08-2024',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 4096,
        ],
        'deepseek' => [
            'driver' => 'deepseek',
            'apiUrl' => 'https://api.deepseek.com',
            'apiKey' => Env::get('DEEPSEEK_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'deepseek-chat',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 8192,
        ],
        'deepseek-r' => [
            'driver' => 'deepseek',
            'apiUrl' => 'https://api.deepseek.com',
            'apiKey' => Env::get('DEEPSEEK_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'deepseek-reasoner',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 8192,
        ],
        'fireworks' => [
            'driver' => 'fireworks',
            'apiUrl' => 'https://api.fireworks.ai/inference/v1',
            'apiKey' => Env::get('FIREWORKS_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'accounts/fireworks/models/llama4-maverick-instruct-basic',
            'maxTokens' => 1024,
            'contextLength' => 65_000,
            'maxOutputLength' => 4096,
        ],
        'gemini' => [
            'driver' => 'gemini',
            'apiUrl' => 'https://generativelanguage.googleapis.com/v1beta',
            'apiKey' => Env::get('GEMINI_API_KEY', ''),
            'endpoint' => '/models/{model}:generateContent',
            'model' => 'gemini-2.5-flash-lite',
            'maxTokens' => 1024,
            'contextLength' => 1_000_000,
            'maxOutputLength' => 8192,
        ],
        'gemini-oai' => [
            'driver' => 'gemini-oai',
            'apiUrl' => 'https://generativelanguage.googleapis.com/v1beta/openai',
            'apiKey' => Env::get('GEMINI_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'gemini-2.5-flash-lite',
            'maxTokens' => 1024,
            'contextLength' => 1_000_000,
            'maxOutputLength' => 8192,
        ],
        'groq' => [
            'driver' => 'groq',
            'apiUrl' => 'https://api.groq.com/openai/v1',
            'apiKey' => Env::get('GROQ_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'meta-llama/llama-4-scout-17b-16e-instruct', //'llama-3.3-70b-versatile', // 'gemma2-9b-it',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 2048,
        ],
        'huggingface' => [
            'driver' => 'huggingface',
            'apiUrl' => 'https://router.huggingface.co/v1',
            'apiKey' => Env::get('HUGGINGFACE_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'openai/gpt-oss-20b:fireworks-ai',
            'maxTokens' => 1024,
            'contextLength' => 32_000,
            'maxOutputLength' => 4096,
        ],
        'meta' => [
            'driver' => 'meta',
            'apiUrl' => 'https://openrouter.ai/api/v1',
            'apiKey' => Env::get('OPENROUTER_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'meta-llama/llama-3.3-8b-instruct:free',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 8192,
        ],
        'minimaxi' => [
            'driver' => 'minimaxi',
            'apiUrl' => 'https://api.minimaxi.chat/v1',
            'apiKey' => Env::get('MINIMAXI_API_KEY', ''),
            'endpoint' => '/text/chatcompletion_v2',
            'model' => 'MiniMax-Text-01', // 'MiniMax-Text-01',
            'maxTokens' => 1024,
            'contextLength' => 1_000_000,
            'maxOutputLength' => 4096,
        ],
        'minimaxi-oai' => [
            'driver' => 'minimaxi',
            'apiUrl' => 'https://api.minimaxi.chat/v1',
            'apiKey' => Env::get('MINIMAXI_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'MiniMax-Text-01', // 'MiniMax-Text-01',
            'maxTokens' => 1024,
            'contextLength' => 1_000_000,
            'maxOutputLength' => 4096,
        ],
        'mistral' => [
            'driver' => 'mistral',
            'apiUrl' => 'https://api.mistral.ai/v1',
            'apiKey' => Env::get('MISTRAL_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'mistral-small-latest',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 4096,
        ],
        'moonshot-kimi' => [
            'driver' => 'moonshot',
            'apiUrl' => 'https://api.moonshot.cn/v1',
            'apiKey' => Env::get('MOONSHOT_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'kimi-latest',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 4096,
        ],
        'ollama' => [
            'driver' => 'ollama',
            'apiUrl' => 'http://localhost:11434/v1',
            'apiKey' => Env::get('OLLAMA_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'phi4', //'gemma3:1b', // 'qwen2.5-coder:3b', //'gemma2:2b',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 8192,
        ],
        'openai' => [
            'driver' => 'openai',
            'apiUrl' => 'https://api.openai.com/v1',
            'apiKey' => Env::get('OPENAI_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'metadata' => [
                'organization' => '',
                'project' => '',
            ],
            'model' => 'gpt-4o',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 16384,
        ],
        'openrouter' => [
            'driver' => 'openrouter',
            'apiUrl' => 'https://openrouter.ai/api/v1',
            'apiKey' => Env::get('OPENROUTER_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'google/gemini-2.0-flash-001', // 'qwen/qwen3-0.6b-04-28:free',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 8192,
        ],
        'perplexity' => [
            'driver' => 'perplexity',
            'apiUrl' => 'https://api.perplexity.ai',
            'apiKey' => Env::get('PERPLEXITY_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'sonar',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 2048,
        ],
        'sambanova' => [
            'driver' => 'sambanova',
            'apiUrl' => 'https://api.sambanova.ai/v1',
            'apiKey' => Env::get('SAMBANOVA_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'Meta-Llama-3.1-8B-Instruct',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 2048,
        ],
        'together' => [
            'driver' => 'together',
            'apiUrl' => 'https://api.together.xyz/v1',
            'apiKey' => Env::get('TOGETHER_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 4096,
        ],
        'xai' => [
            'driver' => 'xai',
            'apiUrl' => 'https://api.x.ai/v1',
            'apiKey' => Env::get('XAI_API_KEY', ''),
            'endpoint' => '/chat/completions',
            'model' => 'grok-3',
            'maxTokens' => 1024,
            'contextLength' => 128_000,
            'maxOutputLength' => 128_000,
        ],
    ],
];
