- Rust 96.4%
- Shell 2.1%
- Dockerfile 0.6%
- Java 0.5%
- Python 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .cargo | ||
| .githooks | ||
| .woodpecker | ||
| android | ||
| ci/builder | ||
| crates | ||
| deploy | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.satellite | ||
| PLAN.md | ||
| README.md | ||
| rust-toolchain.toml | ||
AIThingy
An end-to-end encrypted chat client for OpenAI-compatible providers, in the spirit of Claude Desktop's chat. Rust, deltaui, for web, desktop and Android. See PLAN.md.
Status
| Crate | State |
|---|---|
crates/core |
Done: keys, seed phrase, pairing, signed encrypted events, shared-chat keys, OpenAI wire types + SSE |
crates/server |
Done: OIDC login, devices, chat log, key bundles, objects, blobs, live stream, LLM proxy |
crates/client |
Done: API client, encrypted local store, sync + offline outbox, sharing, search, account setup/pairing, LLM streaming + tools, MCP client |
crates/ui, crates/desktop, crates/web, crates/android |
Working, see PLAN.md for what is still open |
| mcp bridge | Not started |
Server
AITHINGY_PUBLIC_URL=http://127.0.0.1:8085 \
AITHINGY_OIDC_ISSUER=https://id.example.com \
AITHINGY_OIDC_CLIENT_ID=... AITHINGY_OIDC_CLIENT_SECRET=... \
cargo run -p aithingy-server
| Variable | Default | |
|---|---|---|
AITHINGY_PUBLIC_URL |
http://127.0.0.1:8085 |
Base URL; the OIDC redirect is <url>/auth/callback |
AITHINGY_OIDC_ISSUER, _CLIENT_ID, _CLIENT_SECRET |
none | PocketID. Without them nobody can sign in |
AITHINGY_BIND |
0.0.0.0:8085 |
|
AITHINGY_DATA_DIR |
./data |
SQLite DB, blobs, generated jwt.key |
AITHINGY_DATABASE_URL |
sqlite://<data>/aithingy.db |
|
AITHINGY_JWT_SECRET |
generated | |
AITHINGY_WEB_DIR |
none | Built web app, served with SPA fallback |
AITHINGY_BLOB_MAX_BYTES |
50 MiB | |
AITHINGY_USER_QUOTA_BYTES |
5 GiB | All files one account may store |
AITHINGY_TRUST_PROXY |
off | Set to 1 behind a reverse proxy: rate limits then use X-Forwarded-For |
AITHINGY_PROXY_HOSTS |
none | Allow-list for the optional LLM proxy. A provider used through it shows the server the prompts and the API key |
Restrict who may sign in with PocketID's per-client group setting; the server accepts every user the identity provider authenticates.
Desktop
cargo build --release -p aithingy-desktop builds the app. A release build keeps its keys and
chats in <data dir>/aithingy with the keyring entry aithingy; a debug build (cargo run -p aithingy-desktop) uses aithingy-dev for both, so working on the code never touches the
installed app's data. AITHINGY_PROFILE=<name> picks another profile, for example to run a
release build from the repository on data of its own.
Satellites
A satellite makes LLM and MCP requests for your apps from wherever it runs: a home server that reaches your local Ollama and MCP tools, a VPS with a fixed IP, a machine inside a company network. It connects out to the AIThingy server (no open port needed) and waits for work.
Add one in Settings → Satellites; the app shows a setup string. Start the satellite with it:
aithingy-satellite aisat1.… # or AITHINGY_SATELLITE=aisat1.…
docker run -d --restart unless-stopped -e AITHINGY_SATELLITE=aisat1.… \
git.hibas.dev/hibas123/aithingy-satellite:latest
Then choose it as the Route of a provider, or under Runs on for an MCP server. With
AITHINGY_SATELLITE_STDIO=1 the apps may also start MCP programs (stdio servers) on it, which
makes local tools available to the web app and Android.
Calls and answers are encrypted between the apps and the satellite with a key the server never sees (it lives in the encrypted account objects and in the setup string). The server cannot read them, make calls of its own, or replay, reorder or cut off answers unnoticed; it sees which satellite is used when and how many bytes flow. The satellite sees the requests it carries out (prompts, API keys), not your chat history. Whoever has the setup string can stand in for the satellite, so keep it secret; deleting the satellite in the app locks it out.
cargo build --release -p aithingy-satellite builds it; Dockerfile.satellite builds the image.
MCP servers on a satellite
With AITHINGY_SATELLITE_STDIO=1, add an MCP server in the app as Local (starts a program)
and choose the satellite under Runs on. The command must exist where the satellite runs. The
image has Node and Python, so servers started with npx or uvx work as they are; anything
else goes into an image of your own built on top of it. deploy/satellite-mcp/ is an example
that adds WordCraft and DeckCraft (documents and
presentations), always in their newest release when built:
cd deploy/satellite-mcp && docker compose build && docker compose up -d
Each chat gets a workspace on the satellite: a folder its MCP programs run in, kept between
turns (AITHINGY_SATELLITE_WORKSPACES, by default
~/.local/share/aithingy-satellite/workspaces; removed after 30 days without use).
{workspace} in a server's arguments becomes its path, for example to allow a program to write
only there:
command /usr/bin/wordcraft-cli
arguments mcp --automation-read-root {workspace} --automation-write-root {workspace}
Files a tool saves in the workspace are attached to the answer (encrypted like any attachment) and can be saved from the chat; pictures and files in tool results are attached too. Before a turn the app puts the chat's files into the workspace, only those it lacks or has in another version. The chat's copy counts: the workspace is a cache and may be lost.
Behind a reverse proxy, answers stream only if the proxy passes request bodies on as they
arrive: the satellite uploads each answer to /api/satellite/jobs/<job> while it is produced.
nginx buffers uploads by default; turn that off for this path:
location /api/satellite/ {
proxy_pass http://aithingy:8085;
proxy_request_buffering off;
proxy_buffering off;
proxy_http_version 1.1;
client_max_body_size 0;
proxy_read_timeout 1h;
}
Login for apps
/auth/login?return_to=<url>&challenge=<c> starts the OIDC flow. <c> is
base64url(sha256("aithingy/login/v1" || verifier)) for a random verifier the app keeps. return_to may be a path on the server, an
aithingy:// URL or a loopback http://127.0.0.1:<port> URL. The app receives ?code=... and
posts {code, device, signature, verifier} to /auth/exchange for access and refresh tokens
(device is the device's public key, signature its signature over the code).
What the server can and cannot do
The server stores ciphertext and relays it. It is not trusted with content, and the clients check what it hands them:
- Chat keys come only from the chat's owner: every key bundle is signed, and a client pins the owner the first time it sees a chat. The server cannot hand out keys of its own.
- Messages are signed by their author and bound to chat, key epoch and author. Each one names, inside the ciphertext, the last message its author had seen; a server that leaves a message out, swaps two or shows members different histories is noticed and the chat is marked. Holding back the newest messages cannot be detected.
- Pairing a device uses a six-digit code from a commit-and-reveal exchange, so a swapped pairing link cannot be made to show the right code.
- Removing a device that had the account key replaces that key (new recovery phrase). Chats get a new key epoch; other members follow the signed succession from the old identity to the new one. The account's other devices keep going: every device vouches for itself with a certificate signed by the account identity, and the device that replaces the key seals the new one for each certified device, together with the succession. A device takes it only if the succession starts at the key it holds, so the server can neither add a device to the set nor hand out a key of its own. A device without a certificate (set up by an older version, or one that missed two replacements in a row) is paired again.
- Settings and providers (account objects) are encrypted with the account key, deletions included.
Limits to know about: the first key bundle of a chat is trusted on first use; a stolen device that is still signed in can do what its owner can until it is removed; the optional LLM proxy sees what goes through it (a satellite does not have this problem, see above); metadata (who is in which chat, sizes, times) is visible to the server. On the desktop the device's keys are encrypted with a key from the system keyring (plain files with 0600 if there is none); on Android with a key wrapped by a non-exportable Android Keystore key (StrongBox or TEE); in the browser a non-extractable WebCrypto key protects them.
Tests
cargo test --workspace