feat(connectors): add Ollama and LM Studio as a local auth kind

Both servers expose OpenAI-compatible /v1/chat/completions and /v1/models,
so we route them through pi-ai's `openai-completions` API the same way
Fireworks does — but with a per-installation base URL the user enters
during onboarding instead of a hardcoded one. The shared schemas grow a
`local` credential payload carrying just the baseUrl; the credential
resolver surfaces it on `ResolvedCredential.baseUrl`, the runtime bridge
forwards it through `prepareRun`, and the worker plumbs it into
`resolveModel` so the streamed Model<openai-completions> targets the
user's server. The local-cost path short-circuits to zero in cost-writer
since users bill their own hardware, and the live model list is fetched
from the saved baseUrl by `fetchLocalConnectorModels` (Ollama and LM
Studio both speak the standard OpenAI catalog shape). Onboarding ships
a new LocalProviderCard and the Settings panel a LocalForm; both default
to the catalog's per-connector localhost URL and accept any custom URL.
This commit is contained in:
ZacharyZhang-NY committed 2026-05-14 14:55:38 -04:00
1 parent 07d9c00fab
commit a532120649
26 files changed
+504 -18

No files matched your search

+4
View File
@@ -189,6 +189,9 @@ export const en: Record<string, string> = {
"onboarding.providers.apiKeyLabel": "API key",
"onboarding.providers.apiKeyRequired": "Enter an API key before saving.",
"onboarding.providers.apiKeyReplacePlaceholder": "Leave empty to keep the current key",
"onboarding.providers.baseUrlLabel": "Base URL",
"onboarding.providers.baseUrlRequired": "Enter the local server URL before saving.",
"onboarding.providers.baseUrlInvalid": "Enter a valid HTTP or HTTPS URL.",
"onboarding.providers.save": "Save",
"onboarding.providers.saving": "Saving…",
"onboarding.providers.saved": "Saved.",
@@ -1130,6 +1133,7 @@ export const en: Record<string, string> = {
"providers.kindAzure": "Azure",
"providers.kindAws": "AWS",
"providers.kindGcp": "Vertex (ADC)",
"providers.kindLocal": "Local",
"providers.statusConnected": "Connected",
"providers.statusExpired": "Expired",
"providers.statusError": "Error",
+4
View File
@@ -189,6 +189,9 @@ export const zh: Record<string, string> = {
"onboarding.providers.apiKeyLabel": "API Key",
"onboarding.providers.apiKeyRequired": "请输入 API Key 后再保存。",
"onboarding.providers.apiKeyReplacePlaceholder": "保持现有 Key 请留空",
"onboarding.providers.baseUrlLabel": "服务地址",
"onboarding.providers.baseUrlRequired": "请填入本地服务地址后再保存。",
"onboarding.providers.baseUrlInvalid": "请输入合法的 HTTP 或 HTTPS 地址。",
"onboarding.providers.save": "保存",
"onboarding.providers.saving": "保存中…",
"onboarding.providers.saved": "已保存。",
@@ -1130,6 +1133,7 @@ export const zh: Record<string, string> = {
"providers.kindAzure": "Azure",
"providers.kindAws": "AWS",
"providers.kindGcp": "Vertex (ADC)",
"providers.kindLocal": "本地",
"providers.statusConnected": "已连接",
"providers.statusExpired": "已过期",
"providers.statusError": "出错",