Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A chat app with iOS 26 Foundation Models
| Date | Stars |
|---|---|
| 2026-07-31 | 345 |
| 2026-08-06 | 345 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# FoundationChat
A SwiftUI chat application built with Apple's Foundation Models framework, showcasing on-device AI capabilities with persistent conversation storage.

## Requirements
- **iOS 26.0+** / iPadOS 26.0+ / macOS 26.0+ / visionOS 26.0+
- **Xcode 26.0+** (with iOS 26 SDK)
- Device with Apple Intelligence support
- Apple Intelligence must be enabled in Settings
## Features
- ✅ **Multiple Conversations**: Create and manage multiple chat conversations
- ✅ **Persistent Storage**: SwiftData integration for conversation history
- ✅ **Real-time Streaming**: Live streaming responses with structured output
- ✅ **Smart Summaries**: Automatic conversation summarization
- ✅ **Tool Integration**: Web page analysis with metadata extraction
- ✅ **Rich Message Display**: Support for attachments with thumbnails and descriptions
- ✅ **Availability Checking**: Proper Foundation Models availability handling
- ✅ **Modern SwiftUI**: Clean interface with navigation stack and swipe actions
- ✅ **On-device AI**: No internet required, complete privacy
- ✅ **Error Handling**: Graceful error display in the UI
## Architecture
### Core Components
- **`ChatEngine`**: Manages Foundation Models sessions and streaming responses
- **`Conversation`** & **`Message`**: SwiftData models for persistent storage
- **`MessageGenerable`**: @Generable struct for structured AI responses with web metadata
- **`ConversationsListView`**: Main interface for managing conversations
- **`ConversationDetailView`**: Chat interface with streaming message support
- **`WebAnalyserTool`**: Tool for extracting structured data from web pages
### Data Flow
1. **Conversations List**: Shows all conversations sorted by last message timestamp
2. **Chat Interface**: Real-time streaming with SwiftData persistence
3. **Message Streaming**: Uses `@Generable` for structured AI responses
4. **Auto-Summarization**: Updates conversation summaries after each exchange
## Getting Started
1. Open `FoundationChat.xcodeproj` in Xcode
2. Ensure your development device has Apple Intelligence enabled
3. Build and run on a supported device (simulator not recommended for performance)
4. Create a new conversation with the "+" button
5. Start chatting with the on-device AI
## Key Implementation Details
### Foundation Models Integration
```swift
@Observable
class ChatEngine {
private let model = SystemLanguageModel.default
private let session: LanguageModelSession
var isAvailable: Bool {
switch model.availability {
case .available: return true
default: return false
}
}
}
```
### Structured Streaming Response
```swift
func respondTo() async -> LanguageModelSession.ResponseStream<MessageGenerable>? {
session.streamResponse(generating: MessageGenerable.self) {
// Conversation context with full history
}
}
```
### Tool Integration
```swift
struct WebAnalyserTool: Tool {
let name = "WebAnalyser"
let description = "Analyse a website and return structured content"
func call(arguments: Arguments) async throws -> ToolOutput {
// Extracts title, thumbnail, and description
}
}
```
### SwiftData Persistence
```swift
@Model
class Conversation {
@Relationship(deleteRule: .cascade)
var messages: [Message]
var summary: String?
}
```
## Documentation
- **[CLAUDE.md](CLAUDE.md)** - Development guidelines and framework overview
- **[Examples](EXAMPLES/)** - Comprehensive implementation examples:
- Basic Usage
- Structured Output
- Streaming Responses
- Tool Calling
- Performance & Safety
- Complete Chat App
## Project Structure
```
FoundationChat/
├── Models/
│ ├── SwiftData/ # Data persistence models
│ └── Generable/ # Foundation Models structures
├── Views/
│ ├── ConversationsList/ # Main conversation list
│ └── ConversationDetail/ # Chat interface with message views
├── Tools/
│ └── WebAnalyserTool.swift # Web content extrExcerpt of 4,479 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:8bb4703957171ae2, topic:foundation-models