Changesets · Branches · Tags · Compare
| Changeset | 56b312a3daa7542f67182e4e64b4a764412b3528013a4840314f3c28ae34298c |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30 |
| Parents | c093109a6490 |
1 file changed
modified packages/openai-adapters/src/index.ts +9 −0
| @@ -141,6 +141,15 @@ | ||
| 141 | 141 | case "lmstudio": |
| 142 | 142 | return openAICompatible("http://localhost:1234/", config); |
| 143 | 143 | case "ollama": |
| 144 | + // for openai compaitability, we need to add /v1 to the end of the url | |
| 145 | + // this is required for cli (for core, endpoints are overriden by core/llm/llms/Ollama.ts) | |
| 146 | + if (config.apiBase && !config.apiBase.endsWith("v1")) { | |
| 147 | + if (config.apiBase.endsWith("/")) { | |
| 148 | + config.apiBase += "v1/"; | |
| 149 | + } else { | |
| 150 | + config.apiBase += "/v1/"; | |
| 151 | + } | |
| 152 | + } | |
| 144 | 153 | return openAICompatible("http://localhost:11434/v1/", config); |
| 145 | 154 | case "mock": |
| 146 | 155 | return new MockApi(); |