Files
brave-core/components
Anthony Tseng 80c9469f1d Add model loading to LocalAIService (part 3) (#33726)
* Update LocalModelsUpdater to support dense model files

Add Observer pattern to LocalModelsUpdaterState for notifying
consumers when models are ready. Add dense model file paths for
the 2_Dense and 3_Dense layers.

* Add model loading to LocalAIService and WASM bridge

* Add model loading tests for LocalAIService

Add branch-3-specific tests for the 3-way readiness model
(WASM page loaded, component ready, mojo remote bound).
Fix SetInstallDir to handle empty path as reset for test isolation.

* Read model files directly into BigBuffer shared memory

Allocate BigBuffer(size) upfront — for files >64KB this uses shared
memory internally — then read the file directly into its storage
via File::ReadAndCheck, avoiding a separate heap allocation.

Replace TryLoadModel boolean flags with BarrierClosure(2) that
fires LoadLocalModelFiles once both conditions are met: component
models delivered and WASM factory registered. A fresh barrier is
created on each reset.

Use dependency injection for LocalModelsUpdaterState instead of
GetInstance() singleton access.
2026-03-21 01:59:24 +01:00
..
2026-03-05 14:42:29 +07:00