feat: promote assistant configuration

This commit is contained in:
ajnart committed 2026-08-14 11:32:10 +02:00
1 parent c0445cdca2
commit cba2df72e2
13 files changed
+219 -23

No files matched your search

+15
View File
@@ -16,12 +16,15 @@ export const assistantProviderIds = [
export type AssistantProvider = (typeof assistantProviderIds)[number];
export type AssistantProviderCategory = "hosted" | "local" | "custom";
const providerIconBaseUrl = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@latest/icons";
interface AssistantProviderPreset {
baseUrl: string;
modelDiscoveryPath: string | null;
requiresApiKey: boolean;
category: AssistantProviderCategory;
discoveryAuthentication: "bearer" | "anthropic";
iconUrl: string | null;
}
export const assistantProviderPresets = {
@@ -31,6 +34,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/openrouter-color.svg`,
},
openai: {
baseUrl: "https://api.openai.com/v1",
@@ -38,6 +42,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/openai.svg`,
},
anthropic: {
baseUrl: "https://api.anthropic.com/v1",
@@ -45,6 +50,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "anthropic",
iconUrl: `${providerIconBaseUrl}/anthropic.svg`,
},
"google-gemini": {
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
@@ -52,6 +58,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/gemini-color.svg`,
},
xai: {
baseUrl: "https://api.x.ai/v1",
@@ -59,6 +66,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/xai.svg`,
},
groq: {
baseUrl: "https://api.groq.com/openai/v1",
@@ -66,6 +74,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/groq.svg`,
},
mistral: {
baseUrl: "https://api.mistral.ai/v1",
@@ -73,6 +82,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/mistral-color.svg`,
},
deepseek: {
baseUrl: "https://api.deepseek.com",
@@ -80,6 +90,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/deepseek-color.svg`,
},
together: {
baseUrl: "https://api.together.xyz/v1",
@@ -87,6 +98,7 @@ export const assistantProviderPresets = {
requiresApiKey: true,
category: "hosted",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/together-color.svg`,
},
ollama: {
baseUrl: "http://localhost:11434/v1",
@@ -94,6 +106,7 @@ export const assistantProviderPresets = {
requiresApiKey: false,
category: "local",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/ollama.svg`,
},
"lm-studio": {
baseUrl: "http://localhost:1234/v1",
@@ -101,6 +114,7 @@ export const assistantProviderPresets = {
requiresApiKey: false,
category: "local",
discoveryAuthentication: "bearer",
iconUrl: `${providerIconBaseUrl}/lmstudio.svg`,
},
custom: {
baseUrl: "",
@@ -108,6 +122,7 @@ export const assistantProviderPresets = {
requiresApiKey: false,
category: "custom",
discoveryAuthentication: "bearer",
iconUrl: null,
},
} as const satisfies Record<AssistantProvider, AssistantProviderPreset>;