Urgent.News

What's breaking now, across thousands of outlets.

AI

Running Apple's On-Device AI From Flutter, With No API Key and No Server

Every "add AI to your Flutter app" tutorial ends the same way: get an API key, add a billing card, send the user's text to somebody else's server, and hope the latency is tolerable. On iOS 26 and macOS 26 there is a different option that most Flutter developers have not tried, because the plugins did not exist. Apple ships a language model, an image generator and a LiDAR room scanner on the…

Apple's on-device AI capabilities within Flutter apps are revolutionizing the way developers can incorporate AI features without relying on external servers or API keys. This eliminates the need for billing cards and reduces latency by processing AI functions directly on the user's device. The initiative encompasses three packages: LanguageModelSession for text processing, ImageCreator for image generation, and RoomScanController for LiDAR-based room scanning.

One of the key advantages of this on-device AI solution is schema-constrained structured output. Traditional hosted models often require complicated retry loops and jsonDecode processes to obtain precise, structured responses. With Apple's on-device AI, developers can define the desired output structure, and the model is constrained to generate data that adheres to this schema, streamlining the integration process.

The language model package allows developers to summarize text, extract information, classify data, and rewrite content—all without the need for external servers. Additionally, the package enables tool calling, where the model can interact with functions defined by the developer. This allows the model to work with the user's local data, such as notes or transactions, without transmitting any information outside the device.

This feature is particularly valuable for answering user-specific questions and providing personalized assistance.

Image generation is another powerful capability offered on-device. The ImageCreator package streams partial images as they are being generated, providing a more engaging user experience. Rather than a static spinner, users witness the image being created in real-time, resulting in a more interactive and satisfying experience. The package also supports the image editing tools provided by Apple, such as rewriting, proofreading, and summarizing, enhancing the overall functionality of the app.

Finally, the RoomScanController package leverages Apple's LiDAR sensor to scan and map out physical spaces, generating structured geometry data. This feature opens up a wide range of applications, from interior design and property management to furniture retail. The package packages Apple's native scanning UI, providing users with a familiar and intuitive experience, while delivering precise and structured data about the scanned environment.

In conclusion, Apple's on-device AI capabilities within Flutter apps offer a compelling alternative to traditional hosted AI solutions. By processing AI functions directly on the user's device, developers can enjoy reduced latency, no API keys, and no reliance on external servers. The three packages—LanguageModelSession, ImageCreator, and RoomScanController—each provide unique and powerful features that enable developers to create innovative, private, and efficient AI-driven applications.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Wednesday 2 September →