feat(inference): persist and manage browser model artifacts - #876
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://models.robomous.ai/registry/v1.jsonand intersect it with a build-owned browser model admission catalogLive registry and admission
The implemented live schema is registry
schema_version: 1: amodelsarray containingid,name, immutablerevision,model_ref, and a relative immutablemanifestpath. The immutable manifests are also schema v1 and describe source revision, ONNX runtime contract, capabilities, and encoder/decoder artifacts. The current manifests expose source metadata but no license field, so legal identity remains pinned by the build admission record and any future manifest license field must match it.The live registry contained five entries during implementation:
b19782d049c0-843761ca46f4359e37f2b168-7983079ab060e48dd681ba4b-1d3ba86d781b7f2c646efd21-e6eb3c03cdbd7f000e65546d-6dbe21e6e60eUnsupported entries are parsed as registry data but never become catalog entries or installable UI. Phase H can admit another release only after its exact execution contract is implemented and pinned.
Trust and persistence model
VITE_MODEL_CDN_BASE_URL; traversal, encoded separators, absolute URLs, and metadata mismatches fail closed. Remote metadata never supplies executable code or imports.visionset-browser-models-v1.https://cache.visionset.invalid/__visionset_model_cache__/<id>/<revision>/sha256/<digest>.The admitted live artifacts are:
https://models.robomous.ai/models/efficient-sam-ti/b19782d049c0-843761ca46f4/encoder.onnx— 24,799,777 bytes —b19782d049c09a8f1cc36ccc6029264ca23c8ac35e6379fd9ef9f1bc6d81e7f2https://models.robomous.ai/models/efficient-sam-ti/b19782d049c0-843761ca46f4/decoder.onnx— 16,501,901 bytes —843761ca46f4aa00b09fdcf0c94271321f76eece092a744296c742d682a86172User-visible behavior
Ready for this session, but it was not saved in this browserstate. Reload then returns to uninstalled.POST /inference/suggest. A ready browser target continues to make no inference HTTP request.Verification
bash scripts/verify_npm_packages.shpnpm test:scripts— 160 passedbash scripts/build_dist.sh && VISIONSET_REQUIRE_WHEEL=1 uv run pytest tests/packaging— 16 passed; installed wheel served successfullybash scripts/check.sh docs— docs build, deterministic projection, and 5,986 internal links passedbash scripts/check.sh— 4,895 Python tests passed / 34 skipped; frontend build, 3,701 package tests, lint/type/boundary/generated gates, 287 app E2Es / 1 opt-in smoke skipped, 5 real-server cycle tests, 23 media E2Es, and 6 browser-runtime E2Es passedReal CDN smoke
The opt-in Chromium smoke fetched and validated the live registry and immutable manifest, downloaded and verified both admitted artifacts, created the real runtime, prepared an image, suggested successfully, recreated the page/runtime, re-verified the persistent cache, and suggested again with zero artifact GETs after reload.
These are observations from one development machine, not CI performance gates.
Known limitations
Provenance compatibility
The live registry and immutable manifest publish
robomous/efficient-sam-ti@b19782d049c0-843761ca46f4; Phase G validates that spelling as registry metadata (registryModelRef). Annotation provenance remains the Phase F contract,efficient-sam-ti@b19782d049c0-843761ca46f4(annotationModelRef). The identical admitted artifact revision therefore produces the same accepted-annotationmodel_refbefore and after this PR.Artifact verification and persistence are separate typed stages. Raw downloader output must pass the build-owned size/SHA checks before it can be persisted, retained for the session, or passed to ORT. Integrity failures hard-fail; only persistence failures may use the verified session-only fallback.