Skip to content

Conversation

@Schreezer
Copy link
Contributor

Summary

  • Introduce the Apple Intelligence post-processing provider wired through a Swift FFI bridge so macOS + Apple Silicon users can clean transcripts fully on-device via FoundationModels.
  • Extend Rust settings/actions plus React settings UI to detect Apple provider, auto-select prompts/models, and hide network-only controls while surfacing hardware requirements.

Schreezer and others added 2 commits November 28, 2025 14:28
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@Schreezer
Copy link
Contributor Author

Schreezer commented Nov 28, 2025

so i have been using this since the last commit, and its working well imo... surely adds latency since its apple's local model so atleast 3B but still better than loading a custom one since this will be loaded anyways if you have apple intelligence enabled

@cjpais
Copy link
Owner

cjpais commented Nov 29, 2025

I'm not able to get this to build on my Mac (Tahoe 26.1 (25B78))

error: failed to run custom build command for `handy v0.6.3 (/Users/cj/code/cjpais/Handy/src-tauri)`

Caused by:
  process didn't exit successfully: `/Users/cj/code/cjpais/Handy/src-tauri/target/debug/build/handy-fe8aeb4d6211958b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=apple_intelligence.swift
  cargo:rerun-if-changed=apple_intelligence_bridge.h

  --- stderr
  apple_intelligence.swift:7:16: error: external macro implementation type 'FoundationModelsMacros.GenerableMacro' could not be found for macro 'Generable(description:)'; plugin for module
 'FoundationModelsMacros' not found
    5 | @available(macOS 26.0, *)
    6 | @Generable
    7 | private struct CleanedTranscript: Sendable {
      |                `- error: external macro implementation type 'FoundationModelsMacros.GenerableMacro' could not be found for macro 'Generable(description:)'; plugin for module 'Found
ationModelsMacros' not found
    8 |     let cleanedText: String
    9 | }

  FoundationModels.Generable:4:145: note: 'Generable(description:)' declared here
  2 | @available(tvOS, unavailable)
  3 | @available(watchOS, unavailable)
  4 | @attached(extension, conformances: Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) public macro Generable(description: String? = nil)
= #externalMacro(module: "FoundationModelsMacros", type: "GenerableMacro")
    |                                                                                                                                                 `- note: 'Generable(description:)' dec
lared here

  apple_intelligence.swift:7:16: error: external macro implementation type 'FoundationModelsMacros.GenerableMacro' could not be found for macro 'Generable(description:)'; plugin for module
 'FoundationModelsMacros' not found
    5 | @available(macOS 26.0, *)

@Schreezer
Copy link
Contributor Author

Could you please confirm the version of Xcode you have?
Command: xcode-select --version
xcode-select version 2412.
Command: xcodebuild -version
Xcode 26.1.1
Build version 17B100

Also working on a patch to allow the ones without the latest version to be able to build, my bad...

- Checks if 'FoundationModels.framework' is present in the macOS SDK.
- If missing, compiles a stub Swift file that returns 'unavailable' errors instead of failing the build.
- Prevents build errors on older Xcode versions (or macOS versions < 26.0) where the macros are not supported.
- Checks for runtime availability of Apple Intelligence (via 'check_apple_intelligence_availability') in 'settings.rs'.
- Only adds the Apple Intelligence provider to the default settings if it is actually available on the device.
- Ensures the option does not appear in the UI for unsupported Macs (e.g., Intel or older macOS versions), even if the app was built with support enabled.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@cjpais
Copy link
Owner

cjpais commented Nov 30, 2025

Thanks for the callout something in my env with Xcode with messed up

@Schreezer
Copy link
Contributor Author

I have also made changes to make sure it compiles for lower versions.

@cjpais
Copy link
Owner

cjpais commented Nov 30, 2025

I'm quite impressed by this set of changes. I haven't had to review it entirely, but I did test it on my Mac and it works pretty well out of the box for me. Give me some time to review, as well as make sure that CI still works with this.

I think this is a great default option for MacOS, and might bring post-processing a little closer to prime-time for everyone

@dannysmith
Copy link
Collaborator

I think this is a great default option for MacOS, and might bring post-processing a little closer to prime-time for everyone

I 💯 agree with this - as @Schreezer says: it adds a bit of latency, but compared to other local models (which I don't want loaded all the time) it's much better. Works great for me (M2, macOS 26.0.1) and built with no issues.

@cjpais
Copy link
Owner

cjpais commented Dec 9, 2025

I just want to say a huge thanks for this @Schreezer, it's genuinely amazing

@cjpais cjpais merged commit bfecade into cjpais:main Dec 9, 2025
zhuzhuyule pushed a commit to zhuzhuyule/Votype that referenced this pull request Dec 13, 2025
* feat: add Apple Intelligence post-processing provider

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* feat: guide apple intelligence output

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix(build): add fallback stub for Apple Intelligence on older SDKs

- Checks if 'FoundationModels.framework' is present in the macOS SDK.
- If missing, compiles a stub Swift file that returns 'unavailable' errors instead of failing the build.
- Prevents build errors on older Xcode versions (or macOS versions < 26.0) where the macros are not supported.

* fix(ui): hide Apple Intelligence option when unavailable

- Checks for runtime availability of Apple Intelligence (via 'check_apple_intelligence_availability') in 'settings.rs'.
- Only adds the Apple Intelligence provider to the default settings if it is actually available on the device.
- Ensures the option does not appear in the UI for unsupported Macs (e.g., Intel or older macOS versions), even if the app was built with support enabled.

* move some files around as well as some ui text

* format

---------

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: CJ Pais <[email protected]>
zhuzhuyule pushed a commit to zhuzhuyule/Votype that referenced this pull request Dec 13, 2025
* feat: add Apple Intelligence post-processing provider

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* feat: guide apple intelligence output

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix(build): add fallback stub for Apple Intelligence on older SDKs

- Checks if 'FoundationModels.framework' is present in the macOS SDK.
- If missing, compiles a stub Swift file that returns 'unavailable' errors instead of failing the build.
- Prevents build errors on older Xcode versions (or macOS versions < 26.0) where the macros are not supported.

* fix(ui): hide Apple Intelligence option when unavailable

- Checks for runtime availability of Apple Intelligence (via 'check_apple_intelligence_availability') in 'settings.rs'.
- Only adds the Apple Intelligence provider to the default settings if it is actually available on the device.
- Ensures the option does not appear in the UI for unsupported Macs (e.g., Intel or older macOS versions), even if the app was built with support enabled.

* move some files around as well as some ui text

* format

---------

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: CJ Pais <[email protected]>
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.

3 participants