Build On-Device Reply Suggestions with Apple's Foundation Models & Stream Chat
Blog post from Stream
This tutorial demonstrates the integration of Apple's Foundation Models framework with Stream Chat to create on-device reply suggestions for a SwiftUI chat app. By leveraging a ~3B parameter model available in iOS 26, the solution allows for the generation of reply suggestions directly on the device, eliminating API costs and ensuring that conversation context remains private. The integration requires minimal setup, involving a ViewFactory override and a LanguageModelSession wrapped in an actor for localized inference, which is beneficial for frequent, latency-sensitive tasks. This design ensures that if Apple Intelligence is unavailable, the app gracefully degrades without disrupting chat functionality. The tutorial also showcases how to set up a demo using Stream's Agent Skills, which provide pre-defined instructions for integrating Stream's chat functionality without extensive coding. Stream Chat manages the messaging infrastructure, while Apple's on-device model focuses on generating reply suggestions, resulting in a seamless and efficient user experience. The approach highlights the potential of combining cloud-based chat services with local AI inference to enhance app features without compromising performance or privacy.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Real-time | 4 | 4,246 | 1,018 | 209 | -26% |
| AI Coding Assistant | 1 | 1,189 | 321 | 130 | -45% |
| LLM | 1 | 5,650 | 930 | 207 | -9% |
| Local AI | 1 | 122 | 31 | 19 | +77% |
| Secrets Management | 1 | 1,764 | 343 | 110 | -30% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.