04c9b8da1ec4c53be44759fb869690efae214f12
oAI
A native macOS AI chat application with support for multiple providers and advanced features.
Features
Multi-Provider Support
- OpenAI - GPT models with native API support
- Anthropic - Claude models with OAuth integration
- OpenRouter - Access to 100+ AI models
- Ollama - Local model inference
Core Capabilities
- Streaming Responses - Real-time token streaming for faster interactions
- Conversation Management - Save, load, and delete chat conversations
- File Attachments - Support for text files, images, and PDFs
- Image Generation - Create images with supported models
- Online Mode - Web search integration for up-to-date information
- Session Statistics - Track token usage and costs
- Model Context Protocol (MCP) - Filesystem access for AI models with configurable permissions
UI/UX
- Native macOS interface with dark mode support
- Markdown rendering with syntax highlighting
- Command history navigation
- Model selector with detailed information
- Footer stats display (tokens, cost, response time)
Installation
- Clone this repository
- Open
oAI.xcodeprojin Xcode - Build and run (⌘R)
Configuration
API Keys
Add your API keys in Settings (⌘,):
- OpenAI API key
- Anthropic API key (or use OAuth)
- OpenRouter API key
- Ollama base URL (default: http://localhost:11434)
Settings
- Provider - Select default AI provider
- Streaming - Enable/disable response streaming
- Memory - Control conversation context (on/off)
- Online Mode - Enable web search integration
- Max Tokens - Set maximum response length
- Temperature - Control response randomness
Slash Commands
Model & Chat
/help- Show help and available commands/model- Open model selector (⌘M)/clear- Clear current conversation/retry- Regenerate last response/info [model]- Display model information
Conversation Management
/save <name>- Save current conversation/loador/list- List and load saved conversations/delete <name>- Delete a saved conversation/export <md|json> [filename]- Export conversation
Provider & Settings
/provider [name]- Switch or display current provider/configor/settings- Open settings (⌘,)/stats- View session statistics/credits- Check API credits/balance
Features
/memory <on|off>- Toggle conversation memory/online <on|off>- Toggle online/web search mode/mcp <on|off|status|add|remove|list>- Manage MCP filesystem access
MCP (Model Context Protocol)
/mcp add <path>- Grant AI access to a folder/mcp remove <index|path>- Revoke folder access/mcp list- Show allowed folders/mcp write <on|off>- Enable/disable file write permissions/mcp status- Display MCP configuration
File Attachments
Attach files to your messages using the syntax: @/path/to/file
Example:
Can you review this code? @~/project/main.swift
Supported formats:
- Text files - Any UTF-8 text file (.txt, .md, .swift, .py, etc.)
- Images - PNG, JPG, WebP (for vision-capable models)
- PDFs - Document analysis with vision models
Limits:
- Maximum file size: 10 MB
- Text files truncated after 50 KB (head + tail shown)
Keyboard Shortcuts
⌘M- Open model selector⌘,- Open settings⌘N- New conversation↑/↓- Navigate command history
Development
Project Structure
oAI/
├── Models/ # Data models (Message, Conversation, Settings)
├── Views/ # SwiftUI views
│ ├── Main/ # Chat, header, footer, input
│ └── Screens/ # Settings, stats, model selector
├── ViewModels/ # ChatViewModel
├── Providers/ # AI provider implementations
├── Services/ # Database, MCP, web search, settings
└── Utilities/ # Extensions, logging, syntax highlighting
Key Components
- ChatViewModel - Main state management and message handling
- ProviderRegistry - Provider selection and initialization
- AIProvider Protocol - Common interface for all AI providers
- MCPService - Filesystem tool integration
- DatabaseService - Conversation persistence
- WebSearchService - Online search integration
Requirements
- macOS 14.0+
- Xcode 15.0+
- Swift 5.9+
License
MIT License - See LICENSE for details.
Author
Rune Olsen
Contributing
- Fork the repository
- Create a feature branch
- Submit a pull request
⭐ Star this project if you find it useful!
Description
oAI is a native macOS AI chat application built with SwiftUI. It connects to multiple AI providers, supports persistent conversations, and includes a broad set of power-user features — all packaged in a clean, keyboard-driven interface.
https://mac.oai.pm/
Releases
2
New settings layout
Latest
Languages
Swift
91.7%
HTML
7.6%
CSS
0.7%