QVAC-22141 feat[api]: add fallbackSrc to loadModel - #3845
Conversation
Review StatusCurrent Status: ✅ APPROVED |
License compliance — cleanNo new dependency license findings in this PR. Warn-only (shadow) mode — this check does not block merges yet. Updated automatically by the canonical license compliance workflow. NOTICE presence (advisory)Missing NOTICE (advisory, does not block):
|
902dcd0 to
ddc6bae
Compare
There was a problem hiding this comment.
adds fallbackSrc for catalog loadModel() with checksum validation — right shape for #3224, and the bare tests cover the decision matrix well.
two blockers before merge: (1) Generate + test is red — schema.json gained fallbackSrc but packages/sdk-python/.../_generated wasn't regenerated (scripts/generate.py --check); (2) any primary failure for a known catalog model without fallbackSrc gets rewritten into a "registry on this network" ModelLoadFailedError, which masks typed errors like ChecksumValidationFailedError.
ddc6bae to
6aa27d4
Compare
6aa27d4 to
781145f
Compare
lauripiisang
left a comment
There was a problem hiding this comment.
Approved, although the error message can be improved. Please resolve comment if you see it as not necessarily valuable.
f60c8f1
781145f to
f60c8f1
Compare
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
Signed-off-by: Arun Mani J <j.arunmani@proton.me>
f60c8f1 to
2a26ecb
Compare
🎯 What problem does this PR solve?
loadModel()with a built-in catalog constant fails with no alternative and the app cannot load the model (#3224).📝 How does it solve it?
fallbackSrc(an HTTP URL or a local file path) toloadModel(). When a built-in registry model's download fails, the SDK loads that model fromfallbackSrcinstead.fallbackSrcare validated against the catalog model's sha256 checksum before use, so an alternate source is trusted to the same degree as the registry copy.fallbackSrcis honored only whenmodelSrcis a built-in catalog model — that constant supplies the checksum. It is rejected for a local-path/URLmodelSrc, and aregistry:///pear://fallback is rejected (it would re-enter the transport that just failed).info.🧪 How was it tested?
fallbackSrcis accepted on the wire and carried through the options→request transform.loadModel()falls back to a local copy of the model, validates it against the catalog checksum, and streams a completion. Also confirmed a nonexistentfallbackSrcsurfaces a not-found error and a wrong-content file surfaces a checksum-validation error.🔌 API Changes