TraceMeter
Local-first, zero-infra cost & latency dashboard for LLM pipelines — built on OpenTelemetry GenAI semantic conventions, not competing with them.
OTel standardized the schema for LLM telemetry (gen_ai.* attributes). It deliberately ships no collector, no cost layer, and no UI for a solo developer to just run. TraceMeter is that missing piece: a single pip install gets you OTel-GenAI-compliant tracing, a local SQLite store, automatic cost calculation, and a dashboard — no collector, no exporter config, no account signup.
from openai import OpenAI
import tracemeter
client = tracemeter.instrument_openai(OpenAI())
with tracemeter.span("my_pipeline"):
client.chat.completions.create(model="gpt-4o-mini", messages=[...])
tracemeter serve
Opens a local dashboard at http://127.0.0.1:8765 showing cost and latency broken down by run, step, and model — waterfall view per trace, cost breakdown by model, run-vs-run comparison, CSV/JSON export.
Why
- A product, not just a spec. OTel GenAI conventions describe the shape of the data; you still need a collector + backend + UI to see anything. TraceMeter is that consumer, ready to run locally in minutes.
- A cost layer. OTel captures token counts as attributes and stops there. TraceMeter ships a maintained, PR-friendly pricing table and computes cost automatically from standard
gen_ai.usage.*attributes. - A fast path to first insight. No collector to stand up, no exporter to configure, no backend to connect.
pip install tracemeterto a cost-annotated dashboard in minutes. - Interoperable by construction. Every span TraceMeter emits follows
gen_ai.*naming, so the same data is portable to Datadog, Grafana/Tempo, Jaeger, or any OTLP-compatible backend. TraceMeter isn't a silo.
Status
Early / pre-alpha, but functional end-to-end. Working today:
- Core SDK:
@trace/tracemeter.span(), nested spans, SQLite storage - Auto-instrumentation for
openai,anthropic,litellmclient instances (sync + streaming) - Pricing engine with a versioned, PR-friendly table; unknown models fail open
- Local dashboard (
tracemeter serve): waterfall view, cost breakdown by model, run comparison, filtering, CSV/JSON export - OTLP/HTTP ingest (
POST /v1/traces, both protobuf and JSON) so any OTel-instrumented app can use TraceMeter as a backend without its own SDK
Not yet published to PyPI, and not yet used in production anywhere — see Issues and PRD.md for the roadmap.
Install
git clone https://github.com/Kazu-Labs/tracemeter
cd tracemeter
pip install -e ".[all]"
pip install tracemeter once it's published to PyPI. Extras: [openai], [anthropic], [server] (dashboard), [otlp] (OTLP ingest), [all] (everything).
Quickstart
from openai import OpenAI
import tracemeter
client = tracemeter.instrument_openai(OpenAI())
with tracemeter.span("summarize_doc"):
client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Summarize this in one sentence: ..."}],
)
tracemeter serve
Traces land in ~/.tracemeter/traces.db (override with TRACEMETER_DB_PATH); the dashboard reads from there. No collector, no exporter config, no account.
Using TraceMeter without its own SDK
Point any OTel SDK's OTLP exporter at a running tracemeter serve instance:
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:8765
Spans with gen_ai.* attributes get cost computed automatically on ingest, same as spans from TraceMeter's own SDK. Verified against a real opentelemetry-sdk + opentelemetry-exporter-otlp-proto-http export during development.
Core concepts
- Spans are OTel-GenAI-compliant:
gen_ai.system,gen_ai.request.model,gen_ai.usage.input_tokens, etc., plus TraceMeter-specific extensions (tracemeter.cost.usd,tracemeter.latency_ms) namespaced so they never collide with future upstream additions. - Storage is local SQLite by default (
~/.tracemeter/traces.db, override withTRACEMETER_DB_PATH). No infra required. - Pricing is a versioned JSON table (
src/tracemeter/pricing/prices.json). Unknown models fail open: cost shows as "unknown," never silently wrong. PRs to keep it current are welcome.
Contributing
Pricing table updates are the easiest and most valuable contribution — see src/tracemeter/pricing/prices.json. It's a plain JSON file: add a model, open a PR.
pip install -e ".[dev,server,otlp]"
pytest
License
Apache 2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tracemeter-0.1.0.tar.gz.
File metadata
- Download URL: tracemeter-0.1.0.tar.gz
- Upload date:
- Size: 38.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65dc8919952fa63b79cc7c61eedfcc94e2787bedeabfad02edf7ca6f76003ec9
|
|
| MD5 |
6bb14a7a0092233a3329e68bb4274b03
|
|
| BLAKE2b-256 |
2c06c9c233bcc485364a071593b73367583673cfebc1c317e5a58dcdfec85a6a
|
Provenance
The following attestation bundles were made for tracemeter-0.1.0.tar.gz:
Publisher:
release.yml on Kazu-Labs/tracemeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracemeter-0.1.0.tar.gz -
Subject digest:
65dc8919952fa63b79cc7c61eedfcc94e2787bedeabfad02edf7ca6f76003ec9 - Sigstore transparency entry: 2585556036
- Sigstore integration time:
-
Permalink:
Kazu-Labs/tracemeter@2bea99bf07c39c094eba69946636976c369211cf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Kazu-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2bea99bf07c39c094eba69946636976c369211cf -
Trigger Event:
release
-
Statement type:
File details
Details for the file tracemeter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tracemeter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e86c06c147ee59f15961e8ef2ed9a212ce4b92baf42fddbe9adb6e60f2f7329
|
|
| MD5 |
851bc4178829b6176e997fd1513e4972
|
|
| BLAKE2b-256 |
f1d82fa57d83f6c839241090304a4267daadca97cc2b234397884e26dbd835c6
|
Provenance
The following attestation bundles were made for tracemeter-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Kazu-Labs/tracemeter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracemeter-0.1.0-py3-none-any.whl -
Subject digest:
8e86c06c147ee59f15961e8ef2ed9a212ce4b92baf42fddbe9adb6e60f2f7329 - Sigstore transparency entry: 2585556895
- Sigstore integration time:
-
Permalink:
Kazu-Labs/tracemeter@2bea99bf07c39c094eba69946636976c369211cf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Kazu-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2bea99bf07c39c094eba69946636976c369211cf -
Trigger Event:
release
-
Statement type: