Skip to content

avikcodes/traceLLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open-Source Observability Platform for AI Applications & Agents

Track prompts, latency, token usage, execution traces, tool calls, retries, hallucinations, and agent workflows in real time.


Demo

See TraceLLM monitoring AI agents in real time.

🎥 DEMO VIDEO HERE

https://your-demo-video-link.com


Screenshots

Dashboard Overview

Dashboard


Live Agent Monitoring

Monitoring


Execution Replay

Replay


Prompt & Token Analytics

Analytics


Why TraceLLM?

Modern AI applications are difficult to debug.

Traditional logs tell you:

Request received
Response generated
Request completed

They do NOT tell you:

  • Which prompt was sent
  • Which tools were called
  • Why the model failed
  • Where latency occurred
  • Which step hallucinated
  • Which retry fixed the issue
  • How agent decisions evolved

TraceLLM solves this problem.


What TraceLLM Captures

Feature Supported
Prompt Tracking
Response Tracking
Tool Call Inspection
Agent Workflow Replay
Latency Analysis
Token Monitoring
Error Tracking
Real-time Streaming
OpenAI Integration
LangChain Integration
WebSocket Monitoring

Architecture

flowchart LR

A[AI Application]
--> B[TraceLLM SDK]

B --> C[Trace Collector]

C --> D[(SQLite)]

C --> E[Live WebSocket Stream]

E --> F[Dashboard]

D --> G[Replay Engine]

G --> F
Loading

How It Works

sequenceDiagram

participant User
participant App
participant TraceLLM
participant LLM
participant SQLite

User->>App: Ask Question

App->>TraceLLM: Start Trace

TraceLLM->>LLM: Send Prompt

LLM-->>TraceLLM: Response

TraceLLM->>SQLite: Save Trace

TraceLLM-->>App: Return Result

App-->>User: Final Answer
Loading

Installation

Install directly from PyPI.

pip install tracellm-cli

Verify installation:

tracellm --help

Start TraceLLM:

tracellm start

Expected output:

✓ SQLite initialized
✓ API ready
✓ WebSocket ready
✓ Dashboard ready
✓ Opening browser...

Zero Configuration Setup

TraceLLM now uses SQLite by default.

No MongoDB required.

No database setup required.

No .env configuration required.

Running:

tracellm start

automatically:

✓ Creates local SQLite database

~/.tracellm/traces.db

✓ Starts API server

✓ Starts dashboard

✓ Opens browser automatically

Installation

Install directly from PyPI.

pip install tracellm-cli

Verify installation:

tracellm --help

Start TraceLLM:

tracellm start


OpenAI Example

from openai import OpenAI
from tracellm.integrations.openai import trace_openai

client = OpenAI()

trace_openai(client)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "user",
            "content": "Explain quantum computing"
        }
    ]
)

LangChain Example

from tracellm.integrations.langchain import trace_langchain

trace_langchain()

# existing LangChain code continues normally

Replay Executions

One of TraceLLM's most powerful features.

Replay previous executions step-by-step.

Prompt
 ↓
Tool Call
 ↓
Tool Result
 ↓
LLM Response
 ↓
Final Output

Perfect for:

  • Agent debugging
  • Failure analysis
  • Performance optimization
  • Prompt engineering

Real-Time Monitoring

graph TD

A[Agent]
--> B[TraceLLM]

B --> C[Live Dashboard]

C --> D[Prompt Stream]

C --> E[Tool Calls]

C --> F[Latency Metrics]

C --> G[Errors]
Loading

Trace Lifecycle

START TRACE
    ↓
Capture Prompt
    ↓
Capture Model Response
    ↓
Capture Tool Calls
    ↓
Calculate Latency
    ↓
Store Execution
    ↓
Stream Live Updates
    ↓
END TRACE

Performance Metrics

Metric Description
Prompt Count Total prompts executed
Token Usage Input/output tokens
Latency Response time
Error Rate Failed executions
Tool Usage Tool invocation count
Success Rate Completed traces

Example Dashboard Insights

Total Traces       : 12,431
Successful Traces  : 12,007
Failed Traces      : 424

Success Rate       : 96.58%

Average Latency    : 1.4 sec

Tool Calls         : 31,204

Tokens Processed   : 8.7M

Tracey 🦖

Meet Tracey.

The official TraceLLM dinosaur mascot.

Tracey helps users:

  • Install TraceLLM
  • Create first traces
  • Troubleshoot issues
  • Understand observability concepts
  • Navigate the documentation

You'll find Tracey throughout the documentation helping guide you.


v0.3

  • CLI themes
  • Multi-project support
  • Better dashboards
  • Search traces
  • Export traces

v0.4

  • Trace filtering
  • Trace comparison
  • Dashboard customization

v0.5

  • OpenTelemetry support
  • Distributed tracing
  • Production deployment tooling

Contributing

Contributions are welcome.

git clone https://github.com/YOUR_USERNAME/tracellm

cd tracellm

pip install -r requirements.txt

python main.py

Open a Pull Request.


Community

  • GitHub Discussions
  • Issues
  • Feature Requests
  • Bug Reports

License

MIT License.


Star History

⭐ If TraceLLM helps you build better AI systems, consider starring the repository.


Final Goal

TraceLLM aims to become the open-source observability layer for AI applications.

Build agents.

Trace everything.

Debug faster.

Ship confidently.

🦖 Powered by Tracey.

About

Open-source LLM observability platform → track prompts, token usage, latency, retries, hallucinations, tool calls, agent execution paths. PostgreSQL stores traces. WebSocket streams logs live.

Resources

License

Stars

6 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors