# GPU Link

A Mac menu bar chip and floating pill that show whether you are connected to a rented Vast.ai GPU, for how long and at what cost, with a one-click disconnect that verifies the instance is really gone.

**Status:** Live · Projects · 2026

- **Local checkout:** `/Users/simon/Developer/gpu-link` (branch `main`, last commit f618edf, 2026-11-04 — README)
- **Where it runs:** local macOS app (no cluster deployment)
- **Note:** Local app · tested with no instance rented

## Stack

Swift/AppKit/SwiftUI, vastai CLI, vast-tunnel (SSH tunnel script), Thaw (menu bar manager)

## Start here

- `Sources/GPULink/Vast.swift` — wraps the vastai CLI (instances, credit, destroy, stop) and the tunnel check on 127.0.0.1:8000
- `Sources/GPULink/Model.swift` — 30 s polling, state (unknown/none/connecting/connected), alerts, destroy-then-verify
- `Sources/GPULink/App.swift` — NSStatusItem chip icon + popover, floating pill panel, MenuView controls
- `build.sh` — builds and installs ~/Applications/GPU Link.app (ad-hoc signed, LSUIElement)

## Commands

- **Build and install:** `./build.sh`
- **Launch:** `open -g ~/Applications/GPU\ Link.app`

## Deploy and where it runs

- Local Mac app only: installed at ~/Applications/GPU Link.app. Nothing runs on the cluster and there is no GitHub remote.

## Current state

Built Nov 4, 2026. Verified with no instance rented: chip visible in the menu bar, pill shows 'No GPU', popover shows $10.23 credit. Not yet tested against a real running instance: the green/orange states, the timer, and the destroy-and-verify flow (destroy deletes the instance disk, so test on a throwaway box).

## Watch out

- SwiftUI MenuBarExtra never drew an item on this Mac (macOS 26.6); the app uses an AppKit NSStatusItem instead. Do not switch back.
- The 14-inch notch hides crowded menu bar icons, so there is also a draggable floating pill. Both can be turned off in the popover but never both at once.
- Menu bar manager is Thaw (brew cask thaw). Ice 0.11.12 crashes on macOS 26 (NSStatusBarWindow). New icons land in Thaw's Hidden section until dragged into the visible one.
- The purple dot or pill near the clock is macOS's screen-recording indicator (screenshots by agents, Thaw's capture service); GPU Link never records the screen.
- Disconnect = vastai destroy instance (billing stops, disk deleted). Stop only pauses and storage still bills. Success is reported only after the instance is gone from vastai show instances.
- vast-tunnel finds the box by label qwen38-uncensored; GPU Link stops it on disconnect.

## Secrets — locations only, never print values

- Vast API key: ~/.config/vastai/vast_api_key (read by the vastai CLI, never by the app).

## Tags

macOS, Vast.ai, Menu bar, Swift

---

Brief generated 2026-11-08 from `~/Developer/my-projects/context/`. Canonical URL: https://projects.navonsimon.com/context/gpu-link.md
