feat(server): persist model pin status and auto-load pinned models on boot#2310
feat(server): persist model pin status and auto-load pinned models on boot#2310abn wants to merge 4 commits into
Conversation
e7e8a22 to
3b2822b
Compare
|
@claude please review this |
|
Claude finished @kenvandine's task in 3m 3s —— View job Review: persist & auto-load pinned models
I traced the full flow: pin → Correctness1. Pinned state is persisted before the load succeeds — 2. Multiple conflicting pinned models on boot —
3. Redundant double-write during auto-load Thread-safety4. The "keep thread alive forever" hack —
|
3b2822b to
17a9b19
Compare
|
Review feedback has been addressed. |
|
@claude please review this again |
|
Claude finished @kenvandine's task in 1m 18s —— View job Re-review: persist & auto-load pinned modelsI re-traced the diff against
Verified fixes1 — Persist only after success. 3 — Redundant write. 4 — Mutex. New Thread teardown. The autoload thread is now a joinable member, joined in DRY. Both call sites ( 2 — Silent eviction. Remaining minor notes (non-blocking)
Overall: the previously-flagged correctness and thread-safety concerns are resolved and the mechanism round-trips cleanly. LGTM from my side. ✅ |
|
@kenvandine let me know if you want me to address any of the non blocking notes from above. |
This pull request adds support for persisting and automatically loading "pinned" models in the server. Now, when a model is pinned, its status is saved to disk and, upon server restart, any pinned models are auto-loaded in the background. This ensures that important models are always available after a restart. Previously, this state was lost and server restarts caused configuration amnesia.
Persistence and auto-loading of pinned models:
/internal/pinendpoint), the status is now saved to disk inrecipe_options.json, ensuring persistence across server restarts. [1] [2]Server::load_pinned_models_async) scans for models marked as pinned and loads them in the background, keeping the thread alive to prevent orphaned backend processes. [1] [2] [3]Testing enhancements:
test_pinned_model_persists_and_autoloads_on_restart) that verifies a pinned model is persisted and automatically loaded after a server restart, including setup/teardown and log output for debugging. [1] [2]