Skip to content

Support for FoundationModels? #213

Closed

Description

@danielml-mx

Hello, I am trying to build an app that uses Foundation Models to dynamically generate output for a defined struct (using @generable and @Guide), however I get:

error: external macro implementation type 'FoundationModelsMacros.GenerableMacro' could not be found for macro 'Generable(description:)'; plugin for module 'FoundationModelsMacros' not found

Could support for FoundationModelsMacros be realistically added to this project or is it something totally proprietary that Apple would never let us use?

This is an excellent tool by the way, it has been incredibly helpful and convenient, thank you Kabir.

Activity

  1. added
    enhancement
    on Apr 23, 2026
  2. kabiroberai commented on May 28, 2026

    @kabiroberai
    Member

    thanks! this is definitely feasible. I started putting together an open source reimplementation of proprietary Apple macros a while ago (#101) but haven't merged that PR because I haven't yet figured out how to deal with 1) versioning macros alongside Apple SDK updates and 2) a way to serve macro updates without needing to update the SDK. it's just something that I need to think about a bit more; haven't had the chance yet.

    the bigger blocker is re-implementing FoundationModelsMacros. but this is also probably quite feasible now: one could set up an agentic loop where it compares its own implementation to swiftc file.swift -Xfrontend -dump-macro-expansions. the main requirements are time and some liberal token spend. it's not a p0 for me atm so if you / anyone else wants to give it a stab I'd welcome PRs to xtool-org/OpenAppleMacros!

  3. kabiroberai commented on Sep 21, 2026

    @kabiroberai
    Member

    xtool v1.20.0 now integrates OpenAppleMacros for SwiftUI. Probably possible to add FoundationModels support with one prompt.

  4. kabiroberai commented on Sep 21, 2026

    @kabiroberai
    Member

    This will be fixed by #270

  5. added a commit that references this issue on Sep 22, 2026
    916cdff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions