Commit 77ce8d1
Fix OllamaClient lifecycle, wire model validation pipeline, add HTTP security
- apprentice_class.py: __aenter__/__aexit__ now enter/exit OllamaClient
async context so local model inference actually works
- factory.py: Construct and wire ModelValidator into Apprentice instance
- serve.py: Pipeline calls validate_and_promote() after fine-tuning;
Add configurable security layer with 4 auth modes (none, api-key,
jwt, hmac), TLS support, and IP allowlist; Default bind to 127.0.0.1
- cli.py/cli_models.py: Add --auth, --api-key, --jwt-secret,
--hmac-secret, --tls-cert, --tls-key, --allowed-ips flags
All 2,064 tests passing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 66c40e2 commit 77ce8d1
5 files changed
Lines changed: 328 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
395 | 399 | | |
396 | 400 | | |
397 | 401 | | |
| |||
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
405 | 416 | | |
406 | 417 | | |
407 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
200 | 213 | | |
201 | 214 | | |
202 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
203 | 223 | | |
204 | 224 | | |
205 | 225 | | |
| |||
532 | 552 | | |
533 | 553 | | |
534 | 554 | | |
535 | | - | |
| 555 | + | |
536 | 556 | | |
537 | 557 | | |
538 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
539 | 570 | | |
540 | 571 | | |
541 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
0 commit comments