AI Provider Configuration#
Blinko supports multiple AI providers configurable through the settings UI. The UI-side provider templates are defined in PROVIDER_TEMPLATES (re-exported from a shared module as of the AI settings refactor). The server-side SDK dispatch lives in LLMProvider.ts and EmbeddingProvider.ts.
Provider Template Registry#
PROVIDER_TEMPLATES in app/src/components/BlinkoSettings/AiSetting/constants.tsx is the canonical list of supported providers shown in the UI. Each entry carries:
| Field | Purpose |
|---|---|
value | Provider identifier used in LLMProvider switch cases |
defaultBaseURL | Pre-filled base URL shown in the settings form |
defaultName, label | Display strings |
icon, docs, website | UI metadata |
Note:
DEFAULT_MODEL_TEMPLATESandinferModelCapabilitiesare re-exported from@shared/lib/modelTemplatesand define the 80+ individual model entries with their capability flags (inference, tools, image, embedding, etc.) .
Correct defaultBaseURL Values#
These are the current correct values per provider :
| Provider | value | defaultBaseURL |
|---|---|---|
| OpenAI | openai | https://api.openai.com/v1 |
| Anthropic | anthropic | https://api.anthropic.com |
| Google AI | google | https://generativelanguage.googleapis.com/v1 |
| Azure OpenAI | azure | https://your-resource-name.openai.azure.com |
| Ollama | ollama | http://localhost:11434 |
| OpenRouter | openrouter | https://openrouter.ai/api/v1 |
| DeepSeek | deepseek | https://api.deepseek.com |
| SiliconFlow | siliconflow | https://api.siliconflow.cn/v1 |
| Grok (X.AI) | grok | https://api.x.ai |
| Voyage AI | voyageai | https://api.voyageai.com/v1 |
| MiniMax | minimax | https://api.minimax.io/v1 |
| LiteLLM | litellm | http://localhost:4000/v1 |
Google AI β historical base URL bug#
The Google AI defaultBaseURL was previously missing the /v1 path suffix (https://generativelanguage.googleapis.com without /v1), causing all Gemini model fetches to fail. PR #1056 fixed this to https://generativelanguage.googleapis.com/v1.
Server-Side Provider Dispatch#
LLMProvider.getLanguageModel() dispatches on config.provider (lowercased) to the correct AI SDK constructor. Key behavioral notes:
- Google / Gemini β The
googleandgeminicases usecreateGoogleGenerativeAIand ignore the user-configuredbaseURL, relying on the SDK's built-in endpoint. Only theapiKeyis passed. - Anthropic β Passes
baseURLthrough tocreateAnthropic, so the template valuehttps://api.anthropic.comis used as the default when no override is set. - Ollama β Applies URL normalization:
config.baseURL?.trim().replace(/\/api$/, '') + '/api', ensuring the/apipath is always appended regardless of what the user provides. The same normalization was missing fromEmbeddingProvider.tsfor Ollama embeddings (open PR #1174) . - MiniMax / LiteLLM β Use
createOpenAI-compatible clients with thebaseURLfrom config or hardcoded fallback . - Azure β Passes
apiVersionin addition tobaseURL. - DeepSeek, OpenRouter, Grok β Use vendor SDKs without a
baseURLparameter; endpoint is baked into the SDK .
Where to Look#
| What | Where |
|---|---|
| UI provider list & default URLs | app/src/components/BlinkoSettings/AiSetting/constants.tsx |
| Model catalog & capability flags | shared/lib/modelTemplates.ts |
| Server LLM dispatch | server/aiServer/providers/LLMProvider.ts |
| Server embedding dispatch | server/aiServer/providers/EmbeddingProvider.ts |
| Provider factory & DB lookup | server/aiServer/aiModelFactory.ts |
DB schema (aiProviders, aiModels) | prisma/schema.prisma |