Skip to main content

llmtraceviewer

A Python package and CLI tool to view LLM call traces from JSONL log files. It starts a local HTTP server for interactive log exploration.

Usage

llmtraceviewer <log_filename or directory>
  • Starts a FastAPI server
  • Provides an API endpoint for log data
  • You can specify a single log file or a directory containing log files

Log File Format

The tool expects a JSONL (JSON Lines) log file where each relevant line contains the string LLMTRACE: followed by a JSON object. Only lines with LLMTRACE: are parsed.

Each JSON object should have the following structure:

{
  "type": "chat.completion",
  "messages": [
    { "role": "user", "content": "Hello, world!" },
    { "role": "assistant", "content": "Hi!" }
  ],
  "response_format": "text",
  "reasoning_effort": "low",
  "temperature": 0.7,
  "elapsed_time": 1.23,
  "response": "Hi!",
  "finish_reason": "stop",
  "completion_tokens": 10,
  "prompt_tokens": 8,
  "reasoning_tokens": 2,           // optional
  "start_time": 1713268800.0       // optional (Unix timestamp)
}

Example log file:

2024-04-16T12:00:00Z INFO LLMTRACE: {"type": "chat.completion", "messages": [{"role": "user", "content": "Hello, world!"}], "response_format": "text", "reasoning_effort": "low", "temperature": 0.7, "elapsed_time": 1.23, "response": "Hi!", "finish_reason": "stop", "completion_tokens": 10, "prompt_tokens": 8}
2024-04-16T12:00:01Z INFO LLMTRACE: {"type": "chat.completion", "messages": [{"role": "user", "content": "How are you?"}], "response_format": "text", "reasoning_effort": "medium", "temperature": 0.7, "elapsed_time": 1.45, "response": "I'm an AI, so I don't have feelings, but thanks for asking!", "finish_reason": "stop", "completion_tokens": 15, "prompt_tokens": 10, "reasoning_tokens": 3, "start_time": 1713268801.0}
  • Each line can have arbitrary text before LLMTRACE:
  • The JSON object after LLMTRACE: should contain the LLM call trace fields as shown above

Requirements

  • Python 3.8+
  • Node.js (for development)

Development

  • Backend: FastAPI
  • Frontend: Next.js (served as static files)

Metadata

Release files for llmtraceviewer 0.2.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 llmtraceviewer 0.2.0
File Size Uploaded Provenance Actions
llmtraceviewer-0.2.0.tar.gz 254.6 kB With provenance Details for llmtraceviewer-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 515.9 kB

Release files / llmtraceviewer-0.2.0.tar.gz

Download URL llmtraceviewer-0.2.0.tar.gz
Size 254.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ed103a846165b4618bd7e668e075831d256af8a0bd293a3ee97f609052c1b46
BLAKE2b-256 checksum
How to use checksums
d8f7377a4d904a6750b33a4be78104f96cb12dccf8178a37ea9ef3da4f4038fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 16, 2025.

Transparency log

Release files / llmtraceviewer-0.2.0-py3-none-any.whl

Download URL llmtraceviewer-0.2.0-py3-none-any.whl
Size 261.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00e7e8766b33ad2fa028478648c9ff9709e11d67d716bbd26bd5c11a3af8e7d1
BLAKE2b-256 checksum
How to use checksums
a79a6cdff7084f6e1d4d221b94aeef606a9f459dfda2cb60af973f25d30c00c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 16, 2025.

Transparency log

Security for llmtraceviewer 0.2.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llmtraceviewer-0.2.0.tar.gz

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 Apr 16, 2025.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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