Status: [UNTESTED] Endpoints found: http://192.168.60.58:11434/api/tags http://proxy:8787/v1` Source: https://github.com/he-is-talha/ai-llm-usage-meter # ai-llm-usage-meter [![Boring AI](https://img.shields.io/badge/Boring%20AI-Project%205%2F15-111111)](https://github.com/he-is-talha) OpenAI-compatible LLM proxy that records every chat completion to Postgres: tokens, latency, TTFT (streaming), error class, normalized prompt shape, and cost from a local price table. A Vue dashboard reads four metrics APIs; no cloud API key is required when upstream is LAN Ollama. ![Usage meter: Postgres call log → cost-per-day dashboard → unknown-model guard](docs/demo.gif) > Demo: `docs/demo.gif` (~14s body clip) / `docs/demo.mp4` (~30s with Bill VO). ## Architecture ``` Clients (Projects 1–4) │ POST /v1/chat/completions ▼ ┌───────────────────┐ ┌─────────────┐ │ Proxy :8787 │────▶│ LAN Ollama │ │ (price lookup, │ │ gemma3:4b │ │ stream tee) │ └─────────────┘ └─────────┬─────────┘ │ INSERT calls ▼ ┌─────────────┐ ┌────────────────┐ │ Postgres │◀────│ Dashboard :8080 │ │ :5433 │ │ (nginx + Vue) │ └─────────────┘ └────────────────┘ ``` ## Quickstart ```bash git clone cd ai-llm-usage-meter cp .env.example .env docker compose up -d --build npm run seed:all # historical priced rows + live LAN Ollama calls open http://127.0.0.1:8080 # dashboard open http://127.0.0.1:8090 # adminer (optional) npm test ``` **Prerequisites:** Node 24+, Docker, network access to Ollama at `192.168.60.58:11434` (or change `UPSTREAM_BASE_URL`). Confirm the model is available: ```bash curl http://192.168.60.58:11434/api/tags ``` ## Development ```bash docker compose up -d postgres npm in