Skip to content

Uses the Foundation Models API on macOS Tahoe for a simple C++ header (aka, it lets you use Apple Intelligence in C++)

License

Notifications You must be signed in to change notification settings

bottomline-sabotage/cpp_apple_ai_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Apple Intelligence Wrapper

Is a very simple and thrown together (aka, this might have some weird bugs) C++ wrapper for the macOS Foundation Models API (available on macOS 26) which allows Swift code to use Apple Intelligence.

See a proper example in test.cpp

Caution

This is ONLY supported on macOS Tahoe (which is currently in beta).

Compiling

Compiling is pretty simple. For reference, I used Apple clang++ (with C++20) and swiftc. Just ensure you follow this order:

  1. Compile runFunction.cpp
  2. Compile src.swift (link to the compiled runFunction) using swiftc
  3. Compile code that uses the wrapper (e.g., test.cpp), linking to the compiled src.swift

About

Uses the Foundation Models API on macOS Tahoe for a simple C++ header (aka, it lets you use Apple Intelligence in C++)

Topics

Resources

License

Stars

Watchers

Forks