4 Commits

Author SHA1 Message Date
Rene Fichtmueller
998e8d8aee feat: add OpenAI/ChatGPT passthrough + per-AI savings in Overview
- New openai-proxy.ts: POST /v1/chat/completions forwards client's API key
  to OpenAI, creates tracking ticket with full cost calculation for all
  gpt-4o, gpt-4o-mini, o1, o3-mini, gpt-4-turbo, gpt-3.5-turbo models
- GET /v1/models unified in openai-proxy (removed duplicate from anthropic-proxy)
- Dashboard: POST /v1/chat/completions forwarded to core (OPENAI_BASE_URL works)
- Overview 'Savings per AI' panel: shows emoji label, request count, cost,
  tokens in/out, and savings per provider (🟣 Claude 🟢 ChatGPT 🟡 Ollama)
- Old pipeline-based proxy.ts replaced by direct API passthroughs
2026-04-14 22:55:13 +02:00
Rene Fichtmueller
bdde8cf115 feat: auto-track all Claude Code sessions via ANTHROPIC_BASE_URL proxy
- Add POST /v1/messages (Anthropic-format passthrough) to core with full
  ticket tracking — every Claude Code request creates a TokenVault ticket
- Add GET /v1/models passthrough so Anthropic SDK model listing works
- Proxy /v1/messages + /v1/models in dashboard so public URL forwards to core
- Add /health endpoint to dashboard for infra monitoring
- Overview tab now shows RTK savings banner (3.5M tokens, 753 commands)
  alongside LLM ticket stats — Overview no longer looks empty
- Provider split bar chart rendered when request data is available

ANTHROPIC_BASE_URL=https://tokenvault.fichtmueller.org now set globally
in ~/.zshrc — every new Claude Code session is tracked automatically.
2026-04-14 21:32:20 +02:00
Rene Fichtmueller
a290216183 feat: RTK integration — sync SQLite stats to TokenVault
- @tokenvault/rtk-bridge: Reads ~/Library/Application Support/rtk/history.db
  and syncs new commands to /v1/rtk/stats (stateful, batched, idempotent)
- Core: rtk_commands table + 4 endpoints (/v1/rtk/stats, /rtk/commands, /rtk/hosts)
- Dashboard: new RTK Savings tab with 6 KPI cards + top commands + host breakdown
- Multi-host aggregation: sync from Mac Studio, Mac Mini, MacBooks etc.
- First sync: 753 commands, 3.5M tokens saved aggregated

RTK is MIT-licensed (github.com/rtk-ai/rtk) — we use it as the compression
engine and add the missing pieces: central tracking, team attribution,
cross-machine dashboards, long-term trend analysis.
2026-04-14 21:08:59 +02:00
Rene Fichtmueller
d43b9f5298 feat: TokenVault MVP — hybrid MCP + proxy for LLM token savings
4-package monorepo:
- @tokenvault/core: Fastify 5.x proxy server, 7-stage pipeline,
  3 provider adapters (Anthropic, OpenAI, Ollama), PostgreSQL
  ticket system, cost calculator with real provider pricing
- @tokenvault/mcp: MCP server (stdio) with tv_ticket, tv_cost,
  tv_health tools for IDE integration
- @tokenvault/client: TypeScript SDK with createTokenVaultClient()
- @tokenvault/dashboard: Single-file HTML dashboard with MAGATAMA
  CI style (indigo #6366f1), bilingual DE+EN, 4 tabs

OpenAI-compatible proxy at /v1/chat/completions — drop-in replacement.
Every LLM request becomes a trackable ticket (TV-00001).
2026-04-14 10:10:22 +02:00