Overview
CodeRabbit flagged that PR #522 repeats NPU catalog bootstrap logic in the example apps: each app registers all logical HNPU rows, catches per-model failures, and refreshes the model registry. That works for the current PR, but it means example apps carry SDK orchestration knowledge instead of making one thin SDK call.
Impact: Medium
Priority: P2
Effort: Medium
Problem Statement
The current PR intentionally registers logical HNPU rows from Android, Flutter, and React Native example apps so token changes immediately re-seed private QHexRT/HNPU bundles. However, the register/count/catch/refresh sequence is duplicated across platforms:
- Android: examples/android/RunAnywhereAI/app/src/main/java/com/runanywhere/runanywhereai/data/ModelBootstrap.kt
- Flutter: examples/flutter/RunAnywhereAI/lib/core/services/model_catalog_bootstrap.dart
- React Native: examples/react-native/RunAnywhereAI/src/services/ModelCatalogBootstrap.ts
This makes the examples less thin and increases the chance that future SDK behavior changes drift across platforms.
Current State
PR #522 applies quick stability fixes in the example apps:
- Android catches per-model failures and now guards final registry refresh failures.
- Settings token save/clear refreshes the NPU catalog after updating auth.
- Flutter and RN refresh their NPU catalogs after token changes.
The remaining structural issue is API shape: the SDK should provide a single catalog re-registration or NPU refresh helper.
Proposed Solution
Expose a shared SDK-level entry point, for example one of:
RunAnywhere.refreshNpuCatalog(models)
RunAnywhere.reregisterCatalog(models)
RunAnywhere.registerCatalog(models, refresh = true)
The SDK API should own:
- registering each provided catalog row,
- per-row failure handling/reporting,
- registry refresh,
- consistent result/count reporting,
- platform bindings for Kotlin, Flutter, and React Native.
Example apps should then only call the SDK API after auth changes.
Implementation Plan
Success Criteria
- Example apps no longer implement multi-step NPU catalog bootstrap logic.
- Android, Flutter, and RN all use the same SDK-level contract.
- Token save/clear still refreshes HNPU catalog visibility.
- Per-model failures are surfaced consistently without crashing the UI.
Related
Overview
CodeRabbit flagged that PR #522 repeats NPU catalog bootstrap logic in the example apps: each app registers all logical HNPU rows, catches per-model failures, and refreshes the model registry. That works for the current PR, but it means example apps carry SDK orchestration knowledge instead of making one thin SDK call.
Impact: Medium
Priority: P2
Effort: Medium
Problem Statement
The current PR intentionally registers logical HNPU rows from Android, Flutter, and React Native example apps so token changes immediately re-seed private QHexRT/HNPU bundles. However, the register/count/catch/refresh sequence is duplicated across platforms:
This makes the examples less thin and increases the chance that future SDK behavior changes drift across platforms.
Current State
PR #522 applies quick stability fixes in the example apps:
The remaining structural issue is API shape: the SDK should provide a single catalog re-registration or NPU refresh helper.
Proposed Solution
Expose a shared SDK-level entry point, for example one of:
The SDK API should own:
Example apps should then only call the SDK API after auth changes.
Implementation Plan
Success Criteria
Related