LOCUStechnical wiki

How it works

The pieces, the ports, where the data lives, what leaves the computer

The pieces

The app on your phone

The Locus app for iPhone or Android pairs with your computer and keeps two things for it: a device key and the fingerprint of the computer's certificate. The chat itself is a page served by your computer, which the app shows in a web view; the app calls a few things itself (pairing, the computer's state, the devices, copying folders to the computer).

Locus on the computer

One program, started by the LM Studio plugin each time LM Studio starts, and kept running by a small watchdog. It has an engine, which serves the chat page, the chats, the models, the uploads and the /v1 address; an admin port for the locus command and the plugin; and, on Windows and macOS, the QR page that shows the activation and pairing codes on the computer's own screen.

The tunnel and the relay

Your computer gets a Locus address of its own when you activate it. A tunnel program (newt, downloaded from its official release and checked against a fingerprint built into the plugin) connects from your computer to our relay server, and the relay passes your phone's connection through it to the engine. Nothing on your computer listens on the internet: the tunnel is the only way in, and it reaches only the engine.

The activation service

At activation, the app sends the store's proof of purchase and the computer's name to our activation service; you confirm on the computer with a 6-digit code; the computer then collects its own tunnel login there. Later the computer asks it whether the subscription is still active. No chat, file or model ever goes there.

The AI tools

LM Studio, Ollama, llama.cpp, KoboldCpp, Jan, Strata or any OpenAI-compatible server: each chat has its own, on this computer (or at the home-network address you gave), and new chats get the computer's default. Two of them, llama.cpp and KoboldCpp, Locus can also find, start and stop itself. See AI tools in depth.

The voice (Windows, optional)

Installed with locus voice get, a small voice runner on the computer turns an answer into speech when you tap Listen, or by itself for a message you spoke. The phone only plays the sound. See Security model.

A message, step by step

  1. You send a message in the app. It goes over HTTPS to your computer's Locus address.
  2. The relay passes the encrypted bytes on through the tunnel. On Windows the encryption ends on your computer: it serves its own certificate, and the app accepts only the one whose fingerprint it got when it paired.
  3. Locus checks the device key, keeps the message with the chat on the computer, and asks the chat's AI tool, on 127.0.0.1.
  4. The answer comes back the same way, shown as it is written, and is stored with the chat.

Ports on the computer

Everything Locus listens on is bound to 127.0.0.1: reachable from this computer only.

PortWhat
8744Locus's engine: the chat page, the chats, the models, /v1. The tunnel's only target.
8745The admin port, for the locus command and the plugin. Never reached by the tunnel; needs a token only your user can read.
8765The QR page, http://127.0.0.1:8765/pair (Windows; on macOS, or the next free port). Linux has none: locus pair prints the QR in the terminal.
1234LM Studio's server (LM Studio's own). On Windows, when it does not answer, Locus tries to start it.
11434Ollama (Ollama's own).
18080llama.cpp when Locus starts it (change it with locus manage llamacpp --port).
15001KoboldCpp when Locus starts it (locus manage koboldcpp --port).
8080, 9931, 5001, 1337Where Locus looks for tools you start yourself: llama.cpp's server (8080, 9931), KoboldCpp (5001), Jan (1337). Locus never starts or stops those.

Locus starts llama.cpp and KoboldCpp on 127.0.0.1 only, with a new key (llama.cpp) or password (KoboldCpp) at each start: other programs on the computer can reach them while they run, but not without that key.

Where the data lives

Windows

FolderWhat is in it
%LOCALAPPDATA%\Locus\runThe program, settings.json, locus.cmd, and the logs folder
%LOCALAPPDATA%\Locus\dataYour chats (the chats folder; a chat's pictures are kept beside it and deleted with it), the list of shared folders, project_notes.md if you make one, and Locus's own models folder, models, with its list locus-models.json; the voice, in voice, if you installed it
%LOCALAPPDATA%\Locus\secretsThe keys: the master key, the admin token, the device list (device keys are kept only as a SHA-256), the computer's certificate, the tunnel login and the Brave Search key if you saved one (both sealed with Windows' DPAPI). Only your user may open it.
%USERPROFILE%\Locus-uploadsThe folders copied from your phone
%LOCALAPPDATA%\Locus\python, …\newtThe Python and the tunnel program the first install downloaded

Models are large and the default models folder is on C:. Move it with locus manage llamacpp --models D:\Locus-models, then locus restart. Models downloaded for LM Studio or Ollama go to their own folders, never to Locus's.

Uninstalling keeps your chats and the Locus-uploads folder; uninstall.cmd /purge deletes them too.

macOS (preview)

Everything is in ~/Library/Application Support/Locus: the program, your chats (data) and the keys, which are files only your user can read, in a folder only your user can open (an administrator of the Mac can still read them). The locus command is in ~/.local/bin. Copying folders from the phone is off on macOS for now.

Linux (preview)

~/.local/share/locus (the program, settings in run/settings.json, your chats in data), ~/.config/locus (the keys in secrets: plain files readable by your user only; the machine's administrator, root, can read them, and on a rented server that includes the provider), and the command in ~/.local/bin. Nothing runs with sudo. Copying folders from the phone is off.

Logs

On Windows, in %LOCALAPPDATA%\Locus\run\logs: main.log, keepalive.log, newt.log, and the output of the tools Locus starts, llamacpp.log and koboldcpp.log; the engine's own log is gate.log in the data folder. Logs stay on the computer. They record, for example, the IP address of each connection and, for the web pages the model opens, only the host.

What leaves the computer

On the macOS and Linux previews, the HTTPS encryption still ends on the relay server today; end-to-end encryption there is planned.