feat(llm): expand LLM provider options and improve model selection UI

- Added new LLM providers including Google, Azure OpenAI, Bedrock, and others to the backend.
- Updated the model selection UI to dynamically display available models based on the selected provider.
- Enhanced the provider change handling to reset the model selection when the provider is changed.
- Improved the overall user experience by providing contextual information for model selection.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-11-13 02:41:30 -08:00
parent c1e8753567
commit 38dffaffa3
10 changed files with 2197 additions and 126 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,127 +3,180 @@ export interface LLMProvider {
label: string;
example: string;
description: string;
apiBase?: string; // Default API Base URL for the provider / 提供商的默认 API Base URL
apiBase?: string;
}
export const LLM_PROVIDERS: LLMProvider[] = [
{
value: "OPENAI",
label: "OpenAI",
example: "gpt-4o, gpt-4, gpt-3.5-turbo",
description: "Industry-leading GPT models with broad capabilities",
example: "gpt-4o, gpt-4o-mini, o1, o3-mini",
description: "Industry-leading GPT models",
},
{
value: "ANTHROPIC",
label: "Anthropic",
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
description: "Claude models with strong reasoning and long context windows",
example: "claude-3-5-sonnet, claude-3-opus, claude-4-sonnet",
description: "Claude models with strong reasoning",
},
{
value: "GROQ",
label: "Groq",
example: "llama3-70b-8192, mixtral-8x7b-32768",
description: "Lightning-fast inference with custom LPU hardware",
},
{
value: "COHERE",
label: "Cohere",
example: "command-r-plus, command-r",
description: "Enterprise NLP models optimized for business applications",
},
{
value: "HUGGINGFACE",
label: "HuggingFace",
example: "microsoft/DialoGPT-medium",
description: "Access thousands of open-source models",
value: "GOOGLE",
label: "Google (Gemini)",
example: "gemini-2.5-flash, gemini-2.5-pro, gemini-1.5-pro",
description: "Gemini models with multimodal capabilities",
},
{
value: "AZURE_OPENAI",
label: "Azure OpenAI",
example: "gpt-4, gpt-35-turbo",
description: "OpenAI models with Microsoft Azure enterprise features",
example: "azure/gpt-4o, azure/gpt-4o-mini",
description: "OpenAI models on Azure",
},
{
value: "GOOGLE",
label: "Google",
example: "gemini-pro, gemini-pro-vision",
description: "Gemini models with multimodal capabilities",
},
{
value: "AWS_BEDROCK",
value: "BEDROCK",
label: "AWS Bedrock",
example: "anthropic.claude-v2",
description: "Fully managed foundation models on AWS infrastructure",
example: "anthropic.claude-3-5-sonnet, meta.llama3-70b",
description: "Foundation models on AWS",
},
{
value: "OLLAMA",
label: "Ollama",
example: "llama2, codellama",
description: "Run open-source models locally on your machine",
value: "VERTEX_AI",
label: "Google Vertex AI",
example: "vertex_ai/claude-3-5-sonnet, vertex_ai/gemini-2.5-pro",
description: "Models on Google Cloud Vertex AI",
},
{
value: "GROQ",
label: "Groq",
example: "groq/llama-3.3-70b-versatile, groq/mixtral-8x7b",
description: "Ultra-fast inference",
},
{
value: "COHERE",
label: "Cohere",
example: "command-a-03-2025, command-r-plus",
description: "Enterprise NLP models",
},
{
value: "MISTRAL",
label: "Mistral",
example: "mistral-large-latest, mistral-medium",
description: "High-performance open-source models from Europe",
label: "Mistral AI",
example: "mistral-large-latest, mistral-medium-latest",
description: "European open-source models",
},
{
value: "TOGETHER_AI",
label: "Together AI",
example: "togethercomputer/llama-2-70b-chat",
description: "Scalable cloud platform for open-source models",
value: "DEEPSEEK",
label: "DeepSeek",
example: "deepseek-chat, deepseek-reasoner",
description: "High-performance reasoning models",
apiBase: "https://api.deepseek.com",
},
{
value: "REPLICATE",
label: "Replicate",
example: "meta/llama-2-70b-chat",
description: "Cloud API for running machine learning models",
value: "XAI",
label: "xAI (Grok)",
example: "grok-4, grok-3, grok-3-mini",
description: "Grok models from xAI",
},
{
value: "OPENROUTER",
label: "OpenRouter",
example: "anthropic/claude-opus-4.1, openai/gpt-5",
description: "Unified API gateway for multiple LLM providers",
example: "openrouter/anthropic/claude-4-opus",
description: "Unified API for multiple providers",
},
{
value: "COMETAPI",
label: "CometAPI",
example: "gpt-5-mini, claude-sonnet-4-5",
description: "Access 500+ AI models through one unified API",
value: "TOGETHER_AI",
label: "Together AI",
example: "together_ai/meta-llama/Llama-3.3-70B-Instruct-Turbo",
description: "Fast open-source models",
},
// Chinese LLM Providers / 国产 LLM 提供商
{
value: "DEEPSEEK",
label: "DeepSeek",
example: "deepseek-chat, deepseek-coder",
description: "Chinese high-performance AI models",
apiBase: "https://api.deepseek.com",
value: "FIREWORKS_AI",
label: "Fireworks AI",
example: "fireworks_ai/accounts/fireworks/models/llama-v3p3-70b-instruct",
description: "Scalable inference platform",
},
{
value: "REPLICATE",
label: "Replicate",
example: "replicate/meta/llama-3-70b-instruct",
description: "ML model hosting platform",
},
{
value: "PERPLEXITY",
label: "Perplexity",
example: "perplexity/sonar-pro, perplexity/sonar-reasoning",
description: "Search-augmented models",
},
{
value: "OLLAMA",
label: "Ollama",
example: "ollama/llama3.1, ollama/mistral",
description: "Run models locally",
},
{
value: "ALIBABA_QWEN",
label: "Qwen",
example: "qwen-max, qwen-plus, qwen-turbo",
description: "Alibaba Cloud Qwen LLM",
label: "Alibaba Qwen",
example: "dashscope/qwen-plus, dashscope/qwen-turbo",
description: "Qwen series models",
apiBase: "https://dashscope.aliyuncs.com/compatible-mode/v1",
},
{
value: "MOONSHOT",
label: "Kimi",
example: "moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k",
description: "Moonshot AI Kimi models",
label: "Moonshot (Kimi)",
example: "moonshot/kimi-latest, moonshot/kimi-k2-thinking",
description: "Kimi AI models",
apiBase: "https://api.moonshot.cn/v1",
},
{
value: "ZHIPU",
label: "GLM",
example: "glm-4, glm-4-flash, glm-3-turbo",
description: "Zhipu AI GLM series models",
label: "Zhipu (GLM)",
example: "openrouter/z-ai/glm-4.6",
description: "GLM series models",
apiBase: "https://open.bigmodel.cn/api/paas/v4",
},
{
value: "ANYSCALE",
label: "Anyscale",
example: "anyscale/meta-llama/Meta-Llama-3-70B-Instruct",
description: "Ray-based inference platform",
},
{
value: "DEEPINFRA",
label: "DeepInfra",
example: "deepinfra/meta-llama/Meta-Llama-3.3-70B-Instruct",
description: "Serverless GPU inference",
},
{
value: "CEREBRAS",
label: "Cerebras",
example: "cerebras/llama-3.3-70b, cerebras/qwen-3-32b",
description: "Fastest inference with Wafer-Scale Engine",
},
{
value: "SAMBANOVA",
label: "SambaNova",
example: "sambanova/Meta-Llama-3.3-70B-Instruct",
description: "AI inference platform",
},
{
value: "AI21",
label: "AI21 Labs",
example: "jamba-1.5-large, jamba-1.5-mini",
description: "Jamba series models",
},
{
value: "CLOUDFLARE",
label: "Cloudflare Workers AI",
example: "cloudflare/@cf/meta/llama-2-7b-chat",
description: "AI on Cloudflare edge network",
},
{
value: "DATABRICKS",
label: "Databricks",
example: "databricks/databricks-meta-llama-3-3-70b-instruct",
description: "Databricks Model Serving",
},
{
value: "CUSTOM",
label: "Custom Provider",
example: "your-custom-model",
description: "Connect to your own custom model endpoint",
description: "Custom OpenAI-compatible endpoint",
},
];