Skip to content

Add Siri AI (Apple Intelligence) completion model#44

Draft
boggedbrush wants to merge 2 commits into
johnbean393:mainfrom
boggedbrush:agent/add-siri-ai-model
Draft

Add Siri AI (Apple Intelligence) completion model#44
boggedbrush wants to merge 2 commits into
johnbean393:mainfrom
boggedbrush:agent/add-siri-ai-model

Conversation

@boggedbrush

@boggedbrush boggedbrush commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • add Siri AI (Apple Intelligence) as a completion-model choice in Settings and onboarding
  • integrate the public macOS 26+ FoundationModels / SystemLanguageModel API while preserving the macOS 14 deployment target
  • keep existing users on their local GGUF model by default and remember their last local selection when switching providers
  • show precise eligibility, Apple Intelligence, locale, and model-readiness states
  • document that this uses Apple's on-device Foundation Model, not direct Siri assistant or personal-context access
  • restore ModelSetupCoordinator.swift, which the existing recursive Models/ ignore rule accidentally excluded from fresh clones, and scope that rule to the repository-root model directory

Provider behavior and safety

  • use isolated one-shot LanguageModelSessions so transcripts do not leak across keystrokes and overlapping calls do not collide
  • require an explicit S: / J: insertion-boundary protocol, then strip and validate it before presenting text
  • reserve response tokens for that protocol and hard-cap the final prompt at 2,600 UTF-8 bytes
  • cancel superseded work and wait for non-cancellable model loads during app shutdown
  • disable token healing and mid-line completions where Foundation Models does not expose the logits/confidence KeyType's existing safeguards require
  • retain only spellcheck-only correction candidates when model-score validation is unavailable

Validation

  • swift build --package-path Packages/ConstrainedGeneration --target ConstrainedGeneration
  • swift build --package-path Packages/Personalization --target Personalization
  • direct macOS 14-targeted typecheck of the Apple Intelligence adapter
  • direct typecheck of the updated Settings/latency integration
  • syntax parse of the app lifecycle and KeyTypeTests
  • plutil -lint KeyType.xcodeproj/project.pbxproj
  • git diff --check
  • live SystemLanguageModel.default smoke checks on an eligible Mac:
    • Please send -> S:the file
    • I will see you tom -> J:orrow
    • The capital of France is -> S:Paris
    • let pri -> J:nt
    • git che -> J:ckout
  • independent final diff review: no blocking findings

Environment limitation

The full Xcode app/test build could not be run in this environment because the installed Xcode beta license has not been accepted. The license was intentionally not accepted on the user's behalf. The active standalone Command Line Tools installation also lacks XCTest, so package test runners could not execute; focused package builds, direct typechecks, parser checks, project lint, and the live on-device model smoke test were used instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant