apple-foundation-modelslisted
Install: claude install-skill Mixard/fable-pack
# Apple FoundationModels (on-device LLM, iOS 26+)
The FoundationModels framework runs Apple Intelligence's language model entirely on-device: no network, no data leaving the device. Key constraints: availability depends on device eligibility and user settings, and the context window is 4,096 tokens total (instructions + prompt + output combined) — chunk larger inputs across sessions.
## Availability
Check `SystemLanguageModel.default.availability` before creating a session; every unavailability case is reachable in the field:
```swift
struct GenerativeView: View {
private var model = SystemLanguageModel.default
var body: some View {
switch model.availability {
case .available:
ContentView()
case .unavailable(.deviceNotEligible):
Text("Device not eligible for Apple Intelligence")
case .unavailable(.appleIntelligenceNotEnabled):
Text("Please enable Apple Intelligence in Settings")
case .unavailable(.modelNotReady):
Text("Model is downloading or not ready")
case .unavailable(let other):
Text("Model unavailable: \(other)")
}
}
}
```
## LanguageModelSession
```swift
// Single-turn: new session each time
let session = LanguageModelSession()
let response = try await session.respond(to: "What's a good month to visit Paris?")
print(response.content)
// Multi-turn: reuse the session; it keeps conversation context
let session = LanguageModelSession(inst