Commit fb0c5c5
fix(ollama): preserve :cloud model tag for private remote Ollama servers (zeroclaw-labs#4173)
The Ollama provider previously stripped the :cloud suffix from model names
for any non-localhost endpoint, assuming all remote endpoints were Ollama
Cloud (ollama.com). This caused a 404 when a private Ollama server (e.g.
a LAN server at 192.168.x.x) was configured as api_url: the local server
stores cloud-proxy models under their full name (e.g. "glm-5:cloud"), so
stripping the tag results in "model not found" instead of the correct
"quota exhausted" (429) error.
Fix: introduce is_ollama_cloud_endpoint() which matches only ollama.com.
The :cloud suffix is now stripped (and auth required) only when targeting
Ollama Cloud. Private remote servers receive the model name as-is, letting
them serve the cloud-proxy model correctly and return the proper 429 when
cloud quota is exhausted — which triggers fallback to a local model.
Two new tests cover the private-server behavior.
Co-authored-by: ZeroClaw <zeroclaw@zeroclaw.bot>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent aa158b5 commit fb0c5c5
1 file changed
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
179 | | - | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| |||
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
196 | 212 | | |
197 | | - | |
| 213 | + | |
198 | 214 | | |
199 | 215 | | |
200 | 216 | | |
| |||
978 | 994 | | |
979 | 995 | | |
980 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
981 | 1017 | | |
982 | 1018 | | |
983 | 1019 | | |
| |||
0 commit comments