Posted by Terence Zhang – Developer Relations Engineer, and Adrien Couque – Software program Engineer
AI can improve the person expertise and productiveness of Android apps. For those who’re seeking to construct GenAI options that profit from extra knowledge privateness or offline inference, on-device GenAI is an efficient selection because it processes prompts instantly in your system with none server calls.
Gemini Nano is probably the most environment friendly mannequin in Google’s Gemini household, and Android’s foundational mannequin for working on-device GenAI. It is supported by AICore, a system service that works behind the scenes to centralize the mannequin’s runtime, guarantee its protected execution, and shield your privateness. With Gemini Nano, apps can supply extra customized and dependable AI experiences with out sending your knowledge off the system.
On this weblog submit, we’ll present an introductory look into how Gemini Nano and AICore work collectively to ship highly effective on-device AI capabilities whereas prioritizing customers’ privateness and security.
Personal Compute Core (PCC) compliance
At Google I/O 2021, we launched Personal Compute Core (PCC), a safe surroundings designed to maintain your knowledge non-public. At I/O in 2024, we shared that AICore is PCC compliant, which means that it operates below strict privateness guidelines. It will possibly solely work together with a restricted set of different system packages which are additionally PCC compliant, and it can not instantly entry the web. Any requests to obtain fashions or different data are routed by a separate, open-source companion APK known as Personal Compute Providers.
This framework helps shield your privateness whereas nonetheless permitting apps to profit from the facility of Gemini Nano. Think about a keyboard software utilizing Gemini Nano for a reply suggestion function. With out PCC, the keyboard would require direct entry to the dialog context. With PCC, the code that has entry to the dialog runs in a safe sandbox and interacts instantly with Gemini Nano to generate strategies on behalf of the keyboard. This permits the keyboard app to profit from Gemini Nano’s capabilities with out instantly accessing or storing delicate dialog knowledge. Yow will discover out extra about how this works within the PCC Whitepaper.
Defending your privateness by knowledge isolation
AICore is constructed to isolate every request to guard your privateness. This prevents apps from accessing knowledge that doesn’t belong to them. Requests are dealt with independently and processed from a single app at a time to mitigate the chance of knowledge being uncovered to different apps.
Moreover, AICore does not retailer any file of the enter knowledge or the ensuing outputs after processing every request. This design, mixed with the truth that Gemini Nano’s inference occurs instantly in your system, helps guarantee your app’s knowledge stays non-public and safe.
Prioritizing Security in Gemini Nano
We’re dedicated to constructing AI responsibly, and that features ensuring Gemini Nano is protected. We have carried out a number of layers of safety to restrict dangerous or unintended outcomes:
- Native mannequin security: All Gemini fashions, together with Gemini Nano, are educated to be safety-aware out of the field. This implies security issues are constructed into the core of the mannequin, not simply added as an afterthought.
- Security conscious fine-tuning: We use a LoRA fine-tuning block to adapt Gemini Nano for the wants of particular apps. Once we practice the LoRA block, we incorporate security knowledge particular to the app’s use case to protect and even improve the mannequin’s security options throughout fine-tuning the place relevant.
- Security filters on enter and output: As a last safeguard, each the enter immediate and outcomes generated by the Gemini Nano runtime are evaluated towards our security filters earlier than offering the outcomes to the app. This helps stop unsafe content material from slipping by, with none loss in high quality.
These layers of safety work collectively to make sure that Gemini Nano offers a protected and useful expertise for everybody.
Get began
Study extra about Gemini Nano for app growth, and strive it out in your personal app!
Make sure you take a look at the opposite superb AI on Android Highlight week content material!