diff --git a/src/LLMProviders/chatModelManager.ts b/src/LLMProviders/chatModelManager.ts index 677af5a2..c5c9dee3 100644 --- a/src/LLMProviders/chatModelManager.ts +++ b/src/LLMProviders/chatModelManager.ts @@ -344,6 +344,9 @@ export default class ChatModelManager { headers: { Authorization: `Bearer ${await getDecryptedKey(customModel.apiKey || "default-key")}`, }, + // Route through Obsidian's requestUrl (safeFetch) to bypass CORS / mixed-content + // restrictions — required on mobile (WKWebView) when calling http:// Ollama hosts. + fetch: customModel.enableCors ? safeFetch : undefined, // Enable thinking for models with REASONING capability (e.g., qwen3, deepseek-r1) // Thinking content goes to additional_kwargs.reasoning_content think: customModel.capabilities?.includes(ModelCapability.REASONING) ?? false,