CherryHQ/cherry-studio · error · Error
OVMS provider requires a non-empty `baseURL`. An empty value
Error message
OVMS provider requires a non-empty `baseURL`. An empty value would resolve fetch paths against the renderer process origin (app://, file://) and surface as opaque "Failed to fetch" errors.
What it means
A fail-fast guard inside createOvmsProvider(): if settings.baseURL is empty, the provider refuses to construct. An empty baseURL would make the OpenAI-compatible SDK resolve fetch paths against the Electron renderer origin (app:// or file://), producing opaque 'Failed to fetch' errors that hide the real cause. Throwing at construction converts that into a clear, actionable message.
Source
Thrown at src/main/ai/provider/custom/ovms/ovmsProvider.ts:42
export interface OvmsProvider extends ProviderV3 {
(modelId: string): LanguageModelV3
languageModel(modelId: string): LanguageModelV3
embeddingModel(modelId: string): EmbeddingModelV3
imageModel(modelId: string): ImageModelV3
}
/**
* Unified OVMS provider — chat, embedding, and image off one `ProviderV3`,
* mirroring `newapi-provider.ts`. OVMS is a local OpenVINO Model Server with
* NO auth, so headers carry only what the caller passes (no `Authorization`).
* Chat/embedding hit `settings.baseURL`; the image model keeps its bespoke
* single-shot behavior via `createImageGenerationModel + createOvmsTransport`
* aimed at `settings.imageBaseURL`.
*/
export function createOvmsProvider(settings: OvmsProviderSettings = {}): OvmsProvider {
const { baseURL, fetch: customFetch } = settings
if (!baseURL) {
throw new Error(
'OVMS provider requires a non-empty `baseURL`. An empty value would resolve fetch paths against the renderer process origin (app://, file://) and surface as opaque "Failed to fetch" errors.'
)
}
const authHeaders = () => ({ ...settings.headers })
const url = ({ path }: { path: string; modelId: string }) => `${withoutTrailingSlash(baseURL)}${path}`
const createChatModel = (modelId: string) =>
new OpenAICompatibleChatLanguageModel(modelId, {
provider: `${OVMS_PROVIDER_NAME}.chat`,
url,
headers: authHeaders,
fetch: customFetch
})
const transport = createOvmsTransport({
baseURL: settings.imageBaseURL || DEFAULT_OVMS_BASE_URLView on GitHub (pinned to 726446b54c)
Solutions
- Set a non-empty OVMS host before constructing the provider (e.g. http://localhost:8000/v3/ for chat/embedding).
- If constructing programmatically, read the host from BootConfig/Preference before calling createOvmsProvider.
- In the UI, mark the baseURL field required and disable 'Save' until filled.
- If the user genuinely has no host yet, do not instantiate the provider — defer construction until settings are complete.
Example fix
// before
const provider = createOvmsProvider({ baseURL: settings.ovms?.baseURL })
// after — validate before construction
if (!settings.ovms?.baseURL) throw new Error('OVMS host is required')
const provider = createOvmsProvider({ baseURL: settings.ovms.baseURL }) Defensive patterns
Strategy: validation
Validate before calling
if (!settings.baseURL) {
throw new Error('OVMS host is required (e.g. http://localhost:8000/v3/)')
}
const provider = createOvmsProvider(settings) Type guard
export function isOvmsBaseURLError(e: unknown): boolean {
return e instanceof Error && /OVMS provider requires a non-empty `baseURL`/.test(e.message)
} Try / catch
try {
createOvmsProvider(settings)
} catch (e) {
if (isOvmsBaseURLError(e)) {
// prompt the user for the OVMS host before retrying
}
throw e
} Prevention
- Make the OVMS host field required in the provider UI.
- Load host from Preference/BootConfig before constructing the provider.
- Never instantiate OVMS with an empty baseURL just to 'fill it in later'.
When it happens
Trigger: createOvmsProvider({}) or createOvmsProvider({ baseURL: '' }) — i.e. the OVMS provider is instantiated without a host. Happens at provider factory time when settings haven't been loaded or the user added an OVMS provider without filling in the host.
Common situations: New OVMS provider added via UI but the host field left blank, settings migration leaving baseURL undefined, or programmatic provider construction without the host.
Related errors
- PPIO provider requires a non-empty `baseURL`. An empty value
- Either baseUrl or command must be provided
- DashScope provider requires a non-empty `baseURL`. An empty
- DMXAPI provider requires a non-empty `baseURL` to build the
- DMXAPI provider requires a non-empty `baseURL`. An empty val
AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12).
Data as JSON: /api/errors/a675e651120d09ac.
Report an issue: GitHub.