-
Foundation Modelフレームワークの新機能
Foundation Modelフレームワークの新機能を紹介します。プライベートクラウドコンピューティングへのアクセス、サードパーティまたはオープンソースのモデルの統合、Visionの各種機能の活用のための方法を確認しましょう。コンテキスト管理のためのAPI、内蔵のセマンティック検索、エージェントを活用した体験をアプリ内で構築する上で役立つ強力なプリミティブについても紹介します。
関連する章
- 0:00 - Introduction
- 2:34 - New on-device model
- 3:21 - Vision: image understanding
- 4:20 - Private Cloud Compute
- 6:46 - Model abstraction layer
- 7:32 - Partner model integrations
- 9:40 - System tools: Vision and Spotlight
- 10:57 - Dynamic Profiles for agentic apps
- 13:46 - Composing models and configurations
- 15:30 - Evaluations framework
- 16:02 - The fm command line tool
- 17:13 - Foundation Models Python SDK
- 17:55 - Open source and framework utilities
- 19:24 - Next steps
リソース
-
このビデオを検索
-
-
2:46 - Context size and token counting
// Context size and token counting let model = SystemLanguageModel() print(model.contextSize) // 8192 let count = try await model.tokenCount(for: "What are the Japanese characters for origami?") print(count) -
3:52 - Attachable image types
// Insert c// Attachable image types let response = try await session.respond { "What animal is this?" Attachment(UIImage(...)) }ode snippet. -
8:45 - Inspecting usage
// Inspecting usage let response = try await session.respond( to: "Recommend a craft that doesn't require scissors.", contextOptions: ContextOptions(reasoningLevel: .light) ) print(response.usage.input.totalTokenCount) print(response.usage.input.cachedTokenCount) print(response.usage.output.totalTokenCount) print(response.usage.output.reasoningTokenCount) -
11:55 - Routing between craft analysis and brainstorm
// Routing between craft analysis and brainstorm @Observable final class AppStates { var mode: Mode } let appStates: AppStates var session: LanguageModelSession? func updateSession() { let originalTranscript = session?.transcript.dropFirstInstructions() ?? Transcript() // Create a new session with new instructions and tools switch appStates.mode { case .craftAnalysis: session = LanguageModelSession( tools: [ RecordImageAnalysisTool(), SwitchModeTool(states: appStates) ], instructions: "Analyze the user's craft project...", transcript: originalTranscript ) case .brainstorm: session = LanguageModelSession( tools: [ RecordBrainstormTool(), ], instructions: "Brainstorm some ideas...", transcript: originalTranscript ) } } struct SwitchModeTool: Tool { let description = "Switch to a different mode." let states: AppStates @Generable struct Arguments { let mode: Mode } func call(arguments: Arguments) async throws -> some PromptRepresentable { appStates.mode = arguments.mode return "Successfully switched to \(arguments.mode)." } } // If mode changes, update the session withObservationTracking { appStates.mode } onChange: { updateSession() } -
12:42 - Describing the profile for craft app
// Describing the profile for craft app struct CraftProfile: LanguageModelSession.DynamicProfile { var body: some DynamicProfile { Profile { Instructions { """ You are an expert crafting assistant. \ Record craft project image analyses \ using the recordImageAnalysis tool. """ } RecordImageAnalysisTool() } } } let session = LanguageModelSession( profile: CraftProfile() ) -
14:36 - Describing the profile for craft app
// Describing the profile for craft app struct CraftProfile: LanguageModelSession.DynamicProfile { let states: CraftProjectStates var body: some DynamicProfile { switch states.mode { case .craftAnalysis: Profile { Instructions { /* ... */ } RecordImageAnalysisTool() SwitchModeTool(states: states) } case .brainstorm: Profile { Instructions { /* ... */ } BrainstormRecordTool() } .model(states.privateCloudCompute) .reasoningLevel(.deep) } } } -
18:29 - Foundation Models SDK for Python
# Foundation Models SDK for Python import apple_fm_sdk as fm model = fm.SystemLanguageModel() # Check the model's availability is_available, reason = model.is_available() if is_available: # Create a session session = fm.LanguageModelSession(model=model) # Generate a response response = await session.respond(prompt="Hello!") print(response)
-
-
- 0:00 - Introduction
Erik Hornberger and Zhen Li introduce this year's Foundation Models release, going open source with a new utilities package, and preview the agenda: model updates, system tools, dynamic profiles, evaluations, and tooling.
- 2:34 - New on-device model
A rebuilt on-device model with better reasoning and tool calling, plus new APIs (from iOS 26.4) for inspecting context size and counting tokens, and refined guardrails that reduce false positives.
- 3:21 - Vision: image understanding
The on-device model gains vision. Add image attachments to a prompt to ask about images, accepting UIImage, NSImage, CGImage, Core Image, CoreVideo pixel buffers, and file URLs at any size, though larger images cost more tokens.
- 4:20 - Private Cloud Compute
Access Apple's server models via PrivateCloudComputeLanguageModel, a 32K context window with reasoning levels, with no account setup, auth, or API keys, fully private, and now available on watchOS 27.
- 6:46 - Model abstraction layer
A new LanguageModel protocol lets local and server models back a LanguageModelSession. Existing models conform already, plus open-source CoreAILanguageModel and MLXLanguageModel for running local models on the Neural Engine and GPU.
- 7:32 - Partner model integrations
Anthropic and Google publish Swift packages for their frontier models. Swap models via Swift Package Manager with everything downstream unchanged, handle auth and billing securely with OAuth and Keychain, and track per-token usage including cache and reasoning tokens.
- 9:40 - System tools: Vision and Spotlight
New built-in tools: BarcodeReaderTool and OCRTool (Vision-backed) for reasoning over visual information, and a Spotlight-powered search tool enabling fully local Retrieval-Augmented Generation (RAG).
- 10:57 - Dynamic Profiles for agentic apps
Dynamic Profiles, a declarative primitive for agentic experiences. Using the Crafts app, a single session swaps instructions and tools between modes (craft analysis vs. brainstorm) by conforming a struct to DynamicProfile.
- 13:46 - Composing models and configurations
Use modifiers to vary the model and reasoning level per profile branch, for example SystemLanguageModel for quick analysis and Private Cloud Compute with deep reasoning for brainstorming, while preserving conversation history. A profile resolves to one active profile at a time.
- 15:30 - Evaluations framework
A new Swift framework to measure the quality of intelligence features, quantifying accuracy as you tweak prompts so you can understand the statistical impact of changes and ship with confidence.
- 16:02 - The fm command line tool
In macOS 27, the models come to the terminal. The fm CLI gives on-device and PCC access for everyday productivity: fm chat for interactive use and piping into shell scripts to summarize, extract, or generate content.
- 17:13 - Foundation Models Python SDK
A Python SDK exposes the same on-device model as the Swift framework, checking availability and generating structured responses in a few lines, for data scientists and researchers in the Python ecosystem.
- 17:55 - Open source and framework utilities
The Foundation Models framework utilities package offers building blocks (transcript management, a skill API, chat-completions interfacing), and the core framework is open-sourced to run wherever Swift runs, including Linux servers.
- 19:24 - Next steps
Download the sample app, get familiar with dynamic profiles and the Evaluations framework, and watch the deep-dive sessions on PCC, evaluations, the Xcode instrument, and dynamic profiles.