Skip to content
Dhruvie.
All work

MacPet: Desktop Companion & AI Assistant

A native macOS desktop companion that doubles as an AI assistant, chatting through local models or cloud AI APIs with a simple setup.

MacPet illustration
Client & domain
Personal project
Native macOS application
My role
Creator
Year
2026
Status
Personal use

01 / Overview

What it is

MacPet puts Mochi, an animated little robot, on the macOS desktop. It walks along the Dock, hops onto windows, naps, and reacts when you pet or throw it. Press ⌃⌥C and it becomes a chat assistant that can talk to a local model through Ollama or to cloud models through their APIs, with replies streamed into the chat as they arrive. I built it for my own use.

Demo

In action

MacPet
Native macOS walkthrough: Mochi moves from the Dock to a window, opens chat, streams a reply, switches models, and takes a nap. The recording uses a staged reply and model choices for the demo.
  1. 0:00Mochi idles and walks along the Dock
  2. 0:05Hops onto a window and reacts to a click
  3. 0:10Opens chat with ⌃⌥C and streams a Swift explanation
  4. 0:27Assistant menu shows model choices; switches to gemma3:4b
  5. 0:34Take a Nap puts Mochi to sleep on the window

02 / Purpose

A friendlier way to reach an AI model

I wanted an assistant that is always one shortcut away and not tied to a single provider:

  • Switch between a free local model and cloud models without changing apps
  • Keep API keys stored securely on the machine
  • Stay light enough to run all day in the background

03 / My role

Role and contributions

Scope
Design and development
  • Designed and built the app end to end, including the robot character, the chat, and the provider integrations.

04 / Technical approach

Native, lightweight, provider-agnostic

Any model, one interface
Streaming clients cover Ollama for local models, OpenAI-compatible cloud APIs (such as Groq, Gemini, OpenRouter, and Cerebras), and Claude, selectable from a menu.
Keys in the Keychain
API keys are stored in the macOS login Keychain, and cloud model lists are fetched live from each provider.
Drawn in code
The robot is drawn with Core Graphics in Swift and AppKit, with no web view and no special macOS permissions needed.
Adaptive frame rate
The main loop moves between 15, 30, and 60 Hz depending on activity to keep background resource use low.

05 / Technologies

Stack

  • Swift
  • AppKit
  • Core Graphics
  • LLM APIs (Claude, OpenAI-compatible)
  • Ollama

06 / Challenges

Engineering considerations

  • Supporting several AI providers with different APIs behind one streaming chat interface.
  • Animating the robot smoothly while keeping background CPU use low.
  • Integrating with the Dock, windows, and the macOS event loop without special permissions.

07 / Outcome

Where it stands

  • In daily personal use.

08 / Related work

Keep exploring

Let’s work together.