Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 72 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Tokenmeter's service runs on every machine you want to see, and the services tha

It runs on **macOS** (menu bar app) and **Linux** (a window and a notification area icon on any desktop, plus a widget on KDE Plasma). A machine without a desktop, such as an inference server or an NVIDIA DGX Spark, runs the service alone.

**[Download the latest release →](https://github.com/tokenmeter1/Tokenmeter/releases/latest)** (Mac DMG, Linux tarball and Flatpak for x86_64 and Arm, and the service alone for every platform). [How to install →](#install)

![Tokenmeter's Monitor on a Mac](docs/images/mac-monitor.png)

## What you get
Expand All @@ -27,7 +29,7 @@ Gizmo's tour on Welcome shows, in three steps, where Tokenmeter sits: a reporter

### Monitor

Every server's speed, requests, memory and cache, with live charts.
Every server's speed, requests, memory and cache, with live charts. **Agents Live** shows the tool calls and model requests your coding agents are running right now, and **Named Requests** the latest requests the Engine Proxy and the agents put a name to. Both cover every machine of the mesh, with a **Machine** column saying where each one ran: the container, VM or computer the agent runs in.

![Monitor](docs/images/linux-monitor.png)

Expand All @@ -41,6 +43,12 @@ What Tokenmeter notices on its own: each model against its own normal, what the

![Insights visibility](docs/images/linux-insights-visibility.png)

### Targets and alerts

Say what good is for a model ("first token under 2 s for 95% of requests, over 7 days"), for every model on a server, or for every server of a machine, and Tokenmeter tells you when it stops being good: time to first token, writing speed, whole request, successful requests and the server answering. Each target shows its error budget and how fast it is burning, judged only on requests that already happened, never on test traffic. The machine that serves the model judges its own targets once a minute and alerts with no window open, wherever your alerts go (the desktop, ntfy on your phone, email, webhooks, Pushover, Gotify). [More about targets →](docs/wiki/Targets.md) · [Alerts →](docs/wiki/Alerts.md) · [Spend and cost alerts →](docs/wiki/Spend.md)

![Targets](docs/images/linux-targets.png)

### Usage

Every token counted by day, model and app, on this computer and the machines of its mesh, and what it would have cost in the cloud.
Expand Down Expand Up @@ -87,6 +95,8 @@ A coding agent's session as a story: model time, tool time, waiting for you, and

The same batch test before and after you change a server setting, on this machine's servers or another machine's, with suggestions and best profiles. Or a **workload test**: a stretch picked on the Machine Room replay sent again with synthetic text, with what it can't reproduce named, and the question "would fewer parallel slots protect my chats during the nightly batch?" answered.

**Standard Runs** put the same recipe on any machine, so machines and settings can be compared fairly: **Core** for everyday chat feel, **Long Context** (reading 8K to 128K tokens) and **Saturation** (1 up to 32 requests at once). Prompts are fitted to the model's own tokenizer, each step repeats until its figures settle, and a run started when the machine is quiet is stamped Standard (else Unofficial). Run one on any machine of the mesh against its own servers, keep the history, compare two, or save a signed `.tmbench` result file; `tokenmeter bench` does the same from a terminal. Nothing is sent to a server until you start a run.

![Tuning Lab](docs/images/linux-tuning-lab.png)

### Machine Room
Expand Down Expand Up @@ -190,6 +200,14 @@ Alerts can reach the phone too: set a [ntfy](https://ntfy.sh) topic under **Sett

![The Share sheet with a Machine Room card](docs/images/share-sheet.png)

### Your history

Since 0.9.0 the service keeps every finished request and the agents' reports in one SQLite database (`tokenmeter.db`), so it starts in a fraction of a second and uses less than half the memory it did; the first start of 0.9.0 moves the older history files in by itself. **Settings › General › Storage** lists what is kept on disk, kind by kind, with its size and how many days: requests (90 by default), agent reports (30) and machine history (14) can be changed. **Export** writes the requests as CSV or JSON, or the agent reports as CSV, to your Downloads folder: figures only, never the text of a prompt or an answer. **Copy the History to a Folder** makes a folder to take the whole history to another machine. The same from a terminal: `tokenmeter storage`, `tokenmeter storage keep requests 180`, `tokenmeter storage export requests csv`, `tokenmeter storage copy`.

A machine on 0.9.0 or later can't go back to 0.8.x: the earlier versions don't know the database and would start with an empty history, so **Go Back** isn't offered across that line. [Where the history is kept →](docs/wiki/Troubleshooting.md#where-the-history-is-kept) · [Moving it to another machine →](docs/wiki/Troubleshooting.md#moving-the-history-to-another-machine)

![Settings › Storage](docs/images/linux-settings-storage.png)

### Updates

The service updates itself, and the mesh passes updates along. A machine takes a later version from its updates folder (`~/.tokenmeter/updates`, for service packages you built or downloaded), from another member that has one, or from the project's releases, so one machine with a way out, or one folder with the packages in it, is enough for the whole mesh. Under **Settings › General › Updates** you choose how often to look (never, every day, every two days), where, and what to do with a find: tell you, download it and tell you (the default), or install it. **Install on Every Machine** updates the whole mesh from one window, each machine's package is checked before it is installed, and **Go Back** returns to the program that ran before. Only the service is updated this way; the window keeps its own download. [More →](docs/wiki/Mesh.md#updating-the-machines)
Expand All @@ -198,7 +216,7 @@ The service updates itself, and the mesh passes updates along. A machine takes a

### Menu bar and widget

Always one click away, in the Mac menu bar or the Linux notification area (an icon that starts at login, plus an optional Plasma widget).
Always one click away, in the Mac menu bar or the Linux notification area (an icon that starts at login, plus an optional Plasma widget). With a mesh, the Plasma widget and the notification area icon's tooltip add up every machine: the speed, a row per machine, every machine's models (the same model on several machines as one row) and today's tokens.

![Menu bar panel on macOS](docs/images/mac-menubar.png)

Expand All @@ -210,32 +228,73 @@ The **Agents** page lists the coding agents on this computer, connects one with

![Agents](docs/images/linux-agents.png)

A coding agent can report every request it makes, so Tokenmeter knows which agent asked, how long the first token took, and the agent's tasks, tools, retries and compaction for the Sessions page. Reporters are included for **oh-my-pi, Claude Code, Codex, GitHub Copilot CLI, Mistral Vibe, Pi, OpenCode, OpenClaw, Hermes Agent and DeepSeek Harness**, and any other agent or script can report in the same format. [What each one sends →](docs/wiki/Coding-Agents.md)
A coding agent can report every request it makes, so Tokenmeter knows which agent asked, how long the first token took, and the agent's tasks, tools, retries and compaction for the Sessions page. Reporters are included for **oh-my-pi, Claude Code, Codex, GitHub Copilot CLI, Mistral Vibe, Pi, OpenCode, OpenClaw, Hermes Agent and DeepSeek Harness**, and any other agent or script can report in the same format. An agent in a **Docker container** needs only Tokenmeter's folder shared with it (`docker run -v ~/.tokenmeter:/tokenmeter …`) and one setup command inside: no port to open. One on a VM or another computer reports over the network. Every machine of the mesh lists the agents set up elsewhere, marked with the machine they report to. [What each one sends →](docs/wiki/Coding-Agents.md)

With **Time Through the MCP Proxy** next to a server there, Tokenmeter stands between an agent and that MCP server: it passes everything on unchanged and times each tool call, with its size and whether it failed, for any agent, and never keeps arguments or results. See [the MCP Proxy](docs/wiki/MCP-Proxy.md).

Your agents can ask it too: Tokenmeter is an [MCP server](docs/wiki/MCP-Server.md) that tells an agent which server is free, why one is slow, what Insights noticed, and what its last session cost in time and energy.

## Install

**macOS** (Apple silicon, macOS 14 or later): build it from a clone with `./build-library-app.sh`. There is no published release yet; once there is one, its DMG will be under [Releases](https://github.com/tokenmeter1/Tokenmeter/releases). The app installs Tokenmeter's service, which does the watching (counting, proxies, agent reports, MCP, alerts) whether the window is open or not, as on Linux. A Mac without a screen takes the service package alone. [More →](docs/wiki/Install-macOS.md)
Tokenmeter is published as [GitHub releases](https://github.com/tokenmeter1/Tokenmeter/releases), each tagged `v<version>`. Take the newest from [the latest release](https://github.com/tokenmeter1/Tokenmeter/releases/latest):

| You have | Download | |
|---|---|---|
| A Mac with Apple silicon, macOS 14 or later | `Tokenmeter-<version>.dmg` | the app, which installs the service |
| Linux with a desktop, x86_64 | `Tokenmeter-<version>-linux-x86_64.flatpak` or `Tokenmeter-<version>-linux-x86_64.tar.gz` | the window, the icon, the Plasma widget and the service |
| Linux with a desktop, Arm (aarch64) | `Tokenmeter-<version>-linux-aarch64.tar.gz` | the same, for Arm |
| A machine without a desktop (an inference server, a DGX Spark, a headless Mac) | `tokenmeter-service-<version>-<linux-x86_64, linux-aarch64 or macos-arm64>.tar.gz` | the service alone, with a `.sha256` beside it to check the download |

Once one machine runs Tokenmeter, you rarely need to download again: the service updates itself, and the machines of a mesh pass updates to each other ([Updates](#updates)). A machine can also install Tokenmeter on another over SSH, from its **Mesh** page or with `tokenmeter mesh install user@machine`.

**macOS.** Open the DMG and drag **Tokenmeter** into Applications. The DMG is signed ad hoc, not with an Apple Developer ID, so the first time right-click the app and choose **Open** (or run `xattr -dr com.apple.quarantine /Applications/Tokenmeter.app`). The app installs Tokenmeter's service, which does the watching (counting, proxies, agent reports, MCP, alerts) whether the window is open or not. [More →](docs/wiki/Install-macOS.md)

**Linux** (KDE Plasma 6; [other desktops](docs/wiki/Install-Linux.md#other-desktops-gnome-xfce-cinnamon-and-the-rest) get the window and the icon): run the installer from a clone (there is no published release yet; once there is one, its Flatpak will be under [Releases](https://github.com/tokenmeter1/Tokenmeter/releases)):
**Linux.** The Flatpak brings its own Qt:

```sh
git clone https://github.com/tokenmeter1/Tokenmeter.git
cd Tokenmeter
Linux/install.sh
flatpak install --user Tokenmeter-*-linux-x86_64.flatpak
flatpak run io.github.tokenmeter1.tokenmeter
```

[Step by step for Fedora, Arch, Ubuntu and others →](docs/wiki/Install-Linux.md)
Or unpack the tarball and run its installer (it needs Qt's QML runtime, and `./install.sh --check` names what is missing):

**NVIDIA DGX Spark** and other machines without a desktop: `install.sh --service-only` runs the service alone, and your Mac or PC shows it as another machine of its mesh. A machine that already runs Tokenmeter can also install it there for you over SSH, from its Mesh page or with `tokenmeter mesh install user@machine`. [More →](docs/wiki/DGX-Spark.md)
```sh
tar -xzf Tokenmeter-*-linux-x86_64.tar.gz
cd Tokenmeter-*-linux-x86_64
./install.sh
```

Made for KDE Plasma 6; [other desktops](docs/wiki/Install-Linux.md#other-desktops-gnome-xfce-cinnamon-and-the-rest) get the window and the icon. [Step by step for Fedora, Arch, Ubuntu and others →](docs/wiki/Install-Linux.md)

**NVIDIA DGX Spark** and other machines without a desktop: unpack the service package and run `./install.sh` (on Linux, `install.sh --service-only` from an app tarball does the same). Your Mac or PC then shows it as another machine of its mesh. [More →](docs/wiki/DGX-Spark.md)

**Windows** (10 and 11): the service alone, built with Swift for Windows by `Windows\build.ps1` and installed by `Windows\install.ps1`, and watched from your Mac or Linux desktop as another machine of its mesh. There is no Windows download yet, and it has been compiled on very few machines. [More →](docs/wiki/Windows.md)

**Windows** (10 and 11): the service alone, built with Swift for Windows by `Windows\build.ps1` and installed by `Windows\install.ps1`, and watched from your Mac or Linux desktop as another machine of its mesh. New in 0.8.11 and compiled on very few machines yet. [More →](docs/wiki/Windows.md)
**Phones.** Every machine serves a read-only web dashboard at `/view/`; see [Phones, tablets and the web](#phones-tablets-and-the-web). The Android app is built from source with `Android/build.sh` ([Android/](Android/README.md)).

**Intel Arc** cards and the Arc graphics in Core Ultra processors are read on Linux, next to NVIDIA and AMD: clock, power, what holds the card back, and each server's share of it. It is untested on real cards, so reports are welcome. [More →](docs/wiki/Intel-Arc.md)

### Building from source

To try what is on `main` before it is released, or to work on Tokenmeter:

```sh
git clone https://github.com/tokenmeter1/Tokenmeter.git
cd Tokenmeter
./build-library-app.sh # on a Mac, with Xcode 26 or later: builds Tokenmeter.app
Linux/install.sh # on Linux, with Swift 6: builds and installs the service, app, icon and widget
```

Useful scripts for contributors:

- `scripts/check.sh` runs what the CI workflow runs, on your own machine in a Docker or Podman container: syntax of every Swift file (the Mac ones too), the tests, the release build of the service and the service tests. `--quick` for a short pass, `--all` for the slow extras. The report lands in `.build-check/report.txt`.
- `scripts/package.sh` (Mac DMG and Mac service package), `scripts/package-linux.sh`, `scripts/package-flatpak.sh` and `scripts/package-service.sh` build the release files into `dist/`.
- `scripts/package-linux-arm64.sh` builds the Arm (aarch64) Linux packages for a DGX Spark on an ordinary x86_64 PC, in Swift's arm64 Docker image under QEMU (`--service-only` for the service package alone).
- `scripts/release.sh dist` makes the tag and the GitHub release from those files and uploads them (`--dry-run` and `--draft` to look first); run it again from another machine to add its packages to the same release.
- `Android/build.sh` builds the Android viewer app with the Android SDK's own tools.

[Development →](docs/wiki/Development.md)

## Get started

1. Start your model server as usual (`llama-server`, `ollama serve`, `kapitsa serve`, LM Studio…).
Expand All @@ -252,8 +311,8 @@ The [wiki](docs/wiki/Home.md) has everything else:
- [Install on macOS](docs/wiki/Install-macOS.md) and [on Linux](docs/wiki/Install-Linux.md), and [uninstalling](docs/wiki/Uninstall.md)
- [What each page shows](docs/wiki/Features.md): Monitor, [Insights](docs/wiki/Features.md#insights), Servers, [Why Is It Slow?](docs/wiki/Features.md#why-is-it-slow) and [Dig Deeper](docs/wiki/Features.md#dig-deeper), Usage, Performance, [Sessions](docs/wiki/Features.md#sessions), [Tuning Lab](docs/wiki/Features.md#tuning-lab), [Machine Room](docs/wiki/Features.md#machine-room)
- [Engines](docs/wiki/Engines.md): supported servers, adding one by hand, servers on other machines
- How-tos: [the mesh](docs/wiki/Mesh.md), [status endpoint and command line](docs/wiki/Status-Endpoint.md), [Grafana board and OpenTelemetry export](docs/wiki/Status-Endpoint.md#grafana), [the Engine Proxy](docs/wiki/Proxy-Mode.md), [the MCP Proxy](docs/wiki/MCP-Proxy.md), [alerts](docs/wiki/Alerts.md), [coding agents](docs/wiki/Coding-Agents.md), [MCP server for agents](docs/wiki/MCP-Server.md), [Gizmo](docs/wiki/Gizmo.md), [power readings](docs/wiki/Power.md), [sharing a snapshot](docs/wiki/Sharing.md)
- [Troubleshooting](docs/wiki/Troubleshooting.md) and [building from source](docs/wiki/Development.md)
- How-tos: [the mesh](docs/wiki/Mesh.md), [status endpoint and command line](docs/wiki/Status-Endpoint.md), [Grafana board and OpenTelemetry export](docs/wiki/Status-Endpoint.md#grafana), [the Engine Proxy](docs/wiki/Proxy-Mode.md), [the MCP Proxy](docs/wiki/MCP-Proxy.md), [alerts](docs/wiki/Alerts.md), [targets](docs/wiki/Targets.md), [spend](docs/wiki/Spend.md), [your history and storage](docs/wiki/Troubleshooting.md#where-the-history-is-kept), [coding agents](docs/wiki/Coding-Agents.md), [MCP server for agents](docs/wiki/MCP-Server.md), [Gizmo](docs/wiki/Gizmo.md), [power readings](docs/wiki/Power.md), [sharing a snapshot](docs/wiki/Sharing.md)
- [Troubleshooting](docs/wiki/Troubleshooting.md), [building from source and making a release](docs/wiki/Development.md)

## Contributing

Expand Down
Binary file added docs/images/linux-settings-storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Tokenmeter watches the LLM inference servers on your computer, shows how fast th

## Getting it

- [The latest release](https://github.com/tokenmeter1/Tokenmeter/releases/latest): the Mac DMG, the Linux tarballs and Flatpak, and the service alone for every platform
- [Install on macOS](Install-macOS.md): the DMG, or building with the script
- [Install on Linux](Install-Linux.md): the Flatpak, or `install.sh` on Fedora, Arch, Ubuntu and others
- [Intel Arc](Intel-Arc.md): Arc cards and Core Ultra graphics on Linux, what is read and how to send a report
Expand Down
2 changes: 0 additions & 2 deletions docs/wiki/Install-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ On Linux, Tokenmeter has four parts:

There are two ways to install: the **Flatpak** (simplest, brings its own Qt) or the **install script** (from a release tarball or a clone). Neither needs root; both install for your user only.

> No release has been published yet, so for now build from a clone (see below and [Development](Development.md)). The download steps apply once the first release is under Releases.

## Option 1: Flatpak

Download `Tokenmeter-<version>-linux-x86_64.flatpak` from [Releases](https://github.com/tokenmeter1/Tokenmeter/releases) and open it in Discover, or from a terminal:
Expand Down
2 changes: 0 additions & 2 deletions docs/wiki/Install-macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

You need a Mac with Apple silicon and macOS 14 or later.

> No release has been published yet, so for now build from a clone (see below and [Development](Development.md)). The download steps apply once the first release is under Releases.

## From the DMG

1. Download `Tokenmeter-<version>.dmg` from [Releases](https://github.com/tokenmeter1/Tokenmeter/releases).
Expand Down
Loading