From 15732f0ea77320bb20851a84a296a645fabd56b5 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Thu, 5 Mar 2026 13:29:17 -0800 Subject: [PATCH] cmd: use native Ollama API endpoint for OpenClaw (#14649) Remove the /v1 suffix from the OpenClaw provider baseUrl so it uses the native Ollama API instead of the OpenAI-compatible endpoint. The /v1 endpoint my break tool calling in OpenClaw. --- cmd/config/openclaw.go | 2 +- cmd/config/openclaw_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/config/openclaw.go b/cmd/config/openclaw.go index 8dedd052f..c4788f9c5 100644 --- a/cmd/config/openclaw.go +++ b/cmd/config/openclaw.go @@ -502,7 +502,7 @@ func (c *Openclaw) Edit(models []string) error { ollama = make(map[string]any) } - ollama["baseUrl"] = envconfig.Host().String() + "/v1" + ollama["baseUrl"] = envconfig.Host().String() // needed to register provider ollama["apiKey"] = "ollama-local" ollama["api"] = "ollama" diff --git a/cmd/config/openclaw_test.go b/cmd/config/openclaw_test.go index bcc4b17b7..1fcdf0050 100644 --- a/cmd/config/openclaw_test.go +++ b/cmd/config/openclaw_test.go @@ -589,7 +589,7 @@ const testOpenclawFixture = `{ "providers": { "anthropic": {"apiKey": "xxx"}, "ollama": { - "baseUrl": "http://127.0.0.1:11434/v1", + "baseUrl": "http://127.0.0.1:11434", "models": [{"id": "old-model", "customField": "preserved"}] } }