llmjournal
Record LLM calls and their cost, save them in your database, and view them as HTML pages. There's no server to run and the package has no dependencies. See DESIGN.md.
import llmjournal as lj
from llmjournal.backends import dynamodb
def save(trace): # you own the DB connection
records = lj.to_record(trace, "dynamodb")
dynamodb.apply(table, records) # + upload records.blobs to S3
tracer = lj.Tracer(sink=save, pricing=lj.Pricing.from_env())
with tracer.trace("summarise_document", tenant_id="t1", session_id="doc-42"):
resp = call_llm(...)
lj.record_generation(model_id, usage=resp["usage"], input=messages, output=text)
Viewing:
qs = lj.build_query("recent_traces", "dynamodb", tenant_id="t1")
traces = lj.from_rows("recent_traces", "dynamodb", [table.query(**q)["Items"] for q in qs])
html = lj.render_trace_list(traces)
Full examples: examples/dynamodb_sink.py, examples/lambda_viewer.py.
Develop
python3 -m venv .venv && .venv/bin/pip install -e '.[dev]' && .venv/bin/pytest
Against real Postgres and DynamoDB Local (skipped unless the env vars are set):
docker run -d --name llmjournal-pg -e POSTGRES_PASSWORD=test -e POSTGRES_DB=lj -p 127.0.0.1:55432:5432 postgres:16-alpine
docker run -d --name llmjournal-ddb -p 127.0.0.1:58000:8000 amazon/dynamodb-local
.venv/bin/pip install -e '.[integration]'
LJ_PG_DSN=postgresql://postgres:test@127.0.0.1:55432/lj LJ_DDB_ENDPOINT=http://127.0.0.1:58000 .venv/bin/pytest
Metadata
Release files for llmjournal 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llmjournal-0.1.0.tar.gz | 21.8 kB | Without provenance | Details for llmjournal-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llmjournal-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llmjournal-0.1.0-py3-none-any.whl |
Total release size: 41.0 kB
Release files / llmjournal-0.1.0.tar.gz
| Download URL | llmjournal-0.1.0.tar.gz |
|---|---|
| Size | 21.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05ce883b3449ff7281a602c72629ae7727b2f191eab4b626d80f321a36545fba
|
|
BLAKE2b-256 checksum How to use checksums |
8db60cb78e4bfc7a12c7d8ef7a285c5e02fde44bb7fc2a3b6909bffaaa9a07de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / llmjournal-0.1.0-py3-none-any.whl
| Download URL | llmjournal-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2239c98b492368f314af95c210498b98a2273cca6c864bcc3f0303e9a70c302
|
|
BLAKE2b-256 checksum How to use checksums |
eb135dd61943c5f7a060d4137cf3a0e7cf2de94d2d97d8c1a712f5e41aa41f9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for llmjournal 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.