Skip to main content

A tool for tracing LLM requests

Project description

LLM Path

A lightweight tool for tracing LLM API requests.

Screenshot

Trace demo: nanobot[^nanobot], claude code, deep research[^deepresearch]

[^nanobot]: nanobot is a lightweight OpenClaw implementation in Python.

[^deepresearch]: The deep research agent is from the Google ADK demo, see deepresearch

Features

  • Transparent Proxy — Drop-in HTTP proxy that captures all LLM API traffic. Works with OpenAI, Anthropic (Claude), and Google (Gemini) APIs.
  • Request Visualization — Interactive web viewer to visualize the request topology graph and show the context diff between requests.

Installation

pip install llm-path

Quick Start

1. Start the Proxy

llm-path proxy --port 8080 --target https://api.openai.com --output trace.jsonl

Replace the --target host in the command above with your LLM provider's API host.

2. Point Your Client to the Proxy

from openai import OpenAI

- client = OpenAI()
+ client = OpenAI(base_url="http://localhost:8080/v1")

All requests will be transparently forwarded to your LLM provider and recorded to the trace file.

3. Visualize the Traces

llm-path viewer trace.jsonl

Proxy for More Providers

Google Agent Development Kit (ADK)

Start the proxy:

llm-path proxy --port 8080 --target https://generativelanguage.googleapis.com --output adk.jsonl

Set the environment variable for your ADK application:

GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:8080

CLI Reference

# Start proxy server
llm-path proxy [OPTIONS]
  --port      Port to listen on (default: 8080)
  --output    Output JSONL file path (required)
  --target    LLM Provider API URL (required)

# Visualize traces
llm-path viewer <input> [OPTIONS]
  --port      Port to listen on (default: 8765)
  --host      Host to bind to (default: 127.0.0.1)

Development Guide

git clone https://github.com/wang0618/llm-path.git
cd llm-path
uv sync

uv run llm-path proxy --port 8080 --target https://api.openai.com --output trace.jsonl &
uv run llm-path cook trace.jsonl -o ./viewer/public/data.json

cd viewer
npm install
npm run dev

License

MIT

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

llm_path-0.3.0.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_path-0.3.0-py3-none-any.whl (103.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_path-0.3.0.tar.gz.

File metadata

  • Download URL: llm_path-0.3.0.tar.gz
  • Upload date:
  • Size: 94.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_path-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cc912b4b167e0336325c8189c1b9b73fafc13ca2bc30665ae83c36ba6f406b6f
MD5 6f6555f62bda47ac16d74c2bb33fc593
BLAKE2b-256 f6995386f2859620eb6614dfe6be7eb88e5281f32ac5de5ad51b7497e665ea06

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_path-0.3.0.tar.gz:

Publisher: release.yml on wang0618/llm-path

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_path-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: llm_path-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 103.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_path-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 743133e021629d73e5955f7d72d24e167ddba3422cf2a888f2513a903da2a52e
MD5 03bf815d99f6e3e5a86b7aaa2f79f710
BLAKE2b-256 690bc7b94f38ac6a8c8dd8b1d6f97f5666a1a8f057b6588614250662397278ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_path-0.3.0-py3-none-any.whl:

Publisher: release.yml on wang0618/llm-path

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