{"record":{"id":"c54f66bb12bf9df7","repo":"gitbutlerapp/gitbutler","slug":"please-check-ollama-configuration-endpoint-endp","errorCode":null,"errorMessage":"Please check Ollama configuration: endpoint=${endpoint}, model=${model}","messagePattern":"Please check Ollama configuration: endpoint=(.+?), model=(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/desktop/src/components/settings/AiCredentialCheck.svelte","lineNumber":85,"sourceCode":"\t\t\tisUsingButlerAPI = await aiService.usingGitButlerAPI();\n\t\t\tdebugInfo += `, Using GB API: ${isUsingButlerAPI}`;\n\n\t\t\t// Check if configuration is valid\n\t\t\tconst isConfigValid = await aiService.validateConfiguration();\n\t\t\tdebugInfo += `, Config valid: ${isConfigValid}`;\n\n\t\t\tif (!isConfigValid) {\n\t\t\t\tif (modelKind === ModelKind.OpenAI || modelKind === ModelKind.Anthropic) {\n\t\t\t\t\tif (isUsingButlerAPI && !userService.user) {\n\t\t\t\t\t\tthrow new Error(\"Please sign in to use GitButler's AI API\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(\"Please provide a valid API key for your selected AI service\");\n\t\t\t\t\t}\n\t\t\t\t} else if (modelKind === ModelKind.Ollama) {\n\t\t\t\t\t// Get Ollama configuration for more detailed error\n\t\t\t\t\tconst endpoint = await aiService.getOllamaEndpoint();\n\t\t\t\t\tconst model = await aiService.getOllamaModelName();\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Please check Ollama configuration: endpoint=${endpoint}, model=${model}`,\n\t\t\t\t\t);\n\t\t\t\t} else if (modelKind === ModelKind.LMStudio) {\n\t\t\t\t\t// Get LM Studio configuration for more detailed error\n\t\t\t\t\tconst endpoint = await aiService.getLMStudioEndpoint();\n\t\t\t\t\tthrow new Error(`Please check LM Studio configuration: endpoint=${endpoint}`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdebugInfo += `, Testing commit message generation`;\n\n\t\t\t// Set a timeout to fail if the streaming doesn't start or complete\n\t\t\ttestTimeout = setTimeout(() => {\n\t\t\t\tif (testing) {\n\t\t\t\t\tconsole.error(\"AI response timed out after 20 seconds\");\n\t\t\t\t\terror =\n\t\t\t\t\t\t\"AI response timed out after 20 seconds. Please check if your AI service is running properly.\";\n\t\t\t\t\ttesting = false;","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/apps/desktop/src/components/settings/AiCredentialCheck.svelte#L67-L103","documentation":"Thrown by the AI settings credential check when validateConfiguration() fails with ModelKind.Ollama. The message embeds the current endpoint (getOllamaEndpoint()) and model (getOllamaModelName()) so the misconfigured values are visible in the error itself; the log line shows the unexpanded template literal.","triggerScenarios":"Running the check with Ollama selected while the endpoint (default http://localhost:11434) is wrong/unreachable in config, the model name is unset or not present in the local Ollama instance, or Ollama is not running at all.","commonSituations":"Ollama not started (no `ollama serve`); Ollama listening on a non-default port; model never pulled (e.g. llama3 missing from `ollama list`); settings pointing at a remote machine's Ollama that refuses connections.","solutions":["Start Ollama (`ollama serve` or the desktop app) and confirm it answers: curl http://localhost:11434/api/tags.","Pull the configured model (`ollama pull <model>`) or set the model name to one that appears in `ollama list`.","Fix the endpoint in GitButler AI settings to match where Ollama actually listens, including the port.","Re-run the credential check and confirm the endpoint/model echoed in the message are the intended values."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const endpoint = await aiService.getOllamaEndpoint();\ntry {\n  await fetch(`${endpoint.replace(/\\/$/, \"\")}/api/tags`, { signal: AbortSignal.timeout(2000) });\n} catch {\n  error = `Ollama is not reachable at ${endpoint} — start it and try again`;\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCheck();\n} catch (e) {\n  error = e instanceof Error ? e.message : \"Ollama configuration check failed\";\n}","preventionTips":["Health-check the Ollama endpoint (/api/tags) before running the generation test.","Confirm the model appears in `ollama list` before selecting it in settings.","Keep the endpoint and model fields in one settings unit so they are validated together."],"tags":["gitbutler","ai","ollama","local-llm","settings"],"backgroundTag":"ollama-misconfigured","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}