Uh oh!
There was an error while loading. Please reload this page.
Harden model store and guard ML init - #72
Conversation
Uh oh!
There was an error while loading. Please reload this page.
SDK Coverage •
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greptile SummaryThis PR hardens model download, cache, and Guard ML initialization behavior. The main changes are:
Confidence Score: 4/5This is close, but the model-store fixes should be tightened before merging.
sdk/src/unplug/ml/store.py Important Files Changed
Reviews (2): Last reviewed commit: "Restore backup on failed checkpoint swap" | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 25580e2. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.

Summary
require_mland avoid double resolveModelStore: corrupt manifest handling, weight-file validation, atomic manifest writes and download swaps, fixedlist_statusstale-revision reporting,UNPLUG_MODEL_PATHwarnings, filtered HF snapshot downloadsConfigErrorfor unknownactive_modeltiers; improveunplug-models downloaderror messages (ImportError vs hub/network)Test plan
make check(ruff, mypy, pytest)make test-cov(82.08% total, gate 80%)Note
Medium Risk
Changes affect ML loading, cache upgrades, and config validation at Guard init; behavior is stricter (unknown tiers fail fast) but failures are more recoverable during downloads.
Overview
Hardens the local ML model cache and tightens how Guard loads
active_model.ModelStorenow tolerates corrupt manifests (warn + treat as missing), requires weight files for a valid checkpoint, writes manifests atomically, and downloads into a temp dir with backup/rollback so failed upgrades do not remove a working install.list_statustreats stale catalog revisions as still installed while flagging upgrade available; invalidUNPLUG_MODEL_PATHis logged and ignored. Hugging Face snapshots are limited to safetensors/tokenizer patterns.Unknown
active_modeltier names raiseConfigErrorwith the valid catalog list instead of silently skipping ML. Guard resolves and downloads the model in one try/except path (reusing the resolved spec for the provider), propagatesConfigError, and respectsrequire_mlon download/load failures.unplug-models downloadseparatesImportError(install[ml]) from hub/network errors with a HF hint.Regression tests cover manifest corruption, missing weights, stale revision reporting, download rollback, env path warnings, CLI errors, and Guard degradation vs
require_ml.Reviewed by Cursor Bugbot for commit 25580e2. Bugbot is set up for automated code reviews on this repo. Configure here.