refactor(qhexrt): use explicit URL registration
Description
Follow-up to #603 and the QHexRT ownership direction discussed in #532.
Move QHexRT product catalog ownership into the applications. QHexRT retains backend registration, capability probing and architecture-variant selection; Commons resolves logical bundle references and owns shared model registration, download and lifecycle.
This change:
- removes the native product catalog and catalog-only bridges/tests
- registers the Flutter and React Native examples' chosen bundle references through the shared SDK model-registration API
- preserves caller-supplied context length, source, description, download size and capability metadata on the intended SDK paths
- preserves native registration failure codes through Kotlin JNI and Flutter
- guards example model registration on supported capability and successful backend registration
- corrects package examples to use bundle references that include companion files, with keyless React Native initialization
Runtime memory requirements and artifact download sizes remain independent. For resolved HF folder bundles, Commons obtains the live artifact total from the file listing.
Migration
The backend-specific public helpers registerModelForDevice, modelSupportsArchitecture and modelRequiresHfAuth are removed.
Use the shared RunAnywhere.models.register(...) API instead: Kotlin and Flutter use their ModelRegistration.url(...) builders, and React Native uses the registration object. Keep the selected model URLs and per-model architecture/authentication policy in the application.
Probe capability and confirm backend registration before seeding models. Use logical references such as https://huggingface.co/organization/model-repository/model.json for bundle registration; Commons selects the supported architecture folder and companion files. A direct /resolve/main/model.json URL registers only that file. Explicitly pinned references must match the device architecture.
Scope and follow-ups
- #1035 and #1036: complete per-row architecture annotations and eligibility coverage, implemented separately in open PR #1156.
- #857: remaining React Native archive/multi-file and Web, Electron and Python registration-metadata parity.
- #523: shared catalog batch/refresh API; this PR is prerequisite work and does not complete that issue.
- Standalone Android application changes belong in
RunanywhereAI/runanywhere-androidand are outside this PR.
Type of Change
- Bug fix
- Documentation update
- Refactoring
Testing
Verified against head 6380738a43a6c07dec172dffe66700867cb726d6:
- 31 checks passed; 8 were skipped; none failed, queued or running at the last check.
- iOS device-target native compilation passed. This is a build check, not a physical-iPhone inference test.
- Swift products/tests and strict SwiftLint passed.
- Kotlin Android, Flutter workspace checks and React Native typecheck/lint passed.
- React Native core and example Jest steps passed. Focused native-error tests cover negative registration results, zero-result fallback and non-
Errorinputs.
Manual testing:
- OnePlus app startup, unsupported-device handling, model download/load, offline inference and restart persistence
- Supported-device QHexRT registration → download → load → inference
- Physical iPhone inference
Physical-device testing is pending; results will be added after testing.
Checklist
- Self-review completed
- Added/updated tests for changes
- Public-helper migration guidance included above
- Final maintainer approval
No UI layout changes.