opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

iOS GenAI Sampler: hands-on examples for text, vision, and local LLMs on device
GitHub RepoImpressions2

Project Description

View on GitHub

Hands On with iOS GenAI Sampler: Text, Vision, and Local LLMs on Device

If you've been wanting to experiment with generative AI on iOS but didn't want to wade through Apple's documentation or build everything from scratch, this repo is for you. iOS GenAI Sampler is a collection of hands on examples that cover text generation, image analysis, and running small LLMs locally on device — all using the latest iOS frameworks.

No cloud calls, no API keys. Just Swift, Core ML, and the Neural Engine doing the heavy lifting right on your iPhone or iPad.

What It Does

The sampler gives you ready to run SwiftUI projects that demonstrate:

  • Text generation using local models (think GPT style completions on device)
  • Vision tasks like image captioning, object detection, and style transfer
  • Local LLM inference with small models that fit in memory and run on the Neural Engine

Each example is a self contained Xcode project with minimal dependencies. You can open it, build it, and see the AI results immediately.

Why It’s Cool

The main draw here is that everything runs on device. No network requests, no privacy concerns, no latency from cloud calls. Apple's Neural Engine is surprisingly capable for small models, and this repo shows you exactly how to tap into it.

A few standout features:

  • Real world code — each example is a full SwiftUI app, not just a snippet
  • Covers multiple frameworks — Core ML, Natural Language, Vision, and the new MLX framework for LLMs
  • Compare models side by side — you can swap models and see results instantly
  • Works on iPhone and iPad — no Mac needed to run the demos

The code is clean and follows Apple's best practices. It's the kind of project that would take you days to piece together from documentation, but here it's ready in minutes.

How to Try It

  1. Clone the repo:
    git clone https://github.com/shu223/iOS-GenAI-Sampler.git

  2. Open the iOSGenAISampler.xcodeproj file in Xcode 15 or later.

  3. Select your device or a simulator (note: some LLM models require a physical device with Neural Engine support).

  4. Build and run. The app will show a list of demos. Tap on any one to try it.

  5. For the LLM examples, you'll need to download model files separately. Instructions are in the repo's README.

That's it. No CocoaPods, no SPM packages for the core demos. Just Xcode and a Swift file.

Final Thoughts

This is a great resource for iOS developers who want to get their hands dirty with on device AI without the usual friction. The examples are practical — you can adapt them directly into your own apps, or just use them to understand how Apple's AI frameworks work together.

If you've been curious about running LLMs locally but thought it required too much setup, this sampler will change your mind. It's not production ready for large models, but for small tasks like autocomplete, captioning, or summarization, it's surprisingly fast and private.

Give it a try and see what your iPhone can do without ever hitting the network.


Follow @githubprojects for more developer tools and open source finds.

Back to Projects
Project ID: 1cb2d6f7-9500-46d3-b136-5f42429dd2d9Last updated: June 30, 2026 at 02:43 AM