Foundation Models 프레임워크를 이용해서 온디바이스 LLM을 앱에 통합하기 위해서는 어떤 요구 조건이 필요해?

Asked on 06/15/2025

1 search

To integrate on-device large language models (LLMs) into your app using the Foundation Models framework, there are several requirements and considerations:

  1. Device Compatibility: The availability of the model depends on the support and readiness of Apple Intelligence on the device. It's important to check the status of the model and handle any unavailability in your app's UI. This can be tested using a scheme option in Xcode (Code-along: Bring on-device AI to your app using the Foundation Models framework).

  2. Framework Integration: The Foundation Models framework is available on macOS, iOS, iPadOS, and VisionOS. It allows you to enhance existing app features or create new ones, all while keeping data private and running offline (Meet the Foundation Models framework).

  3. Model Capabilities: The on-device model is optimized for tasks like summarization, extraction, and classification. It is a device-scale model, meaning it is not designed for world knowledge or advanced reasoning, which are typically handled by server-scale LLMs (Meet the Foundation Models framework).

  4. Code Simplicity: Prompting the model is straightforward, requiring just three lines of code: import the framework, create a session, and send your prompt to the model (Platforms State of the Union).

  5. Performance Optimization: The model is optimized using state-of-the-art quantization techniques and speculative decoding to ensure performance efficiency and quality. Swift concurrency is used to manage responses, which can be displayed incrementally using streaming output (Platforms State of the Union).

  6. Safety and Privacy: The framework includes guardrails for core features, and you can add your own safety rules for specific use cases. All data processed by the model remains on the device, ensuring privacy (Platforms State of the Union).

These requirements and features make it possible to integrate on-device LLMs into your app effectively, leveraging Apple's optimized frameworks and tools.