We're building the financial infrastructure for AI agents. Every contribution matters — from fixing a typo to adding a new framework adapter.
git clone https://github.com/saileshr/aimeter.git
cd aimeter
pip install -e ".[dev]"
pytestThat's it. Zero external services needed.
pytest # run all tests
pytest tests/test_cost.py -v # run a specific test file
pytest -k "test_openai" # run tests matching a pattern
ruff check src/ tests/ # lintAll tests use mocks — no API keys required. Tests must pass before merging.
src/aimeter/
├── types.py # Core data model (LLMEvent, TokenUsage, etc.)
├── cost.py # Cost registry and calculation
├── config.py # Configuration
├── tracker.py # Core engine
├── outcome.py # Outcome attribution
├── report.py # Terminal report formatter
├── performance.py # Aggregate perf stats (latency percentiles, throughput)
├── adapters/ # Framework adapters (one file per framework)
│ ├── openai.py
│ ├── anthropic.py
│ └── generic.py
└── exporters/ # Event exporters (one file per destination)
├── console.py
└── memory.py
These are great places to start:
Each adapter is ~20 lines of extraction logic. The pattern:
- Wrap the client/framework entry point
- Call the underlying method
- Extract:
model,tokens(input/output/cached),tool_calls(names only) - Create an
LLMEventand calltracker.record(event)
Look at src/aimeter/adapters/openai.py for the reference implementation.
Wanted adapters:
- LangChain (callback handler pattern)
- CrewAI
- AutoGen
- Cohere
- Mistral
- LiteLLM
Exporters implement a simple protocol: export(events: list[LLMEvent]) and shutdown().
Wanted exporters:
- File exporter (JSON-lines to disk)
- HTTP exporter (POST events to an endpoint)
- OpenTelemetry exporter (emit as OTEL spans)
Edit the _BUILTIN_PRICING_RAW dict in src/aimeter/cost.py. Prices are per 1,000 tokens. Include the source (provider pricing page URL) in your PR description.
- Python 3.10+ (use
X | Yunion syntax,slots=Trueon dataclasses) - Lint with
ruff(config inpyproject.toml) - No external dependencies in core — only stdlib
- Framework SDKs are optional extras (
pip install aimeter[openai]) - Use
from __future__ import annotationsin every file - Privacy by default — never capture message content
- Every new feature needs tests
- Use
MemoryExporterto capture events in tests - Call
reset()inteardown_methodto clean up the global tracker - Mock external SDK objects (don't require real API keys)
- See
tests/adapters/test_openai.pyfor the mock pattern
- Fork the repo and create a branch
- Make your changes
- Run
pytestandruff check src/ tests/ - Submit a PR with a clear description of what and why
We aim to review PRs within 48 hours.
- Zero dependencies in core — the SDK must install with no extras
- Privacy by default — track costs, not content
- Thin adapters — 20 lines of extraction, not 200 lines of proxy. Easy to maintain when SDKs change.
- Boring technology — stdlib, dataclasses, simple functions. No magic.
- Works offline — everything runs locally without any cloud service