mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-30 11:26:24 +02:00
refactor: move LLM_PROVIDERS to enums and clean up provider definitions
This commit is contained in:
parent
731e8bbee5
commit
5bcf7b525a
3 changed files with 101 additions and 115 deletions
|
|
@ -17,30 +17,9 @@ import {
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@/components/ui/select";
|
} from "@/components/ui/select";
|
||||||
|
import { LLM_PROVIDERS } from "@/contracts/enums/llm-providers";
|
||||||
import { type CreateLLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
|
import { type CreateLLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
|
||||||
|
|
||||||
const LLM_PROVIDERS = [
|
|
||||||
{ value: "OPENAI", label: "OpenAI", example: "gpt-4o, gpt-4, gpt-3.5-turbo" },
|
|
||||||
{
|
|
||||||
value: "ANTHROPIC",
|
|
||||||
label: "Anthropic",
|
|
||||||
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
|
|
||||||
},
|
|
||||||
{ value: "GROQ", label: "Groq", example: "llama3-70b-8192, mixtral-8x7b-32768" },
|
|
||||||
{ value: "COHERE", label: "Cohere", example: "command-r-plus, command-r" },
|
|
||||||
{ value: "HUGGINGFACE", label: "HuggingFace", example: "microsoft/DialoGPT-medium" },
|
|
||||||
{ value: "AZURE_OPENAI", label: "Azure OpenAI", example: "gpt-4, gpt-35-turbo" },
|
|
||||||
{ value: "GOOGLE", label: "Google", example: "gemini-pro, gemini-pro-vision" },
|
|
||||||
{ value: "AWS_BEDROCK", label: "AWS Bedrock", example: "anthropic.claude-v2" },
|
|
||||||
{ value: "OLLAMA", label: "Ollama", example: "llama2, codellama" },
|
|
||||||
{ value: "MISTRAL", label: "Mistral", example: "mistral-large-latest, mistral-medium" },
|
|
||||||
{ value: "TOGETHER_AI", label: "Together AI", example: "togethercomputer/llama-2-70b-chat" },
|
|
||||||
{ value: "REPLICATE", label: "Replicate", example: "meta/llama-2-70b-chat" },
|
|
||||||
{ value: "OPENROUTER", label: "OpenRouter", example: "anthropic/claude-opus-4.1, openai/gpt-5" },
|
|
||||||
{ value: "COMETAPI", label: "CometAPI", example: "gpt-4o, claude-3-5-sonnet-20241022" },
|
|
||||||
{ value: "CUSTOM", label: "Custom Provider", example: "your-custom-model" },
|
|
||||||
];
|
|
||||||
|
|
||||||
interface AddProviderStepProps {
|
interface AddProviderStepProps {
|
||||||
onConfigCreated?: () => void;
|
onConfigCreated?: () => void;
|
||||||
onConfigDeleted?: () => void;
|
onConfigDeleted?: () => void;
|
||||||
|
|
|
||||||
|
|
@ -37,101 +37,9 @@ import {
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@/components/ui/select";
|
} from "@/components/ui/select";
|
||||||
|
import { LLM_PROVIDERS } from "@/contracts/enums/llm-providers";
|
||||||
import { type CreateLLMConfig, type LLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
|
import { type CreateLLMConfig, type LLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
|
||||||
|
|
||||||
const LLM_PROVIDERS = [
|
|
||||||
{
|
|
||||||
value: "OPENAI",
|
|
||||||
label: "OpenAI",
|
|
||||||
example: "gpt-4o, gpt-4, gpt-3.5-turbo",
|
|
||||||
description: "Most popular and versatile AI models",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "ANTHROPIC",
|
|
||||||
label: "Anthropic",
|
|
||||||
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
|
|
||||||
description: "Constitutional AI with strong reasoning",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "GROQ",
|
|
||||||
label: "Groq",
|
|
||||||
example: "llama3-70b-8192, mixtral-8x7b-32768",
|
|
||||||
description: "Ultra-fast inference speeds",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "COHERE",
|
|
||||||
label: "Cohere",
|
|
||||||
example: "command-r-plus, command-r",
|
|
||||||
description: "Enterprise-focused language models",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "HUGGINGFACE",
|
|
||||||
label: "HuggingFace",
|
|
||||||
example: "microsoft/DialoGPT-medium",
|
|
||||||
description: "Open source model hub",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "AZURE_OPENAI",
|
|
||||||
label: "Azure OpenAI",
|
|
||||||
example: "gpt-4, gpt-35-turbo",
|
|
||||||
description: "Enterprise OpenAI through Azure",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "GOOGLE",
|
|
||||||
label: "Google",
|
|
||||||
example: "gemini-pro, gemini-pro-vision",
|
|
||||||
description: "Google's Gemini AI models",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "AWS_BEDROCK",
|
|
||||||
label: "AWS Bedrock",
|
|
||||||
example: "anthropic.claude-v2",
|
|
||||||
description: "AWS managed AI service",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "OLLAMA",
|
|
||||||
label: "Ollama",
|
|
||||||
example: "llama2, codellama",
|
|
||||||
description: "Run models locally",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "MISTRAL",
|
|
||||||
label: "Mistral",
|
|
||||||
example: "mistral-large-latest, mistral-medium",
|
|
||||||
description: "European AI excellence",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "TOGETHER_AI",
|
|
||||||
label: "Together AI",
|
|
||||||
example: "togethercomputer/llama-2-70b-chat",
|
|
||||||
description: "Decentralized AI platform",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "REPLICATE",
|
|
||||||
label: "Replicate",
|
|
||||||
example: "meta/llama-2-70b-chat",
|
|
||||||
description: "Run models via API",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "OPENROUTER",
|
|
||||||
label: "OpenRouter",
|
|
||||||
example: "anthropic/claude-opus-4.1, openai/gpt-5",
|
|
||||||
description: "API gateway and LLM marketplace that provides unified access ",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "COMETAPI",
|
|
||||||
label: "CometAPI",
|
|
||||||
example: "gpt-5-mini, claude-sonnet-4-5",
|
|
||||||
description: "500+ AI models through one unified API",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "CUSTOM",
|
|
||||||
label: "Custom Provider",
|
|
||||||
example: "your-custom-model",
|
|
||||||
description: "Your own model endpoint",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export function ModelConfigManager() {
|
export function ModelConfigManager() {
|
||||||
const {
|
const {
|
||||||
llmConfigs,
|
llmConfigs,
|
||||||
|
|
|
||||||
99
surfsense_web/contracts/enums/llm-providers.ts
Normal file
99
surfsense_web/contracts/enums/llm-providers.ts
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
export interface LLMProvider {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
example: string;
|
||||||
|
description: 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",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "ANTHROPIC",
|
||||||
|
label: "Anthropic",
|
||||||
|
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
|
||||||
|
description: "Claude models with strong reasoning and long context windows",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: "AZURE_OPENAI",
|
||||||
|
label: "Azure OpenAI",
|
||||||
|
example: "gpt-4, gpt-35-turbo",
|
||||||
|
description: "OpenAI models with Microsoft Azure enterprise features",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "GOOGLE",
|
||||||
|
label: "Google",
|
||||||
|
example: "gemini-pro, gemini-pro-vision",
|
||||||
|
description: "Gemini models with multimodal capabilities",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "AWS_BEDROCK",
|
||||||
|
label: "AWS Bedrock",
|
||||||
|
example: "anthropic.claude-v2",
|
||||||
|
description: "Fully managed foundation models on AWS infrastructure",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "OLLAMA",
|
||||||
|
label: "Ollama",
|
||||||
|
example: "llama2, codellama",
|
||||||
|
description: "Run open-source models locally on your machine",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "MISTRAL",
|
||||||
|
label: "Mistral",
|
||||||
|
example: "mistral-large-latest, mistral-medium",
|
||||||
|
description: "High-performance open-source models from Europe",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "TOGETHER_AI",
|
||||||
|
label: "Together AI",
|
||||||
|
example: "togethercomputer/llama-2-70b-chat",
|
||||||
|
description: "Scalable cloud platform for open-source models",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "REPLICATE",
|
||||||
|
label: "Replicate",
|
||||||
|
example: "meta/llama-2-70b-chat",
|
||||||
|
description: "Cloud API for running machine learning models",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "OPENROUTER",
|
||||||
|
label: "OpenRouter",
|
||||||
|
example: "anthropic/claude-opus-4.1, openai/gpt-5",
|
||||||
|
description: "Unified API gateway for multiple LLM providers",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "COMETAPI",
|
||||||
|
label: "CometAPI",
|
||||||
|
example: "gpt-5-mini, claude-sonnet-4-5",
|
||||||
|
description: "Access 500+ AI models through one unified API",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "CUSTOM",
|
||||||
|
label: "Custom Provider",
|
||||||
|
example: "your-custom-model",
|
||||||
|
description: "Connect to your own custom model endpoint",
|
||||||
|
},
|
||||||
|
];
|
||||||
Loading…
Add table
Add a link
Reference in a new issue