Cupertino Foundation Models

Native local AI for Flutter iOS

Local AI from Flutter: conceptual iPhone illustration with summary, JSON and streaming.

Add a summary, rewrite a message or extract a few fields without sending the text to an external AI service. cupertino_fundations_models connects your Flutter app to Apple Foundation Models through a native Swift bridge. You work in Dart, with sessions, streaming, guided JSON and tools defined by your app.

Start with local AI · Español: inteligencia artificial local para iOS · Get the package

flutter pub add cupertino_fundations_models

Keep generation on the device

Local inference requires no API key or third-party AI service. Set ModelMode.local and CloudPolicy.never. Once Apple’s required assets are available, eligible devices can generate without network. Tools and Speech have separate network/privacy behavior; PCC is an explicit optional cloud route.

Find the guide for your task

What you need Where to start
Your first availability-checked response Local iOS AI tutorial
Structured JSON extraction and classification Task recipes
Sessions, cumulative streams, tools and cancellation Usage contracts
Text/PDF extraction with validation Document extraction
Apple cloud eligibility and consent boundaries Private Cloud Compute
Offline behavior, platforms and eligible devices FAQ

The plugin supports CocoaPods and Swift Package Manager and adds no third-party runtime dependencies. It is an independent MIT-licensed package for Flutter iOS, not a standalone Swift SDK or an Android/macOS/web plugin.

Check availability before offering AI

Generation requires iOS 26+, a device eligible for Apple Intelligence, supported settings/locale and model assets. The package can be included in an iOS 15+ app, but that deployment target does not enable generation on older systems. Some features have newer runtime and SDK requirements.

Use checkAvailability() and handle request failures. Keep tasks bounded and validate model output; guided JSON does not prove that facts or amounts are correct. Compare local, custom-model and cloud approaches.

Explore the implementation

Full package overview · Dart API reference · Example source · Release notes · Apple Foundation Models

This project is maintained by Sebastián Villa. If you run into an integration problem, open an issue with your package version, iOS version and a small example. If the package helps your app, a pub.dev like or GitHub star helps other developers discover it.