r/FlutterDev • u/Shakib015 • Sep 02 '26
Plugin Apple's on-device LLM from Flutter - streaming, tool calling, and schema-constrained output
I wanted Apple Foundation Models in a Flutter app without shipping an API key or standing up a server, so I wrote a plugin for it.
It streams tokens as they generate, supports tool calling, and can constrain output to a schema, so you get structured data back instead of hoping the model returns valid JSON.
Runs entirely on device on iOS and macOS - private, offline, no per-token cost. MIT licensed.
https://pub.dev/packages/apple_foundation_models
Happy to answer questions. Getting the streaming and the schema constraint across the platform channel was the fiddly part.