Skip to content

Commit aff8fe6

Browse files
authored
Merge pull request #368 from MODSetter/dev
refactor: move LLM_PROVIDERS to enums and clean up provider definitions
2 parents 731e8bb + 5bcf7b5 commit aff8fe6

File tree

3 files changed

+101
-115
lines changed

3 files changed

+101
-115
lines changed

surfsense_web/components/onboard/add-provider-step.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,9 @@ import {
1717
SelectTrigger,
1818
SelectValue,
1919
} from "@/components/ui/select";
20+
import { LLM_PROVIDERS } from "@/contracts/enums/llm-providers";
2021
import { type CreateLLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
2122

22-
const LLM_PROVIDERS = [
23-
{ value: "OPENAI", label: "OpenAI", example: "gpt-4o, gpt-4, gpt-3.5-turbo" },
24-
{
25-
value: "ANTHROPIC",
26-
label: "Anthropic",
27-
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
28-
},
29-
{ value: "GROQ", label: "Groq", example: "llama3-70b-8192, mixtral-8x7b-32768" },
30-
{ value: "COHERE", label: "Cohere", example: "command-r-plus, command-r" },
31-
{ value: "HUGGINGFACE", label: "HuggingFace", example: "microsoft/DialoGPT-medium" },
32-
{ value: "AZURE_OPENAI", label: "Azure OpenAI", example: "gpt-4, gpt-35-turbo" },
33-
{ value: "GOOGLE", label: "Google", example: "gemini-pro, gemini-pro-vision" },
34-
{ value: "AWS_BEDROCK", label: "AWS Bedrock", example: "anthropic.claude-v2" },
35-
{ value: "OLLAMA", label: "Ollama", example: "llama2, codellama" },
36-
{ value: "MISTRAL", label: "Mistral", example: "mistral-large-latest, mistral-medium" },
37-
{ value: "TOGETHER_AI", label: "Together AI", example: "togethercomputer/llama-2-70b-chat" },
38-
{ value: "REPLICATE", label: "Replicate", example: "meta/llama-2-70b-chat" },
39-
{ value: "OPENROUTER", label: "OpenRouter", example: "anthropic/claude-opus-4.1, openai/gpt-5" },
40-
{ value: "COMETAPI", label: "CometAPI", example: "gpt-4o, claude-3-5-sonnet-20241022" },
41-
{ value: "CUSTOM", label: "Custom Provider", example: "your-custom-model" },
42-
];
43-
4423
interface AddProviderStepProps {
4524
onConfigCreated?: () => void;
4625
onConfigDeleted?: () => void;

surfsense_web/components/settings/model-config-manager.tsx

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -37,101 +37,9 @@ import {
3737
SelectTrigger,
3838
SelectValue,
3939
} from "@/components/ui/select";
40+
import { LLM_PROVIDERS } from "@/contracts/enums/llm-providers";
4041
import { type CreateLLMConfig, type LLMConfig, useLLMConfigs } from "@/hooks/use-llm-configs";
4142

42-
const LLM_PROVIDERS = [
43-
{
44-
value: "OPENAI",
45-
label: "OpenAI",
46-
example: "gpt-4o, gpt-4, gpt-3.5-turbo",
47-
description: "Most popular and versatile AI models",
48-
},
49-
{
50-
value: "ANTHROPIC",
51-
label: "Anthropic",
52-
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
53-
description: "Constitutional AI with strong reasoning",
54-
},
55-
{
56-
value: "GROQ",
57-
label: "Groq",
58-
example: "llama3-70b-8192, mixtral-8x7b-32768",
59-
description: "Ultra-fast inference speeds",
60-
},
61-
{
62-
value: "COHERE",
63-
label: "Cohere",
64-
example: "command-r-plus, command-r",
65-
description: "Enterprise-focused language models",
66-
},
67-
{
68-
value: "HUGGINGFACE",
69-
label: "HuggingFace",
70-
example: "microsoft/DialoGPT-medium",
71-
description: "Open source model hub",
72-
},
73-
{
74-
value: "AZURE_OPENAI",
75-
label: "Azure OpenAI",
76-
example: "gpt-4, gpt-35-turbo",
77-
description: "Enterprise OpenAI through Azure",
78-
},
79-
{
80-
value: "GOOGLE",
81-
label: "Google",
82-
example: "gemini-pro, gemini-pro-vision",
83-
description: "Google's Gemini AI models",
84-
},
85-
{
86-
value: "AWS_BEDROCK",
87-
label: "AWS Bedrock",
88-
example: "anthropic.claude-v2",
89-
description: "AWS managed AI service",
90-
},
91-
{
92-
value: "OLLAMA",
93-
label: "Ollama",
94-
example: "llama2, codellama",
95-
description: "Run models locally",
96-
},
97-
{
98-
value: "MISTRAL",
99-
label: "Mistral",
100-
example: "mistral-large-latest, mistral-medium",
101-
description: "European AI excellence",
102-
},
103-
{
104-
value: "TOGETHER_AI",
105-
label: "Together AI",
106-
example: "togethercomputer/llama-2-70b-chat",
107-
description: "Decentralized AI platform",
108-
},
109-
{
110-
value: "REPLICATE",
111-
label: "Replicate",
112-
example: "meta/llama-2-70b-chat",
113-
description: "Run models via API",
114-
},
115-
{
116-
value: "OPENROUTER",
117-
label: "OpenRouter",
118-
example: "anthropic/claude-opus-4.1, openai/gpt-5",
119-
description: "API gateway and LLM marketplace that provides unified access ",
120-
},
121-
{
122-
value: "COMETAPI",
123-
label: "CometAPI",
124-
example: "gpt-5-mini, claude-sonnet-4-5",
125-
description: "500+ AI models through one unified API",
126-
},
127-
{
128-
value: "CUSTOM",
129-
label: "Custom Provider",
130-
example: "your-custom-model",
131-
description: "Your own model endpoint",
132-
},
133-
];
134-
13543
export function ModelConfigManager() {
13644
const {
13745
llmConfigs,
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
export interface LLMProvider {
2+
value: string;
3+
label: string;
4+
example: string;
5+
description: string;
6+
}
7+
8+
export const LLM_PROVIDERS: LLMProvider[] = [
9+
{
10+
value: "OPENAI",
11+
label: "OpenAI",
12+
example: "gpt-4o, gpt-4, gpt-3.5-turbo",
13+
description: "Industry-leading GPT models with broad capabilities",
14+
},
15+
{
16+
value: "ANTHROPIC",
17+
label: "Anthropic",
18+
example: "claude-3-5-sonnet-20241022, claude-3-opus-20240229",
19+
description: "Claude models with strong reasoning and long context windows",
20+
},
21+
{
22+
value: "GROQ",
23+
label: "Groq",
24+
example: "llama3-70b-8192, mixtral-8x7b-32768",
25+
description: "Lightning-fast inference with custom LPU hardware",
26+
},
27+
{
28+
value: "COHERE",
29+
label: "Cohere",
30+
example: "command-r-plus, command-r",
31+
description: "Enterprise NLP models optimized for business applications",
32+
},
33+
{
34+
value: "HUGGINGFACE",
35+
label: "HuggingFace",
36+
example: "microsoft/DialoGPT-medium",
37+
description: "Access thousands of open-source models",
38+
},
39+
{
40+
value: "AZURE_OPENAI",
41+
label: "Azure OpenAI",
42+
example: "gpt-4, gpt-35-turbo",
43+
description: "OpenAI models with Microsoft Azure enterprise features",
44+
},
45+
{
46+
value: "GOOGLE",
47+
label: "Google",
48+
example: "gemini-pro, gemini-pro-vision",
49+
description: "Gemini models with multimodal capabilities",
50+
},
51+
{
52+
value: "AWS_BEDROCK",
53+
label: "AWS Bedrock",
54+
example: "anthropic.claude-v2",
55+
description: "Fully managed foundation models on AWS infrastructure",
56+
},
57+
{
58+
value: "OLLAMA",
59+
label: "Ollama",
60+
example: "llama2, codellama",
61+
description: "Run open-source models locally on your machine",
62+
},
63+
{
64+
value: "MISTRAL",
65+
label: "Mistral",
66+
example: "mistral-large-latest, mistral-medium",
67+
description: "High-performance open-source models from Europe",
68+
},
69+
{
70+
value: "TOGETHER_AI",
71+
label: "Together AI",
72+
example: "togethercomputer/llama-2-70b-chat",
73+
description: "Scalable cloud platform for open-source models",
74+
},
75+
{
76+
value: "REPLICATE",
77+
label: "Replicate",
78+
example: "meta/llama-2-70b-chat",
79+
description: "Cloud API for running machine learning models",
80+
},
81+
{
82+
value: "OPENROUTER",
83+
label: "OpenRouter",
84+
example: "anthropic/claude-opus-4.1, openai/gpt-5",
85+
description: "Unified API gateway for multiple LLM providers",
86+
},
87+
{
88+
value: "COMETAPI",
89+
label: "CometAPI",
90+
example: "gpt-5-mini, claude-sonnet-4-5",
91+
description: "Access 500+ AI models through one unified API",
92+
},
93+
{
94+
value: "CUSTOM",
95+
label: "Custom Provider",
96+
example: "your-custom-model",
97+
description: "Connect to your own custom model endpoint",
98+
},
99+
];

0 commit comments

Comments
 (0)