Self-hosted AI observability backend
Project description
logmera
Self-hosted AI observability backend with FastAPI + PostgreSQL, plus a lightweight Python SDK logger.
Features
- Async FastAPI backend
- PostgreSQL storage via SQLAlchemy ORM
- Auto table creation for
logson startup - Typer CLI with interactive DB URL setup
- Python SDK function:
logmera.log(...)
Install
pip install logmera
Start Server
Use a browser-safe port like 8000 (avoid 6000 in browser).
logmera --host 127.0.0.1 --port 8000
Notes:
- The CLI is currently single-command mode, so use
logmera --port 8000(notlogmera start ...). - On first run, if DB is not configured, it prompts for
DATABASE_URL. - Entered DB URL is saved at
~/.logmera/config.env.
Database Configuration
Resolution order for DB URL:
--db-urlDATABASE_URLenv var~/.logmera/config.env- Interactive prompt
Examples:
logmera --db-url "postgresql://postgres:postgres@localhost:5432/logmera"
logmera --no-prompt --db-url "postgresql://postgres:postgres@localhost:5432/logmera"
Optional DB pool env vars:
DB_POOL_SIZE=10
DB_MAX_OVERFLOW=20
DB_POOL_TIMEOUT=30
API Endpoints
GET /-> welcome messageGET /health->{"status":"ok"}POST /logs-> create logGET /logs-> list logs ordered bycreated_at DESC
Example: Health
curl http://127.0.0.1:8000/health
Example: Create Log
curl -X POST http://127.0.0.1:8000/logs \
-H "Content-Type: application/json" \
-d '{
"project_id":"demo",
"prompt":"Hello",
"response":"Hi there",
"model":"gemini-2.5-flash",
"latency_ms":123,
"status":"success"
}'
Example: List Logs
curl http://127.0.0.1:8000/logs
SDK Usage
logmera/sdk.py exposes logmera.log(...).
import logmera
ok = logmera.log(
project_id="demo-chat",
prompt="Hello",
response="Hi",
model="gemini-2.5-flash",
latency_ms=95,
status="success",
)
SDK env vars:
LOGMERA_URL(default:http://127.0.0.1:8000)LOGMERA_TIMEOUT_SECONDS(default:10)LOGMERA_RETRIES(default:2)
Local PostgreSQL Quick Start (Docker)
docker run --name logmera-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=logmera \
-p 5432:5432 -d postgres:16
Then start:
logmera --db-url "postgresql://postgres:postgres@localhost:5432/logmera"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 logmera-0.1.1.tar.gz.
File metadata
- Download URL: logmera-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89fefa3515b19957c78f6403df6725c7327f628bb6eaf1c317785dcf739b1547
|
|
| MD5 |
73b21836227004976a175d638fa167a2
|
|
| BLAKE2b-256 |
16268f638444637853d318a446d49cc56684b865aa32f67bea30a4d6220039d9
|
File details
Details for the file logmera-0.1.1-py3-none-any.whl.
File metadata
- Download URL: logmera-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23d2755a9307d38a1561d6cbfc81b7e68de927bdc174f600f2dba36536802ff0
|
|
| MD5 |
504100555c67aa988713a276274eea96
|
|
| BLAKE2b-256 |
8091566ad6ee44eaf3f26367f43f24b0570c88f5c5e678a0e03cd3e7be788872
|