Skip to main content

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.

Metadata

Release files for lowlightlog 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lowlightlog 0.4.0
File Size Uploaded
lowlightlog-0.4.0.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lowlightlog 0.4.0
File Interpreter ABI Platform
lowlightlog-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / lowlightlog-0.4.0.tar.gz

Download URL lowlightlog-0.4.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f790804433adcabbb97fe268816ba22b83703680ac57c8e53928134362c7b2ae
BLAKE2b-256 checksum
How to use checksums
50656fa639882a7c1b7721525e451f76a8955f595a5029305286127cb781337d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release files / lowlightlog-0.4.0-py3-none-any.whl

Download URL lowlightlog-0.4.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53b84e16daeee410c2aaaeb728643ca626a64cb22f8bb40d1cb6a120d2443c93
BLAKE2b-256 checksum
How to use checksums
a1ac0d3761a7c31f57857dfa48d9e2b716b6c35828cb3a3da7e6dd12bb40c12f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page