All work
AIFeatured2026-09

0x1LOG

Embedded observability for FastAPI: searchable FTS5 logs, grouped errors, live metrics, and AI or background-job tracing in one SQLite file.

  • Python
  • FastAPI
  • SQLite FTS5
  • PostgreSQL
  • Redis
  • W3C Trace
pip install 0x1-log

Project brief (5W + 1H)

Why I built it
FastAPI services running AI agents and background workers outgrow plain stdout logs long before a team wants to operate an ELK cluster, Jaeger stack, or per-GB SaaS just to answer what broke, on which request, and why.
What it is
Embedded FastAPI observability mounting searchable FTS5 logs, Smart Repeats, grouped exceptions, live p50 and p95 metrics, and W3C request, LLM, and worker trace waterfalls directly at /0x1log/.
Who it is for
Python and FastAPI backend or AI engineers who need production request diagnostics, LLM span visibility, and background-job tracing inside their own service with zero external infrastructure.
Where it runs
Mounts inside any Python 3.10+ FastAPI application behind a dashboard token, storing events in a local .0x1log/0x1log.db SQLite WAL file or scaling to PostgreSQL, Redis, or in-memory lite mode.
When it shipped
Started September 2026 (evolved from nahiarhdlog); published as 0x1-log v1.4.5 on PyPI (MIT).
How it works
ASGI middleware enqueues a compact event dict onto a bounded in-memory queue (~0.04 ms p95 overhead) flushed by a background batch writer so requests never block, while propagating W3C traceparent headers across FastAPI handlers, LLM calls, and RQ or Celery workers.

Problem

FastAPI services running AI agents and background workers often outgrow plain stdout logs long before a team wants to operate an ELK cluster or Jaeger stack. Developers still need to see which request triggered an error, how long each embedding or LLM step took, and what payloads reached the handler.

0x1LOG (0x1-log v1.4.5 on PyPI) mounts directly inside the FastAPI application at /0x1log/ behind a dashboard token, starting from one .0x1log/0x1log.db SQLite WAL file.

Approach & Architecture

  • Zero-infrastructure default, scales when needed. Starts with one SQLite WAL + FTS5 database and zero external services, and switches to postgresql:// for multi-replica deployments or mode="lite" (memory:// / redis://) for ephemeral workloads.
  • Negligible request overhead (~0.04 ms p95). ASGI middleware enqueues a compact dict onto a bounded in-memory queue and a background thread flushes batches, dropping safely with a visible counter rather than blocking requests.
  • Smart Repeats, W3C tracing, and AI spans. Consecutive queue polls collapse into expandable repeat rows, traceparent links FastAPI handlers to RQ and Celery jobs, and LLM/embedding spans capture model names and token counts.
flowchart TD R["HTTP Request + traceparent"] --> M["ASGI Middleware ~0.04 ms"] M --> Q["Bounded Queue"] M --> H["FastAPI Handler unblocked"] Q --> W["Background Batch Writer"] W --> D[("SQLite FTS5 / Postgres / Redis")] D --> U["Embedded Console /0x1log/"]

Quick start

import os
from dotenv import load_dotenv
from fastapi import FastAPI
from ox1log import observe

load_dotenv()

app = FastAPI()
observe(app, dashboard_token=os.environ.get("OX1LOG_TOKEN"))

MIT licensed, Python 3.10+.

Quick commands

⌘K

Navigate

Quick actions

Install CLI