Foundry Local runs on-device inference either in the separately installed service app or inside your application process. IPC and embedded modes use the same Kotlin API but differ in how your application is packaged and operated.
Compare the installation experience, application-package impact, process isolation, model storage, and runtime update behavior below.
Your app includes foundry-local-ipc-sdk-<version>.aar and communicates with the Foundry Local
service app.
Your app -> IPC AAR -> Foundry Local service app -> on-device inference
IPC mode characteristics:
- requires the Foundry Local service app from Google Play;
- runs the inference engine in the service process; and
- uses the service-managed runtime and a model cache isolated to the client app.
Good to know: IPC mode depends on a compatible service-app installation. Handle disconnections and reacquire catalog, model, and client handles after reconnecting. Model files are not shared across client apps; orchestration maintains an isolated copy for each app.
Your app includes foundry-local-embedded-sdk-<version>.aar. The AAR bundles the inference runtime,
which loads inside your app process.
Your app -> Embedded AAR -> in-process on-device inference
Embedded mode characteristics:
- requires no companion app;
- packages the inference runtime in your application; and
- uses your app process and app-managed model cache.
Good to know: The embedded artifact increases application size and model memory competes directly with the rest of your app. A native runtime failure also terminates your app process. Measure the final APK or App Bundle produced from the release artifact rather than relying on a generic size estimate.
Both modes expose the same shared API:
FoundryLocalManager.create(...)manager.getCatalog()catalog.listModels()andcatalog.getModel(...)model.download(),load(),unload(), andremoveFromCache()model.createChatClient()andmodel.createAudioClient()- suspend functions, Kotlin
Flow, andFoundryLocalException
Application code for catalog access, model lifecycle, chat, and audio can therefore remain the same.
Initialization also uses the same FoundryLocalManager.create(...) call.
| Concern | IPC mode | Embedded mode |
|---|---|---|
| Runtime process | Foundry Local service app | Your app |
| Companion app | Required | Not required |
| Runtime packaged in your app | No | Yes |
| Model cache ownership | Service-managed and isolated per client app | App-managed |
| Connection loss | Possible; reconnect | Not applicable |
| Native crash boundary | Service process | Your app process |
| Runtime updates | Delivered with the service app | Require shipping a new app build |
Switching modes is more than renaming an AAR:
- Replace the release AAR and rebuild the app.
- Re-test model storage, memory use, startup behavior, and process recovery.
- For IPC mode, verify service installation, compatibility, disconnection, and reconnection.
- For embedded mode, verify native packaging and the final APK or App Bundle on every supported device configuration.
The shared API minimizes application-code changes, but deployment and operational behavior still need mode-specific validation.