Skip to content

ATMAECHO/TOKEN-METER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TokenMeter 🔥

Open-source, self-hosted AI Cost Intelligence Platform.

What it does

  • Proxy all your LLM API calls through TokenMeter
  • Track every token, every request, every rupee/dollar spent
  • Dashboard real-time cost visibility per developer, per model, per feature
  • Smart Routing auto-pick cheapest model that meets quality threshold
  • Semantic Cache skip duplicate API calls, save 45-80%
  • Waste Detection find oversized model usage, duplicates, failed requests
  • Prompt Optimizer reduce token usage by removing filler/redundant instructions
  • ROI Tracker cost vs quality scoring per model
  • Cost Forecasting predict future spend using historical trends
  • Rate Limiting per-developer token/request limits
  • Prompt Library save, share, and reuse optimized prompts
  • Quality Scoring auto-rate LLM response quality, model leaderboard
  • Usage Heatmap visualize when API calls happen (hour/day patterns)
  • Cost Tags tag requests by project/team/environment for billing
  • Webhook Integration fire webhooks on budget alerts, anomalies, etc.
  • Team Dashboard multi-user auth with admin/developer/viewer roles
  • A/B Testing same prompt, multiple models, compare quality + cost
  • Budget Management daily/monthly limits with alerts
  • Slack/Discord Alerts webhook notifications
  • CSV Export download reports
  • Self-hosted your data stays with you

Tech Stack

  • Backend: Python (FastAPI)
  • Frontend: React (Vite) + Recharts
  • Database: SQLite
  • No cloud dependency — runs on your machine

Quick Start

# Backend
cd backend
pip install -r requirements.txt
cp .env.example .env  # add your API keys
python main.py

# Frontend
cd frontend
npm install
npm run dev

Docker

docker-compose up -d

Architecture

Your App → TokenMeter Proxy → OpenAI/Anthropic/Gemini
                ↓
         SQLite DB (logs every request)
                ↓
         React Dashboard (17 tabs, real-time stats)

API Headers

X-Developer: your-name     # track per developer
X-Feature: my-feature      # track per feature/project
X-Smart-Route: on          # auto-pick cheapest model
X-Cache: on                # enable semantic caching

Dashboard Tabs

Overview | Models | Developers | Logs | Budgets | Waste | Savings | Optimizer | ROI | Forecast | Rate Limits | Prompts | Quality | Heatmap | Tags | Webhooks | Team

Default Login

  • Username: admin
  • Password: admin

License

MIT — use it however you want.

About

Open-source AI Cost Intelligence Platform — smart routing, semantic cache, waste detection, prompt optimization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors