Internal LLM audit logger for maybeai services
Project description
py-llm-audit
Internal Python package for unified LLM audit logging.
Exports:
configure_audit_logger(...)use_structlog_context(...)set_audit_context(...)aset_audit_context(...)get_audit_context()clear_audit_context()bind_tool_name(...)register_user_resolver(...)clear_user_resolver()resolve_audit_user_id(...)audit_context_from_headers(...)merge_audit_headers(...)build_llm_audit_doc(...)log_llm_audit(...)alog_llm_audit(...)MongoAuditWriterAsyncMongoAuditWriter
Notes:
- Supports native
contextvars - Can reuse existing
structlog.contextvars - Supports async
user_idresolution for cases such asgpt_id -> user_id log_llm_audit(...)is for sync writersalog_llm_audit(...)is for async writers such as Motor-backed Mongo- Default behavior is non-blocking: audit context resolution, doc building, and write failures do not interrupt the original business flow unless strict mode is explicitly enabled with
fail_silently=False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
klg_llm_audit-0.1.4.tar.gz
(5.3 kB
view details)
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 klg_llm_audit-0.1.4.tar.gz.
File metadata
- Download URL: klg_llm_audit-0.1.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b759d516e7ecdae5abb779241a755448a36e5f6e2c51d72d01511fb3cb8855d8
|
|
| MD5 |
1e2203aac189c55999519eb1a9fe5106
|
|
| BLAKE2b-256 |
227863b653e32a310cd56d20784b262d405432efa2534187473c20de94e85806
|
File details
Details for the file klg_llm_audit-0.1.4-py3-none-any.whl.
File metadata
- Download URL: klg_llm_audit-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfbffb69c4663b47799740feeb3661e8501b76f158d1d3eb10e579008a4fd35a
|
|
| MD5 |
65ffd9113e93a80352235a9b4d17b8ee
|
|
| BLAKE2b-256 |
60a2bf583ae40c85df34c44ff187f690570390175c5cb7c68a2ae9e4a34ac481
|