Xcode treats a `.llmasset` bundle as individual `.aimodel` files to compile, instead of copying it as-is

I have a Core AI model export — a bundle folder (.llmasset, containing multiple .aimodel subfolders plus metadata/tokenizer resources) — added to my app target as a folder reference.

Rather than treating the bundle as one opaque resource and copying it into the app bundle as-is (the way .xcassets, .bundle, or any other folder reference behaves), Xcode reaches into it, finds the individual .aimodel subfolders, and adds each one to Compile Sources. When it compiles them there, it's for my build machine's specific chip only — I can't find any setting (Build Settings, scheme, target picker) to compile for multiple architectures/platforms, the way a universal binary would work.

Question:

Is there a way to make Xcode treat a .llmasset bundle as an atomic resource — copied wholesale, not decomposed into individual .aimodel compile targets? Or is reaching into the bundle and AOT-compiling its components for the active build architecture the intended behavior here, and if so, what's the recommended way to make sure the result works across the actual range of devices the app ships to?

There is a quick fix that should be able to help you with this:

  • In the Xcode File Inspector panel (⌘-⌥-1), there is an option called "Build Rules" whose default selected option is "Apply to Each File." If you change it instead to "Apply Once to Folder," the directory as a whole will be copied into your product bundle.

In the future, it might be more convenient to change (or amend) the .llmasset extension with a .package extension, which would hint to Finder, Xcode, and other applications to not treat this as a directory, but as a slightly more opaque package.

If you have any further feedback on this experience, please head over to Feedback Assistant and provide a link to this thread :)

DH

Xcode treats a `.llmasset` bundle as individual `.aimodel` files to compile, instead of copying it as-is
 
 
Q