LLM inference vs. the OOM killer The open-source Rust inference library behind the NobodyWho Chat test app can register for OS memory-warning signals to automatically unload LLM models before Android and iOS Out Of Memory killers terminate the app, according to the library's developers. On iOS, tvOS and visionOS the app receives the applicationDidReceiveMemoryWarning: notification, which appears to be sent twice before the app is killed, while Android sends ComponentCallbacks2.onTrimMemory once or twice, and the library's iOS implementation uses objc2, block2 and objc2-ui-kit to observe UIApplicationDidReceiveMemoryWarningNotification on the main queue. The crash occurs when a 1GB model is loaded on an Android emulator configured with hw.ramSize=2G and another memory-hungry application is opened. LLM inference vs. the OOM killer There's many... let's call them "fun challenges" with running LLM inference on mobile devices. A major one is the limited amount of RAM the device has, which of course restricts which models you can run they're called Large language models for a reason , but also influences how you design an application using them. The thing I'll be looking at today is an issue that we're having in the NobodyWho Chat https://www.nobodywho.ai/apps/ app,