Skip to main content

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

Project description

lowlightlog

test PyPI Python versions License: MIT

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 lowlightlog

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, examples/production_config_example.py (overflow policy, retention, backpressure alerting), 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.4.0.tar.gz (21.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.4.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lowlightlog-0.4.0.tar.gz
  • Upload date:
  • Size: 21.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.4.0.tar.gz
Algorithm Hash digest
SHA256 f790804433adcabbb97fe268816ba22b83703680ac57c8e53928134362c7b2ae
MD5 9fd8a6ba97a27429fc9bae0b02a967ae
BLAKE2b-256 50656fa639882a7c1b7721525e451f76a8955f595a5029305286127cb781337d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lowlightlog-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: lowlightlog-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53b84e16daeee410c2aaaeb728643ca626a64cb22f8bb40d1cb6a120d2443c93
MD5 5cc5bf0eb9103f865effc14367c8f291
BLAKE2b-256 a1ac0d3761a7c31f57857dfa48d9e2b716b6c35828cb3a3da7e6dd12bb40c12f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lowlightlog-0.4.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