Back to projects

macOS / SwiftUI / Core AI

CoreAIChat

CoreAIChat demonstrates a local macOS chat app backed by an exported Core AI language model. It combines SwiftUI, Core AI language model resources, and Foundation Models sessions into a compact proof of concept.

SwiftUImacOS 27Core AIGemma 3Local AI

Purpose

What it is for

The project is meant as a hands-on reference for running a converted language model locally in a macOS app. It focuses on the setup path from model export to Xcode integration, then on the smallest app loop needed to load the model and generate a response.

Behavior

What it does

The app loads an exported Gemma 3 model from the app bundle.
It creates a CoreAILanguageModel from local resources and uses LanguageModelSession for prompting.
The README documents the model export workflow with Apple’s coreai-models tools, uv, and Hugging Face authentication.
The project currently relies on beta Apple tools and frameworks, so APIs and setup details may change.

Implementation

How it is built

The exported model directory is added to Xcode as a resource folder.

The expected model package contains an .aimodel bundle, metadata.json, and tokenizer assets.

Runtime code resolves the bundled model URL, initializes CoreAILanguageModel, creates a Foundation Models session, and sends prompts through that session.

The implementation is intentionally minimal so the model packaging and loading flow stays easy to inspect.