diff --git a/open-sse/config/providers.js b/open-sse/config/providers.js index c7263fe3..9cb1cb05 100644 --- a/open-sse/config/providers.js +++ b/open-sse/config/providers.js @@ -294,4 +294,8 @@ export const PROVIDERS = { baseUrl: "https://ollama.com/api/chat", format: "ollama" }, + "ollama-local": { + baseUrl: "http://localhost:11434/api/chat", + format: "ollama" + }, }; diff --git a/public/providers/ollama-local.png b/public/providers/ollama-local.png new file mode 100644 index 00000000..8cd2cf1e Binary files /dev/null and b/public/providers/ollama-local.png differ diff --git a/src/app/api/providers/[id]/models/route.js b/src/app/api/providers/[id]/models/route.js index 2dface7f..9f5d174b 100644 --- a/src/app/api/providers/[id]/models/route.js +++ b/src/app/api/providers/[id]/models/route.js @@ -163,6 +163,7 @@ const PROVIDER_MODELS_CONFIG = { siliconflow: createOpenAIModelsConfig("https://api.siliconflow.cn/v1/models"), hyperbolic: createOpenAIModelsConfig("https://api.hyperbolic.xyz/v1/models"), ollama: createOpenAIModelsConfig("https://ollama.com/api/tags"), + "ollama-local": createOpenAIModelsConfig("http://localhost:11434/api/tags"), nanobanana: createOpenAIModelsConfig("https://api.nanobananaapi.ai/v1/models"), chutes: createOpenAIModelsConfig("https://llm.chutes.ai/v1/models"), nvidia: createOpenAIModelsConfig("https://integrate.api.nvidia.com/v1/models"), diff --git a/src/app/api/providers/[id]/test/testUtils.js b/src/app/api/providers/[id]/test/testUtils.js index 55e05487..1c7f19db 100644 --- a/src/app/api/providers/[id]/test/testUtils.js +++ b/src/app/api/providers/[id]/test/testUtils.js @@ -464,6 +464,11 @@ async function testApiKeyConnection(connection, effectiveProxy = null) { const res = await fetch("https://ollama.com/api/tags", { headers: { Authorization: `Bearer ${connection.apiKey}` } }); return { valid: res.ok, error: res.ok ? null : "Invalid API key" }; } + case "ollama-local": { + // No auth required for local Ollama + const res = await fetch("http://localhost:11434/api/tags"); + return { valid: res.ok, error: res.ok ? null : "Ollama not running on localhost:11434" }; + } case "deepgram": { const res = await fetchWithConnectionProxy("https://api.deepgram.com/v1/projects", { headers: { Authorization: `Token ${connection.apiKey}` } }, effectiveProxy); return { valid: res.ok, error: res.ok ? null : "Invalid API key" }; diff --git a/src/app/api/providers/validate/route.js b/src/app/api/providers/validate/route.js index 5087c2eb..d241feed 100644 --- a/src/app/api/providers/validate/route.js +++ b/src/app/api/providers/validate/route.js @@ -164,6 +164,7 @@ export async function POST(request) { case "siliconflow": case "hyperbolic": case "ollama": + case "ollama-local": case "assemblyai": case "nanobanana": case "chutes": @@ -182,6 +183,7 @@ export async function POST(request) { siliconflow: "https://api.siliconflow.cn/v1/models", hyperbolic: "https://api.hyperbolic.xyz/v1/models", ollama: "https://ollama.com/api/tags", + "ollama-local": "http://localhost:11434/api/tags", assemblyai: "https://api.assemblyai.com/v1/account", nanobanana: "https://api.nanobananaapi.ai/v1/models", chutes: "https://llm.chutes.ai/v1/models", diff --git a/src/shared/constants/config.js b/src/shared/constants/config.js index 0d633ea9..53a3e53e 100644 --- a/src/shared/constants/config.js +++ b/src/shared/constants/config.js @@ -48,6 +48,7 @@ export const PROVIDER_ENDPOINTS = { anthropic: "https://api.anthropic.com/v1/messages", gemini: "https://generativelanguage.googleapis.com/v1beta/models", ollama: "https://ollama.com/api/chat", + "ollama-local": "http://localhost:11434/api/chat", }; // Re-export from providers.js for backward compatibility diff --git a/src/shared/constants/providers.js b/src/shared/constants/providers.js index 1635337f..c87758e2 100644 --- a/src/shared/constants/providers.js +++ b/src/shared/constants/providers.js @@ -50,6 +50,7 @@ export const APIKEY_PROVIDERS = { nanobanana: { id: "nanobanana", alias: "nb", name: "NanoBanana", icon: "image", color: "#FFD700", textIcon: "NB", website: "https://nanobananaapi.ai" }, chutes: { id: "chutes", alias: "ch", name: "Chutes AI", icon: "water_drop", color: "#ffffffff", textIcon: "CH", website: "https://chutes.ai" }, ollama: { id: "ollama", alias: "ollama", name: "Ollama Cloud", icon: "cloud", color: "#ffffffff", textIcon: "OL", website: "https://ollama.com" }, + "ollama-local": { id: "ollama-local", alias: "ollama-local", name: "Ollama Local", icon: "cloud", color: "#ffffffff", textIcon: "OL", website: "https://ollama.com" }, }; export const OPENAI_COMPATIBLE_PREFIX = "openai-compatible-";