Lightweight LLM usage analysis and dashboard with mitmweb ingestion
Project description
Lifesaver Lite LLM
Overview
- Lightweight toolkit to ingest, analyze, and optimize LLM usage. Includes a simple dashboard, CLI analytics, and optional mitmweb-based live ingestion.
- Offline-friendly with vendored assets and deterministic tests. No secrets or large models committed.
Prerequisites
- Python 3.10+
- Optional: Docker (for mitmweb), make
Quickstart
- Create env and install
- python -m venv .venv && source .venv/bin/activate
- pip install -r requirements.txt -r requirements-dev.txt
- pip install -e .
- CLI analytics (ingest + analyze)
- lifesaver-lite-llm --db data/analysis.db ingest --input examples/sample_requests.json
- lifesaver-lite-llm --db data/analysis.db analyze --out reports/report.md
- Dashboard (upload mode)
- ./run.sh dashboard --upload examples/sample.har
- Live follow (mitmweb)
- make mitm-up # mitmweb UI at http://localhost:8081, proxy :8080
- MITMWEB_URL=http://localhost:8081 ./run.sh dashboard --upload ""
- Health checks
- make health # router + dashboard + mitmweb
- make health-router # GET http://localhost:4000/health
- make health-dashboard # GET /api/status
- make health-mitm # GET MITMWEB_URL (default :8081)
Run Tests & Lint
- pytest -q (ensure package is installed with pip install -e .; alternatively run with PYTHONPATH=src)
- ruff check .
- black .
CLI Highlights
- Ingest HAR/.mitm/JSON and analyze usage
- make all INPUT=examples/sample_requests.json
- lifesaver-lite-llm export flows --out exports/flows.json --since now-1h --redact 1
- magic-cli (agentic REPL + router helpers)
- docs/AGENT.md
- Agent via router (no provider-specific CLI):
- make agent-router-repl MODEL=gpt-4o-mini
- make agent-router-chat MSG="Hello" MODEL=gpt-4o-mini
- Claude via router: make agent-claude-repl MODEL=claude-3-haiku-20240307 and make agent-claude-chat MSG="Hello" MODEL=claude-3-haiku-20240307
Dashboard
- Pages: /, /flows, /timeline, /graph, /techniques
- APIs: /api/status, /api/flows, /api/graph, /api/techniques, /api/flow/{id}
- Basic Auth: set DASH_BASIC_USER and DASH_BASIC_PASS
- Health: make health-dashboard
Environment
- Core: LITELLM_MASTER_KEY, LITELLM_SALT_KEY, STORE_MODEL_IN_DB, DATABASE_URL, PORT
- Dashboard: DASHBOARD_PORT, DB_PATH, PROVIDERS_PATH, MITMWEB_URL, MITMWEB_COOKIE, DASH_BASIC_USER/PASS
Docs
- Start with docs/INTRODUCTION.md and docs/GETTING_STARTED.md
- See docs/DASHBOARD.md, docs/ARCHITECTURE.md, docs/INGESTION.md, docs/SECURITY.md
- One-file context: docs/PROJECT_CONTEXT.md (combined docs/prompts)
- Health checks and liftoff scenarios are documented in Makefile (make menu)
Project Layout
- src/lifesaver_lite_llm/: core package modules
- tests/: unit/integration tests
- configs/: provider presets and settings
- examples/: minimal inputs
- assets/: vendored static assets
- scripts/: helper scripts
License
- MIT. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lifesaver_lite_llm-0.1.1.tar.gz
(48.9 kB
view details)
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 lifesaver_lite_llm-0.1.1.tar.gz.
File metadata
- Download URL: lifesaver_lite_llm-0.1.1.tar.gz
- Upload date:
- Size: 48.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bac176e58e8ebcf931bca5acda81b2d49daecb7824e5c4d4358a246919c5b2f1
|
|
| MD5 |
458ca9c2bf4fc7a5ff008454139a7c02
|
|
| BLAKE2b-256 |
0c1a0f7750c07328de6894d751da1d260a8c70abed9834f2dae6c9252655060f
|
File details
Details for the file lifesaver_lite_llm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lifesaver_lite_llm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 49.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
334cd4076f55165a31808f777dbec38508481ec3dcb7b3d216a9ee715286b6be
|
|
| MD5 |
33e6477a825bfa29cd3c7765aabbf7cd
|
|
| BLAKE2b-256 |
d68c02c28fed1f2e9c30467793d430ae2cdb80f478c607e12e5050abfe0405d5
|