Commit dd2be9a
committed
feat: add Ollama native API support to inference proxy
Add pattern detection, provider profile, and validation probe for
Ollama's native /api/chat, /api/tags, and /api/show endpoints.
Proxy changes (l7/inference.rs):
- POST /api/chat -> ollama_chat protocol
- GET /api/tags -> ollama_model_discovery protocol
- POST /api/show -> ollama_model_discovery protocol
Provider profile (openshell-core/inference.rs):
- New 'ollama' provider type with default endpoint
http://host.openshell.internal:11434
- Supports ollama_chat, ollama_model_discovery, and OpenAI-compatible
protocols (openai_chat_completions, openai_completions, model_discovery)
- Credential lookup via OLLAMA_API_KEY, base URL via OLLAMA_BASE_URL
Validation (backend.rs):
- Ollama validation probe sends minimal /api/chat request with stream:false
Tests: 4 new tests for pattern detection (ollama chat, tags, show,
and GET /api/chat rejection).
Signed-off-by: Lyle Hopkins <lyle@cosmicnetworks.com>1 parent 0e5ebb6 commit dd2be9a
3 files changed
Lines changed: 82 additions & 0 deletions
File tree
- crates
- openshell-core/src
- openshell-router/src
- openshell-sandbox/src/l7
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
89 | 107 | | |
90 | 108 | | |
91 | 109 | | |
| |||
95 | 113 | | |
96 | 114 | | |
97 | 115 | | |
| 116 | + | |
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
46 | 64 | | |
47 | 65 | | |
48 | 66 | | |
| |||
372 | 390 | | |
373 | 391 | | |
374 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
375 | 424 | | |
376 | 425 | | |
377 | 426 | | |
| |||
0 commit comments