Skip to content
Adarsh-AravindPublic

About

Voice and text AI desktop assistant in a floating glass overlay (Alt+Space). Streams replies and runs local tools for apps, files, browser and media, confirming risky actions first. Electron, React, FastAPI; Groq or Ollama.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

Repository files navigation

TARS

A voice-and-text AI desktop assistant that lives in a small glass bar floating over your screen. Press Alt + Space (or say "TARS"), ask for something, and it answers in a streamed reply or takes action on your computer: opening apps and websites, managing files, controlling media and volume, searching the web or driving a browser. It runs on Windows and macOS, with an Electron overlay and a local FastAPI backend.

The personality is modelled on TARS from Interstellar, complete with adjustable humour, honesty and verbosity settings ("TARS, humour 60 percent").

TARS is a shared repo among friends, built to learn by building together.

What it looks like

A compact 750 × 68 px glass pill with no window chrome. When TARS replies, the window grows downward to show the response.

┌─────────────────────────────────────────────────────────────────────────────┐
│  ● SYS.READY  │  Awaiting automation query or terminal sequence...  │ 🎙️    │
└─────────────────────────────────────────────────────────────────────────────┘
  • Left: status light and label
  • Centre: the command input
  • Right: microphone and backend connection indicator

Features

  • Streaming replies: tokens stream from the backend over Server-Sent Events and render as they arrive
  • Tool calling: the model can use 21 local tools, including launch_app, open_website, web_search, fetch_page, read_file / write_file / move_file / delete_file / find_files, set_volume, media_control, clipboard, notify, system_info, power_control, run_shell and browser automation (browser_open, browser_click, browser_type, browser_read) through Playwright
  • Confirmation for risky actions: anything destructive, such as deleting files, running shell commands or power actions, asks you to confirm before it runs
  • Choice of LLM: Groq, Ollama (fully local), OpenAI or Gemini, set in Backend/.env
  • Local speech recognition: faster-whisper runs on your machine for the mic button and the "TARS" wake word, so no audio leaves your computer
  • TARS voice: spoken replies are synthesised with Kokoro and processed with audio effects to sound like the film's robot
  • Adjustable personality: humour, honesty and verbosity are saved between sessions and can be changed by asking
  • Native glass look: Windows 11 Acrylic and macOS vibrancy, with a system tray icon instead of a taskbar entry
  • Shared inference: friends can point their own TARS at one person's Ollama over Tailscale (see below)

Quick start

Requirements: Python 3.10+, Node.js 18+, about 4 GB of free RAM and 2 GB of disk, plus either a Groq API key or a local Ollama install.

Windows: double-click tars.bat.

macOS / Linux:

chmod +x tars.command   # first time only
./tars.command

The launcher creates a virtual environment, installs the Python and npm dependencies, downloads Chromium for browser automation, builds the overlay, starts the backend and opens TARS. The first run takes a few minutes; after that it starts in seconds. Then set your LLM provider in Backend/.env, which is created on the first run.

See SETUP.md for launcher flags, LLM configuration, macOS permissions, packaging and troubleshooting.

Running the parts manually

# Backend (http://127.0.0.1:8000, loopback only because it can run local commands)
cd Backend
python -m venv ../.venv
../.venv/bin/pip install -r requirements.txt   # Windows: ..\.venv\Scripts\pip
./start_server.sh                               # Windows: start_server.bat

# Overlay
cd frontend
npm install
npm run electron

Production builds: npm run dist:win or npm run dist:mac in frontend/.

Architecture

TARS/
├── tars.bat / tars.command   Platform entry points, both run scripts/launch.py
├── frontend/
│   ├── electron/
│   │   ├── main.cjs          Window, global shortcut, tray, backend auto-start
│   │   └── preload.cjs       Context bridge for safe IPC
│   └── src/
│       ├── App.jsx           Overlay UI, talks to the backend over fetch and SSE
│       └── components/       Command panel, voice island, audio visualiser
└── Backend/
    ├── Main.py               FastAPI entry point
    ├── api/                  Chat streaming, audio and v1 REST / WebSocket routes
    ├── middleware/           Error handling and rate limiting
    ├── db/                   Conversation storage
    └── services/
        ├── llm.py            Multi-provider LLM client and tool-calling loop
        ├── personality.py    Humour, honesty and verbosity settings
        ├── confirm.py        Confirmation flow for risky tool calls
        ├── voice.py          Wake-word listener
        ├── transcription.py  faster-whisper speech-to-text
        ├── tars_voice.py     Kokoro TTS with the TARS voice effect
        └── tools/            Tool registry, risk policy and tool implementations

Shared Ollama (host PC ↔ friend's Mac)

Everyone runs their own full TARS stack locally, so TARS controls their machine (apps, volume, voice on their mic). Only the LLM inference is shared — one person hosts Ollama, everyone else points their backend at it. This works identically whether you're on the same Wi-Fi or in different cities, thanks to Tailscale (a zero-config private mesh VPN — each device gets a stable 100.x.y.z IP, encrypted, no port-forwarding).

On the host (the PC running Ollama):

  1. Install Tailscale on both machines and log into the same tailnet.
  2. Start Ollama bound to all interfaces so the tailnet can reach it (by default it only listens on 127.0.0.1):
    # Windows (PowerShell) — set the service env var, then restart Ollama
    setx OLLAMA_HOST "0.0.0.0:11434"
    # then quit Ollama from the tray and relaunch it
    # macOS / Linux
    launchctl setenv OLLAMA_HOST "0.0.0.0:11434"   # macOS; or export before `ollama serve`
  3. Find the host's Tailscale IP: tailscale ip -4 (e.g. 100.101.102.103).

⚠️ Ollama has no authentication. Only expose it over Tailscale (or your LAN) — never a public tunnel/port-forward, or anyone can drive your GPU.

On the friend's Mac — copy Backend/.env.example to Backend/.env and set:

OLLAMA_BASE_URL=http://100.101.102.103:11434   # the host's Tailscale IP

That's it — the Mac's backend now runs inference on the host's Ollama while everything else stays local. On the same LAN you can substitute the host's local IP (e.g. 192.168.1.20) instead of the Tailscale one.


IPC Event Reference

Channel Direction Payload Description
tars:dispatch renderer → main string User-submitted command query
tars:hide renderer → main — Request to hide the overlay window
tars:resize-window renderer → main integer Resizes the transparent shell
tars:show main → renderer — Overlay shown — re-focus input
tars:status main → renderer string (key) Status key: IDLE RUNNING DONE ERROR
tars:reply-chunk main → renderer string A live text token from the LLM
tars:reply-end main → renderer — Marks the end of a response stream

Keyboard Shortcuts

Key Action
Alt+Space Global toggle: Show/Hide TARS from anywhere
Enter Dispatch command to backend
Escape Clear input, hide reply box, and hide overlay
↑ / ↓ Cycle command history (last 50)
Ctrl+L / Cmd+L Clear input field and dismiss reply box

Contributing

This is a shared learning repo. PRs, experiments, and half-baked ideas are all welcome.
Open an issue or push a branch — we figure it out together.

About

Voice and text AI desktop assistant in a floating glass overlay (Alt+Space). Streams replies and runs local tools for apps, files, browser and media, confirming risky actions first. Electron, React, FastAPI; Groq or Ollama.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages