AIMeter ist ein self-hosted Dashboard zur Verfolgung von Nutzung, Kontingent und Verlaufstrends von AI-Providern.
- React-Frontend-Dashboard
- Express-Backend-API
- Adapter-Architektur für mehrere Provider
- Runtime-Modi:
nodeundserverless - Datenbankgestützte Speicherung und Bootstrap-Flow
- Einheitliches Dashboard über mehrere AI-Provider
- Provider-Credential-Management und Quota-Anzeige
- Nutzungsverlauf und Chart-Seiten
- Endpoint-/Proxy-bezogene API-Seiten
- Bootstrap- und Admin-Initialisierungsflow
- Datenbank-Engines:
sqlite,d1,postgres,mysql
- Frontend: React 18, TypeScript, Vite, Tailwind CSS
- Backend: Node.js, Express, TypeScript
- Storage: SQLite / Cloudflare D1 / PostgreSQL / MySQL
.
├─ src/ # Frontend-App
├─ server/ # Backend API, Auth, Jobs, Storage
├─ deploy/ # Deployment-Guides nach Plattform
├─ docs/ # API-Doku, Provider-Beispiele, Übersetzungen, Konfig-Doku
├─ config.all.yaml # Vollständige Konfigurationsvorlage
├─ config.yaml # Aktive lokale Konfiguration (durch Kopie erzeugen)
└─ .env.all # Vollständige Env-Vorlage
Single-Container-Deployment mit nginx + Node.js. Daten werden über ein Volume-Mount persistiert.
mkdir -p ~/aimeter/db ~/aimeter/log
docker run -d --name aimeter \
-p 3000:3000 \
-e AIMETER_DATABASE_ENGINE=sqlite \
-e AIMETER_DATABASE_CONNECTION=/aimeter/db/aimeter.db \
-e AIMETER_SERVER_PORT=3000 \
-e AIMETER_BACKEND_PORT=3001 \
-e AIMETER_RUNTIME_MODE=node \
-v ~/aimeter/db:/aimeter/db \
-v ~/aimeter/log:/aimeter/log \
bugwz/aimeter:latestÖffnen: http://localhost:3000
Docker Compose, HTTPS, MySQL/PostgreSQL und Multi-Arch-Builds: deploy/container/README.md
Serverless-Deployment. Erfordert eine externe MySQL- oder PostgreSQL-Datenbank.
| Datenbank | Deployen |
|---|---|
| MySQL | |
| PostgreSQL |
Umgebungsvariablen setzen, Bootstrap abschließen, dann einen externen Cron-Dienst konfigurieren, der /api/system/jobs/refresh alle 5 Minuten aufruft.
Cron-Einrichtung und vollständige Konfiguration: deploy/vercel/README.md
Serverless-Deployment. Unterstützt Cloudflare D1, MySQL oder PostgreSQL.
Nach dem Deployment Umgebungsvariablen je nach Datenbanktyp setzen:
| Modus | Erforderliche Umgebungsvariablen |
|---|---|
| D1 | AIMETER_RUNTIME_MODE=serverlessAIMETER_SERVER_PROTOCOL=httpsAIMETER_DATABASE_ENGINE=d1AIMETER_DATABASE_CONNECTION=DB |
| MySQL | AIMETER_RUNTIME_MODE=serverlessAIMETER_SERVER_PROTOCOL=httpsAIMETER_DATABASE_ENGINE=mysqlAIMETER_DATABASE_CONNECTION=mysql://USER:PASSWORD@HOST:3306/DATABASE |
| PostgreSQL | AIMETER_RUNTIME_MODE=serverlessAIMETER_SERVER_PROTOCOL=httpsAIMETER_DATABASE_ENGINE=postgresAIMETER_DATABASE_CONNECTION=postgres://USER:PASSWORD@HOST:5432/DATABASE?sslmode=require |
Cron Triggers sind eingebaut — wrangler.jsonc plant automatisch alle 5 Minuten einen Refresh.
D1-Binding, Hyperdrive und vollständige Setup-Schritte: deploy/cloudflare/README.md
npm run dev # nur Frontend
npm run start:server # nur Backend
npm run dev:all # Frontend + Backend
npm run dev:mock:all # Frontend + Backend (Mock-Modus)
npm run build # Type-Check und Frontend-Build
npm run preview # Frontend-Build lokal prüfen
npm run cf:dev # lokale Cloudflare Workers-Entwicklung
npm run cf:deploy # zu Cloudflare Workers deployenQuellen und Priorität in der aktuellen Implementierung:
config.yaml(oder Pfad ausAIMETER_CONFIG_FILE)- Umgebungsvariablen
- Eingebaute Defaults
Wichtig:
database.engine/AIMETER_DATABASE_ENGINEist erforderlich.database.connection/AIMETER_DATABASE_CONNECTIONist erforderlich.- Im
serverless-Modus ist der Scheduler deaktiviert. - Im
node-Modus startet der In-Process-Scheduler automatisch.
Detaillierte Feldzuordnung und Erklärungen:
Unterstützte Deployment-Modi und Links:
- Session-Secret und verschlüsselungsrelevante Einstellungen werden im DB-Modus beim Bootstrap initialisiert und persistiert.
AIMETER_CRON_SECRETundAIMETER_ENDPOINT_SECRETsind optionale Integrations-Secrets; falls gesetzt, starke 32-Zeichen-Zufallswerte verwenden.- In Produktion
AIMETER_SERVER_PROTOCOL=httpssetzen, um strengere Transport-Sicherheitsheader zu aktivieren.



