How kevinhermawan/ollamac works
Ollamac is a native macOS chat client for a locally available Ollama server. Users select or create a chat, choose a model, submit prompts, and receive streamed responses; chats and messages are represented in SwiftData. Settings and per-chat preferences configure the Ollama host and system prompt, while assistant-message rendering supports Markdown and optional syntax highlighting. The graph follows relationships shown in excerpts and the SOURCE INDEX; unsampled implementations are represented only where their paths and connections are documented there.
Main entry points: ChatView.swift Chat screen · MessageViewModel.swift Message generation · SidebarView.swift Chat sidebar · ChatViewModel.swift Chat management
Components 22
App and Navigation
- App bootstrap
Ollamac/App/OllamacApp.swift - App shell
Ollamac/Views/AppView.swift - Chat sidebar
Ollamac/Views/Sidebar/SidebarView.swift - Sidebar item
Ollamac/Views/Sidebar/SidebarListItemView.swift - Sidebar actions
Ollamac/Views/Sidebar/SidebarContextMenu.swift
Chat and Ollama
- Chat screen
Ollamac/Views/Chats/ChatView.swift - Chat management
Ollamac/ViewModels/ChatViewModel.swift - Message generation
Ollamac/ViewModels/MessageViewModel.swift - Ollama server
- Chat record
Ollamac/Models/Chat.swift - Message record
Ollamac/Models/Message.swift
Preferences
- Chat preferences
Ollamac/Views/Chats/ChatPreferencesView.swift - Host editor
Ollamac/Sheets/UpdateOllamaHostSheet.swift - System prompt editor
Ollamac/Sheets/UpdateSystemPromptSheet.swift - Settings hub
Ollamac/Views/Settings/SettingsView.swift - General settings
Ollamac/Views/Settings/GeneralView.swift - Experimental settings
Ollamac/Views/Settings/ExperimentalView.swift
Message Rendering
- Assistant message
Ollamac/Views/Chats/Subviews/AssistantMessageView.swift - User message
Ollamac/Views/Chats/Subviews/UserMessageView.swift - Code block
Ollamac/Utils/CodeBlockView.swift - Syntax highlighter
Ollamac/Utils/CodeHighlighter.swift
Other components
- Mac user
Connections 34
- Mac user → App shell: uses
Ollamac/Views/AppView.swift - App bootstrap → App shell: presents
Ollamac/App/OllamacApp.swift - App bootstrap → Chat management: initializes
Ollamac/App/OllamacApp.swift - App bootstrap → Message generation: initializes
Ollamac/App/OllamacApp.swift - App bootstrap → Syntax highlighter: initializes
Ollamac/App/OllamacApp.swift - App shell → Chat sidebar: shows
Ollamac/Views/AppView.swift - App shell → Chat screen: shows
Ollamac/Views/AppView.swift - Chat sidebar → Chat management: uses
Ollamac/Views/Sidebar/SidebarView.swift - Chat sidebar → Message generation: uses
Ollamac/Views/Sidebar/SidebarView.swift - Chat sidebar → Sidebar item: renders
Ollamac/Views/Sidebar/SidebarView.swift - Chat sidebar → Sidebar actions: uses
Ollamac/Views/Sidebar/SidebarView.swift - Sidebar actions → Chat management: updates
Ollamac/Views/Sidebar/SidebarContextMenu.swift - Chat screen → Chat management: uses
Ollamac/Views/Chats/ChatView.swift - Chat screen → Message generation: uses
Ollamac/Views/Chats/ChatView.swift - Chat screen → Chat preferences: presents
Ollamac/Views/Chats/ChatView.swift - Chat screen → User message: renders
Ollamac/Views/Chats/ChatView.swift - Chat screen → Assistant message: renders
Ollamac/Views/Chats/ChatView.swift - Chat management → Chat record: manages
Ollamac/ViewModels/ChatViewModel.swift - Message generation → Message record: loads and saves
Ollamac/ViewModels/MessageViewModel.swift - Message generation → Chat record: updates
Ollamac/ViewModels/MessageViewModel.swift - Message record → Chat record: belongs to
Ollamac/Models/Message.swift - Chat screen → Ollama server: fetches models
Ollamac/Views/Chats/ChatView.swift - Message generation → Ollama server: streams chat
Ollamac/ViewModels/MessageViewModel.swift - Chat preferences → Host editor: opens
Ollamac/Views/Chats/ChatPreferencesView.swift - Chat preferences → System prompt editor: opens
Ollamac/Views/Chats/ChatPreferencesView.swift - Settings hub → General settings: shows
Ollamac/Views/Settings/SettingsView.swift - Settings hub → Experimental settings: shows
Ollamac/Views/Settings/SettingsView.swift - General settings → Host editor: opens
Ollamac/Views/Settings/GeneralView.swift - General settings → System prompt editor: opens
Ollamac/Views/Settings/GeneralView.swift - Host editor → Ollama server: checks reachability
Ollamac/Sheets/UpdateOllamaHostSheet.swift - Assistant message → Syntax highlighter: uses
Ollamac/Views/Chats/Subviews/AssistantMessageView.swift - Assistant message → Code block: renders
- Code block → Syntax highlighter: reads state
Ollamac/Utils/CodeBlockView.swift - User message → Assistant message: shares message controls