// Built-in LLM provider definitions.
// Generated from providers.json + nearai/bedrock (handled separately in llm.rs)
// Fields: id, name, adapter, base_url, builtin, default_model, api_key_required, can_list_models
// nearai/bedrock use special auth flows — no Configure button (api_key_required=false, can_list_models=false)
const BUILTIN_PROVIDERS = [
  { id: 'nearai',            name: 'NEAR AI',           adapter: 'nearai',                base_url: 'https://cloud-api.near.ai/v1',                                    builtin: true, default_model: 'zai-org/GLM-5-FP8',                                              api_key_required: true,  can_list_models: true  },
  { id: 'openai',            name: 'OpenAI',            adapter: 'open_ai_completions',   base_url: 'https://api.openai.com/v1',                                        builtin: true, default_model: 'gpt-4o-mini',                                                     api_key_required: true,  can_list_models: true  },
  { id: 'anthropic',         name: 'Anthropic',         adapter: 'anthropic',             base_url: 'https://api.anthropic.com',                                        builtin: true, default_model: 'claude-sonnet-4-20250514',                                        api_key_required: true,  can_list_models: true  },
  { id: 'ollama',            name: 'Ollama',            adapter: 'ollama',                base_url: 'http://localhost:11434',                                            builtin: true, default_model: 'llama3',                                                          api_key_required: false, can_list_models: true  },
  { id: 'openai_compatible', name: 'OpenAI Compatible', adapter: 'open_ai_completions',   base_url: '',                                                                 builtin: true, default_model: 'default',                                                         api_key_required: false, can_list_models: false },
  { id: 'gemini',            name: 'Google Gemini',     adapter: 'open_ai_completions',   base_url: 'https://generativelanguage.googleapis.com/v1beta/openai',           builtin: true, default_model: 'gemini-2.5-flash',                                                api_key_required: true,  can_list_models: true  },
  { id: 'groq',              name: 'Groq',              adapter: 'open_ai_completions',   base_url: 'https://api.groq.com/openai/v1',                                   builtin: true, default_model: 'llama-3.3-70b-versatile',                                         api_key_required: true,  can_list_models: true  },
  { id: 'openrouter',        name: 'OpenRouter',        adapter: 'open_ai_completions',   base_url: 'https://openrouter.ai/api/v1',                                     builtin: true, default_model: 'openai/gpt-4o',                                                   api_key_required: true,  can_list_models: false },
  { id: 'deepseek',          name: 'DeepSeek',          adapter: 'open_ai_completions',   base_url: 'https://api.deepseek.com/v1',                                      builtin: true, default_model: 'deepseek-chat',                                                   api_key_required: true,  can_list_models: false },
  { id: 'mistral',           name: 'Mistral',           adapter: 'open_ai_completions',   base_url: 'https://api.mistral.ai/v1',                                        builtin: true, default_model: 'mistral-large-latest',                                            api_key_required: true,  can_list_models: true  },
  { id: 'tinfoil',           name: 'Tinfoil',           adapter: 'open_ai_completions',   base_url: 'https://inference.tinfoil.sh/v1',                                  builtin: true, default_model: 'kimi-k2-5',                                                       api_key_required: true,  can_list_models: false },
  { id: 'nvidia',            name: 'NVIDIA NIM',        adapter: 'open_ai_completions',   base_url: 'https://integrate.api.nvidia.com/v1',                              builtin: true, default_model: 'meta/llama-3.3-70b-instruct',                                    api_key_required: true,  can_list_models: true  },
  { id: 'together',          name: 'Together AI',       adapter: 'open_ai_completions',   base_url: 'https://api.together.xyz/v1',                                      builtin: true, default_model: 'meta-llama/Llama-3-70b-chat-hf',                                 api_key_required: true,  can_list_models: false },
  { id: 'fireworks',         name: 'Fireworks AI',      adapter: 'open_ai_completions',   base_url: 'https://api.fireworks.ai/inference/v1',                            builtin: true, default_model: 'accounts/fireworks/models/llama-v3p1-70b-instruct',               api_key_required: true,  can_list_models: false },
  { id: 'cerebras',          name: 'Cerebras',          adapter: 'open_ai_completions',   base_url: 'https://api.cerebras.ai/v1',                                       builtin: true, default_model: 'llama-3.3-70b',                                                   api_key_required: true,  can_list_models: false },
  { id: 'sambanova',         name: 'SambaNova',         adapter: 'open_ai_completions',   base_url: 'https://api.sambanova.ai/v1',                                      builtin: true, default_model: 'Meta-Llama-3.1-70B-Instruct',                                    api_key_required: true,  can_list_models: false },
  { id: 'zai',               name: 'Z.AI',              adapter: 'open_ai_completions',   base_url: 'https://api.z.ai/api/paas/v4',                                     builtin: true, default_model: 'glm-5',                                                           api_key_required: true,  can_list_models: false },
  { id: 'venice',            name: 'Venice.ai',         adapter: 'open_ai_completions',   base_url: 'https://api.venice.ai/api/v1',                                     builtin: true, default_model: 'llama-3.3-70b',                                                   api_key_required: true,  can_list_models: false },
  { id: 'minimax',           name: 'MiniMax',           adapter: 'open_ai_completions',   base_url: 'https://api.minimax.io/v1',                                        builtin: true, default_model: 'MiniMax-M2.5',                                                    api_key_required: true,  can_list_models: false },
  { id: 'ionet',             name: 'io.net',            adapter: 'open_ai_completions',   base_url: 'https://api.intelligence.io.solutions/api/v1',                     builtin: true, default_model: 'deepseek-coder-v2-instruct',                                      api_key_required: true,  can_list_models: true  },
  { id: 'cloudflare',        name: 'Cloudflare AI',     adapter: 'open_ai_completions',   base_url: '',                                                                 builtin: true, default_model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',                       api_key_required: true,  can_list_models: false },
  { id: 'yandex',            name: 'Yandex AI Studio',  adapter: 'open_ai_completions',   base_url: 'https://ai.api.cloud.yandex.net/v1',                               builtin: true, default_model: 'yandexgpt-lite',                                                  api_key_required: true,  can_list_models: true  },
  { id: 'bedrock',           name: 'AWS Bedrock',       adapter: 'bedrock',               base_url: '',                                                                 builtin: true, default_model: 'anthropic.claude-3-sonnet-20240229-v1:0',                         api_key_required: false, can_list_models: false },
];

const ADAPTER_LABELS = {
  open_ai_completions: 'OpenAI Compatible',
  anthropic: 'Anthropic',
  ollama: 'Ollama',
  bedrock: 'AWS Bedrock',
  nearai: 'NEAR AI',
};
