Skip to main content

Local LLM API proxy — captures usage, attributes cost to projects.

Project description

Halton Meter

Local LLM API proxy that captures usage and attributes cost to projects.

Halton Meter is a governance and cost-attribution tool for LLM API spend. It runs a local proxy that observes outbound traffic to LLM providers (Anthropic, OpenAI, Gemini, Groq, etc.), logs every request with project-level attribution, computes accurate cost from published pricing, and surfaces it in a dashboard.

Designed for solo developers, agencies, and in-house dev teams who use Claude Code, the Anthropic SDK, or other LLM clients heavily and want transparency over what's being spent and on what.

Install

pipx install halton-meter
# or
uvx halton-meter

Requires Python 3.11+.

Quick start

halton-meter init      # one-time: install CA cert + configure system proxy (asks for sudo)
halton-meter start     # start the proxy daemon
halton-meter status    # check it's running

Once running, all your LLM API calls are logged to ~/.halton-meter/. Open the dashboard (separate component, see project repo) to see cost and token usage by project.

To stop and remove the proxy configuration:

halton-meter stop
halton-meter uninstall

What it does

  • Intercepts HTTPS traffic to LLM provider endpoints via a local mitmproxy instance
  • Parses request/response bodies to extract model, tokens, cost
  • Attributes each request to a project based on the calling process
  • Stores everything locally in SQLite (~/.halton-meter/db.sqlite)
  • Optionally syncs to a backend for dashboard visualisation

What it doesn't do

  • Doesn't wrap SDKs — your code stays exactly as it is
  • Doesn't intercept anything you don't ask it to — only configured LLM endpoints
  • Doesn't send your data anywhere by default — runs entirely locally
  • Doesn't break your workflow — if the proxy fails, traffic falls through to the real provider

Known limitations (v1.0)

A few things halton-meter cannot yet capture. Honest list, not a roadmap.

  • Hardcoded HTTP stacks bypass the proxy. Some clients ignore system proxy settings: libcurl builds without CURLOPT_PROXY honoured by default, Go programs that haven't set GODEBUG=netdns=go (Go's resolver path can sidestep proxy env vars), and any client that opens raw TLS sockets to known provider IPs. Calls from those clients reach the provider without being metered. Fix scope is per-client: there's no general-purpose interception that catches them all without rewriting their network stack.
  • Late-coming network interfaces. macOS network services are enumerated once when the daemon starts (via networksetup -listallnetworkservices, cached for the process lifetime). If you plug in a new interface — Thunderbolt dock, USB-tethered iPhone — after the daemon is running, that interface won't be metered until the daemon restarts. Restart with halton-meter stop && halton-meter start.
  • WSL2 not supported. The Windows path is a stub in v1.0; WSL2 in particular is not on the supported matrix because routing both the WSL2 guest and the Windows host through one proxy needs work we haven't done. Linux-native and macOS are the supported platforms.

Project

Halton Meter is open source under Apache 2.0. Built by Halton Labs.

This package is the daemon component. The dashboard lives in the same repository and is run separately.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

halton_meter-0.1.1.tar.gz (149.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

halton_meter-0.1.1-py3-none-any.whl (125.4 kB view details)

Uploaded Python 3

File details

Details for the file halton_meter-0.1.1.tar.gz.

File metadata

  • Download URL: halton_meter-0.1.1.tar.gz
  • Upload date:
  • Size: 149.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for halton_meter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3a9d6faa15d65602f7d853326d4d12aa6e9cbd918b53563d32fe18345599657
MD5 f2a0256f4d3e001f31ab628c457f2f65
BLAKE2b-256 7ad3fc7e213aa60148ca056beb5fef2f0d17a3b3a3e048fcd582072efb57f135

See more details on using hashes here.

File details

Details for the file halton_meter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: halton_meter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 125.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for halton_meter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c574c19ef444ad8b9fead1d4787815289c36663ce1f6a7dd2ed509e393e6ea1b
MD5 203d60a253463e7f277d01b1df6b7c6d
BLAKE2b-256 25ec3bf581e6575e1d1ac46dbe4a5cc4e910f33fdb48558865cb4096284287fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page