Commit bd221ad
committed
feat: add custom base URL support for local AI services
Add comprehensive support for connecting to local and custom AI endpoints like LM Studio, vLLM, Ollama, and other OpenAI-compatible services.
Changes:
1. Configuration options (config.yaml):
- Added ai-base-url for primary provider
- Added ai0-base-url through ai9-base-url for additional slots
- Updated all provider descriptions with full list of 15 supported providers
- Added GitHub Copilot provider support
- Enhanced api-key documentation with provider-specific details
2. Config generation (hooks/common.sh):
- Implemented models.providers section generation in openclaw.json
- Dynamically collects custom baseUrls from primary and ai0-ai9 slots
- Generates proper JSON structure only when baseUrls are configured
- Handles multiple providers with different custom endpoints
- Changed auth profile type from api_key to token for OpenClaw 2026.x
- Removed legacy environment variable API key storage (now uses auth-profiles.json)
3. Documentation (README.md):
- Added examples for LM Studio, vLLM, Text Generation WebUI
- Updated Multi-AI Model Support section with baseUrl parameters
- Added Using Custom Base URLs with Multiple Models section
- Documented mixing cloud and local AI models simultaneously
Technical details:
- Research confirmed baseUrl belongs in openclaw.json at models.providers.<provider>.baseUrl
- Auth-profiles.json only handles authentication (type, provider, key/token)
- Supports up to 11 AI models with custom endpoints (1 primary + 10 slots)
- Backward compatible - existing configs without baseUrls work unchanged
Examples:
- LM Studio: ai-provider=openai ai-base-url=http://localhost:1234/v1
- vLLM: ai-provider=openai ai-base-url=http://localhost:8000/v1
- Mix cloud + local: primary=anthropic, slot0=LM Studio, slot1=vLLM1 parent 6b9dd28 commit bd221ad
3 files changed
Lines changed: 280 additions & 68 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
192 | 220 | | |
193 | 221 | | |
194 | 222 | | |
| |||
221 | 249 | | |
222 | 250 | | |
223 | 251 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
235 | 294 | | |
236 | | - | |
| 295 | + | |
237 | 296 | | |
238 | 297 | | |
239 | 298 | | |
| |||
320 | 379 | | |
321 | 380 | | |
322 | 381 | | |
| 382 | + | |
323 | 383 | | |
324 | 384 | | |
325 | 385 | | |
| 386 | + | |
326 | 387 | | |
327 | 388 | | |
328 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
| |||
34 | 49 | | |
35 | 50 | | |
36 | 51 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
41 | 80 | | |
42 | 81 | | |
43 | 82 | | |
44 | 83 | | |
45 | 84 | | |
46 | | - | |
| 85 | + | |
| 86 | + | |
47 | 87 | | |
48 | 88 | | |
49 | 89 | | |
| |||
55 | 95 | | |
56 | 96 | | |
57 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
58 | 103 | | |
59 | 104 | | |
60 | 105 | | |
61 | | - | |
| 106 | + | |
62 | 107 | | |
63 | 108 | | |
64 | 109 | | |
| |||
70 | 115 | | |
71 | 116 | | |
72 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
73 | 123 | | |
74 | 124 | | |
75 | 125 | | |
76 | | - | |
| 126 | + | |
77 | 127 | | |
78 | 128 | | |
79 | 129 | | |
| |||
85 | 135 | | |
86 | 136 | | |
87 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
88 | 143 | | |
89 | 144 | | |
90 | 145 | | |
91 | | - | |
| 146 | + | |
92 | 147 | | |
93 | 148 | | |
94 | 149 | | |
| |||
100 | 155 | | |
101 | 156 | | |
102 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
103 | 163 | | |
104 | 164 | | |
105 | 165 | | |
106 | | - | |
| 166 | + | |
107 | 167 | | |
108 | 168 | | |
109 | 169 | | |
| |||
115 | 175 | | |
116 | 176 | | |
117 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
118 | 183 | | |
119 | 184 | | |
120 | 185 | | |
121 | | - | |
| 186 | + | |
122 | 187 | | |
123 | 188 | | |
124 | 189 | | |
| |||
130 | 195 | | |
131 | 196 | | |
132 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
133 | 203 | | |
134 | 204 | | |
135 | 205 | | |
136 | | - | |
| 206 | + | |
137 | 207 | | |
138 | 208 | | |
139 | 209 | | |
| |||
145 | 215 | | |
146 | 216 | | |
147 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
148 | 223 | | |
149 | 224 | | |
150 | 225 | | |
151 | | - | |
| 226 | + | |
152 | 227 | | |
153 | 228 | | |
154 | 229 | | |
| |||
160 | 235 | | |
161 | 236 | | |
162 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
163 | 243 | | |
164 | 244 | | |
165 | 245 | | |
166 | | - | |
| 246 | + | |
167 | 247 | | |
168 | 248 | | |
169 | 249 | | |
| |||
175 | 255 | | |
176 | 256 | | |
177 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
178 | 263 | | |
179 | 264 | | |
180 | 265 | | |
181 | | - | |
| 266 | + | |
182 | 267 | | |
183 | 268 | | |
184 | 269 | | |
| |||
190 | 275 | | |
191 | 276 | | |
192 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
193 | 283 | | |
194 | 284 | | |
195 | 285 | | |
| |||
0 commit comments