A tool for tracing LLM requests
Project description
LLM Path
A lightweight tool for tracing LLM API requests.
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
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc912b4b167e0336325c8189c1b9b73fafc13ca2bc30665ae83c36ba6f406b6f
|
|
| MD5 |
6f6555f62bda47ac16d74c2bb33fc593
|
|
| BLAKE2b-256 |
f6995386f2859620eb6614dfe6be7eb88e5281f32ac5de5ad51b7497e665ea06
|
Provenance
The following attestation bundles were made for llm_path-0.3.0.tar.gz:
Publisher:
release.yml on wang0618/llm-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_path-0.3.0.tar.gz -
Subject digest:
cc912b4b167e0336325c8189c1b9b73fafc13ca2bc30665ae83c36ba6f406b6f - Sigstore transparency entry: 985451137
- Sigstore integration time:
-
Permalink:
wang0618/llm-path@b9fa012905a923f0d56e6977e561008426cd6516 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/wang0618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9fa012905a923f0d56e6977e561008426cd6516 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
743133e021629d73e5955f7d72d24e167ddba3422cf2a888f2513a903da2a52e
|
|
| MD5 |
03bf815d99f6e3e5a86b7aaa2f79f710
|
|
| BLAKE2b-256 |
690bc7b94f38ac6a8c8dd8b1d6f97f5666a1a8f057b6588614250662397278ca
|
Provenance
The following attestation bundles were made for llm_path-0.3.0-py3-none-any.whl:
Publisher:
release.yml on wang0618/llm-path
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_path-0.3.0-py3-none-any.whl -
Subject digest:
743133e021629d73e5955f7d72d24e167ddba3422cf2a888f2513a903da2a52e - Sigstore transparency entry: 985451189
- Sigstore integration time:
-
Permalink:
wang0618/llm-path@b9fa012905a923f0d56e6977e561008426cd6516 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/wang0618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b9fa012905a923f0d56e6977e561008426cd6516 -
Trigger Event:
push
-
Statement type: