Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

0xtrace

Proxy-based LLM telemetry SDK for 0xtrace

agentsllmobservabilityopenaipromptopstelemetrytracing
Published23 May 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

0xtrace

CodeAutopsy Health

→ Live Demo

0xtrace Dashboard

AI observability infrastructure for LLM applications. Intercept every call, visualize prompt deltas, and kill context bloat before it kills your budget.


The Problem

Building LLM agents in production is flying blind. Context windows silently expand as system prompts grow, tool outputs inject massive JSON payloads, and RAG pipelines append thousands of tokens per step. By Step 6 of an agent loop you're paying for 80k tokens — and you have no idea what's in there.

Standard logging doesn't help. You need to see exactly what changed between Step 4 and Step 5.

The Solution

0xtrace wraps your LLM client with a zero-overhead proxy that intercepts every call asynchronously. It stores prompt structures using a keyframe + delta model — full snapshot on Step 1, strict JSON diffs on every subsequent step. The dashboard renders those diffs as a visual X-Ray, exposing rogue context injections instantly.


Architecture

Your AI App └── wrapOpenAI(client, tracer) ← proxy intercepts every call, <2ms overhead └── POST /api/ingest ← validates API key → injects project_id → Redis └── Upstash Redis ← absorbs infinite loops, never blocks └── cron drain ← batches 100 traces/min into Supabase └── Dashboard ← scoped per project, full diff replay Key design decisions:

  • Non-blocking capture — telemetry fires in a microtask (Promise.resolve().then()), zero latency added to your agent
  • Queue buffer — Redis absorbs burst traffic; direct Postgres writes would collapse under agent loops
  • Diff-only storage — Step 1 stores the full prompt array, Steps 2–N store only {added, removed, tokenDelta}. ~85% storage reduction on multi-step agents
  • Multi-tenant RLS — every data row is scoped to a project; Supabase Row Level Security enforced at the database layer

Tech Stack

LayerTechnology
FrameworkNext.js 16 (App Router, React Server Components)
DatabaseSupabase (PostgreSQL + Row Level Security)
QueueUpstash Redis
AuthSupabase Auth (GitHub OAuth)
StylingTailwind CSS (dark-mode, developer-focused)
LanguageTypeScript (strict mode, zero any)
DeployVercel (Hobby) + cron-job.org
SDKnpm 0xtrace — published, open source

SDK

Install the tracer in your AI application:

npm install 0xtrace
import OpenAI from "openai";
import { Tracer, wrapOpenAI } from "0xtrace";

const tracer = new Tracer({
  ingestUrl: "https://0xtrace-mu.vercel.app/api/ingest",
  apiKey:    process.env.INGEST_API_KEY,
});

// Works with any OpenAI-compatible provider (OpenAI, Groq, Together, etc.)
const client = wrapOpenAI(new OpenAI({
  apiKey:  process.env.GROQ_API_KEY,
  baseURL: "https://api.groq.com/openai/v1",
}), tracer);

// Every call is now automatically traced — no other changes needed
const response = await client.chat.completions.create({ ... });

Every chat.completions.create call is intercepted, measured, and sent to your dashboard asynchronously. Your application sees zero added latency.


Self-Hosting

1. Clone & Install

git clone https://github.com/Sidhant0707/0xtrace.git
cd 0xtrace
npm install

2. Environment Variables

# .env.local
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
CRON_SECRET=
NEXT_PUBLIC_APP_URL=http://localhost:3000

3. Database

Run the SQL migrations in your Supabase SQL Editor:

-- profiles, projects, api_keys tables with RLS
-- llm_calls + prompt_snapshots with project_id scoping
-- See /supabase/migrations/ for full schema

4. Run

npm run dev

Visit http://localhost:3000 → sign in with GitHub → create your first project → copy your API key.


Dashboard Features

  • Sessions — every agent run as a timeline, grouped by session ID
  • Explorer — raw call browser, filterable by model, status, session prefix
  • Diff X-Ray — step-by-step prompt delta visualizer with +added / −removed diff view
  • Cost Analysis — daily spend chart, model breakdown, top sessions by cost, latency distribution
  • Anomaly Detection — token explosion, high latency, cost spikes, SDK-flagged calls
  • Settings — API key management (generate, revoke), project deletion with cascade

Author

Sidhant Kumar
LinkedIn · Email

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
diff
Environment
{
  "local_name": "diff",
  "alias": false,
  "peer_metadata": null
}
^9.0.0runtime
openai
Environment
{
  "local_name": "openai",
  "alias": false,
  "peer_metadata": null
}
^6.38.0runtime
cac
Environment
{
  "local_name": "cac",
  "alias": false,
  "peer_metadata": null
}
^6.7.14development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^8.5.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^6.0.3development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^25.9.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "d2013108b7dc8a4ffc2897a4dbc0b7b8ac9834c1",
  "tarball": "https://registry.npmjs.org/0xtrace/-/0xtrace-1.0.1.tgz",
  "fileCount": 11,
  "integrity": "sha512-XQ6uYUgjFjuONxAtIske+1iZjwN/BIl0vOT+01S3qeOOyVzqzighnHDoIaScm2/K8Bc3IbhwtnJasSzs7Ah96A==",
  "signatures": [
    {
      "sig": "MEQCIE/1Zzdfr27dZZs+5ypNtrRmz2I09FXcjgOLOIcze/8YAiBJJuWor/rUYviR3ZLH2FgDLMtwi1DC+wrk1PkfczSFBg==",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 77143
}

Repository

PENDING
sidhant0707/0xtrace

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:9b048b4c42dfbb41c6f1777d72e23134a9ad41f452bd9bc44f0e9b0ae4284a4f

Other collected versions

1.2.025 May1.1.124 May1.1.024 May1.0.523 May1.0.323 May1.0.223 MayView all collected versions →