Unlock Custom On-Device Gemini Nano Experiences


Prompt API lets you create custom prompts and set optional generation parameters with just a few lines of code:

Generation.getClient().generateContent(
   generateContentRequest(
       ImagePart(bitmapImage),
       TextPart("Categorize this image as one of the following: car, motorcycle, bike, scooter, other. Return only the category as the response."),
   ) {
       // Optional parameters
       temperature = 0.2f
       topK = 10
       candidateCount = 1
       maxOutputTokens = 10
   },
)

For more detailed examples of implementing Prompt API, check out the official documentation and sample on Github.


Gemini Nano, performance, and prototyping


Prompt API currently performs best on the Pixel 10 device series, which runs the latest version of Gemini Nano (nano-v3). This version of Gemini Nano is built on the same architecture as Gemma 3n, the model we first shared with the open model community at I/O.


The shared foundation between Gemma 3n and nano-v3 enables developers to more easily prototype features. For those without a Pixel 10 device, you can start experimenting with prompts today by prototyping with Gemma 3n locally or accessing it online through Google AI Studio.


For the full list of devices that support GenAI APIs, refer to our device support documentation.


Learn more

Start implementing Prompt API in your Android apps today with guidance from our official documentation and the sample on Github.



Source link

  • Related Posts

    Accelerating your insights with faster, smarter monetization data and recommendations

    Posted by Phalene Gowling, Product Manager, Google Play To build a thriving business on Google Play, you need more than just data  – you need a clear path to action. Today,…

    How Automated Prompt Optimization Unlocks Quality Gains for ML Kit’s GenAI Prompt API

    Automated Prompt Optimization (APO) To further help bring your ML Kit Prompt API use cases to production, we are excited to announce Automated Prompt Optimization (APO) targeting On-Device models on…

    Leave a Reply

    Your email address will not be published. Required fields are marked *