foundation_models_framework
0.2.1, released 12 months ago by an unverified publisher
Flutter plugin for Apple's on-device Foundation Models framework and Apple Intelligence.
What it does
Integrates with Apple's Foundation Models framework on iOS and macOS to provide session-based language model interactions. Supports token streaming, persistent context, generation options, and content safety guardrails entirely on-device.
AI-written summary of version 0.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building an iOS or macOS app that leverages Apple Intelligence on-device models
- You need local, privacy-first language model chat sessions with streaming responses
Skip it when
- You need cross-platform support for Android or Windows
- Target devices do not support iOS 26.0+ or macOS 15.0+ with Apple Intelligence enabled
Strengths
- On-device processing ensures privacy with no external server costs
- Supports persistent multi-turn chat sessions and real-time token streaming
- Includes built-in content safety guardrails and session pre-warming
Weaknesses
- Restricted only to Apple platforms (iOS 26.0+ / macOS 15.0+)
- Requires physical devices with Apple Intelligence enabled and models downloaded
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires setting iOS deployment target to 26.0+, enabling Apple Intelligence in macOS system settings, and ensuring compatible hardware.
import 'package:foundation_models_framework/foundation_models_framework.dart';
final foundationModels = FoundationModelsFramework.instance;
final session = foundationModels.createSession(
instructions: 'You are a helpful assistant.',
guardrailLevel: GuardrailLevel.standard,
);
final response = await session.respond(prompt: 'Hello, how are you?');
print(response.content);
await session.dispose();Alternatives
Packages that do the same job and could replace foundation_models_framework.
- flutter_local_ai
Unified API for on-device AI inference using native OS models.
89Compare - whisper_flutter_new
Use whisper.cpp speech-to-text models implementation for Android and iOS
50Compare - flutter_litert_lm
Run Large Language Models on-device using Google's LiteRT-LM runtime.
47Compare - deepseek_api
Flutter client for DeepSeek's AI API, enabling chat completions and model management.
41Compare