Skip to main content

Transaction-safe, zero-dependency, edge-native AI observability engine.

Project description

lowlightlog

A transaction-safe, zero-dependency, edge-native AI observability engine.

lowlightlog gives AI systems deployed on constrained edge hardware (Raspberry Pi–class devices, industrial IoT gateways, on-prem servers) a way to record inference activity locally — without cloud connectivity, third-party dependencies, or the memory/corruption/privacy failures of naive logging.

Why existing tools fail here

Tool Fails at
LangSmith / Phoenix / OpenInference Cloud-bound, heavy dependency trees, needs connectivity
stdlib logging / Loguru / Structlog No transactional safety, unbounded memory, no redaction, not AI-aware
Custom file writers Corruption on power loss, TOCTOU races on log rotation
"Encrypted" logging shims Fake crypto (XOR/obfuscation), fails real audits

Install

pip install -e .

No third-party dependencies are ever installed — lowlightlog uses only the Python standard library (sqlite3, asyncio, re, hashlib, json). Requires Python 3.9+.

Minimal example

import asyncio
from lowlightlog import EdgeAILogger

async def main():
    async with EdgeAILogger(path="./logs") as logger:
        await logger.log_inference(
            prompt="What is the capital of France?",
            response="Paris.",
            model="phi-3-mini",
            latency_ms=87.3,
        )
        print(logger.stats())

asyncio.run(main())

See examples/basic_example.py and API.md for the full public surface.

Forensic export / verification CLI

lowlightlog export --path ./logs --since 2026-01-01 --fail-on-tamper

Read-only. Verifies the full SHA-256 hash chain and emits a JSON export (optionally date-filtered) with a content-integrity export_hash. Exits 1 if --fail-on-tamper is set and the chain is broken.

Guarantees

Guarantee Mechanism
No cloud dependency No network code in the package
No third-party packages Standard library only
No OOM crashes Bounded queue, deterministic overflow policy
No corrupted logs SQLite WAL, atomic batched commits
No race conditions Single background writer, single-writer WAL semantics
No fake security No app-layer crypto; relies on WAL integrity + filesystem encryption
No PII leakage Redaction runs before enqueue, before any disk touch
Survives power loss WAL + fsync at commit boundaries
Tamper-evident SHA-256 hash chain over rows

Full rationale in ARCHITECTURE.md.

Non-goals

  • Application-layer encryption — use filesystem/disk encryption instead.
  • Cloud export or remote log shipping.
  • Token-perfect counting — token counts are a documented len(text)//4 estimate.
  • NLP/ML-based PII detection — redaction is precompiled regex only.
  • A UI, dashboard, or plugin system.
  • On-disk compression. The live database is never compressed. Batched commits and a bounded WAL checkpoint threshold (see ARCHITECTURE.md) already keep flash write-wear low, which was the actual problem worth solving here — an always-live SQLite file isn't a great compression target anyway (it's actively appended to and checkpointed). If you need compressed long-term storage, export via lowlightlog export (see below) and compress the resulting JSON yourself; a built-in --compress export flag is a plausible future addition, not implemented today.

Failure behavior

Every documented failure mode has one deterministic outcome — see the Failure Behavior Contract table in ARCHITECTURE.md. In short: data still in the in-memory queue can be lost (per your configured overflow policy); data that reached a committed SQLite transaction can never be corrupted or partially written.

Development

pip install -e ".[dev]"
pytest

Roadmap

v0.2.0 delivered the forensic export CLI, policy-aware retention, backpressure alert hooks, and a multi-process stress-test suite (which caught and fixed a real hash-chain race — see CHANGELOG.md for details). Not planned: cloud dashboards, custom crypto, native tokenizers, a UI, or a plugin system — see CONTRIBUTING.md for the project's scope philosophy.

License

MIT — see LICENSE.

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

lowlightlog-0.3.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lowlightlog-0.3.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file lowlightlog-0.3.0.tar.gz.

File metadata

  • Download URL: lowlightlog-0.3.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lowlightlog-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8d38d53e5f0888d6131f9e412133a5e30ee633f502669049ca1d6ff370c49907
MD5 2ff2c2ddaeda79321321faa405f009b9
BLAKE2b-256 082bef2654a198b42394c40eec51d75ccc28cc145faabf5bf9175dda6ab567b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for lowlightlog-0.3.0.tar.gz:

Publisher: release.yml on Navneet-Scaler/lowlightlog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lowlightlog-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lowlightlog-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lowlightlog-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4967b6878d9438b6bf68aa5f98c08f842d49191ccf8cba19d1ac5d26ff5df57
MD5 607128adb30e79402fa4c5c635101114
BLAKE2b-256 1d1f154c69cd16ddf31409f9469d6a26bbb6ad4b34e6a8a8ec4eb465fc794222

See more details on using hashes here.

Provenance

The following attestation bundles were made for lowlightlog-0.3.0-py3-none-any.whl:

Publisher: release.yml on Navneet-Scaler/lowlightlog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page