๐Ÿ”ญ tracelet

June 10, 2026 ยท View on GitHub

๐Ÿ”ญ tracelet

Local-first DevTools for AI agents

See every tool call, prompt, and token โ€” live, 100% on your machine. No account. No Docker. No Python. Just npx @jnmetacode/tracelet.

npx @jnmetacode/tracelet

English | ็ฎ€ไฝ“ไธญๆ–‡

tracelet demo โ€” a live agent trace streams in; inspect the LLM call (prompt, tokens) and the errored tool call


Your agent is a black box. It calls an LLM, the LLM asks for a tool, the tool returns something weird, the next LLM call does something dumb โ€” and all you see in your terminal is the final answer (or a stack trace).

tracelet is the missing inspector for that loop. Point any OpenTelemetry exporter at localhost:4318, and watch your agent's execution tree stream in live: every LLM call, every tool invocation, prompts in, completions out, token counts, latency, and errors โ€” in a clean local UI that opens instantly.

Nothing ever leaves your machine.

Quick start

# 1. Start tracelet (opens http://localhost:4321)
npx @jnmetacode/tracelet

# 2. See it work with a synthetic agent trace
npx @jnmetacode/tracelet & sleep 1 && node examples/demo.js

Then point your real agent's OpenTelemetry exporter at the ingest endpoint:

http://localhost:4318/v1/traces

That's the standard OTLP/HTTP port โ€” most setups need only:

export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

Both OTLP/HTTP encodings work: protobuf (the exporter default) and JSON. No OTEL_EXPORTER_OTLP_PROTOCOL needed.

Works with what you already use

tracelet speaks the three common tracing vocabularies on the same spans, so it "just works" no matter who emitted the trace:

SourceHow
Vercel AI SDKexperimental_telemetry: { isEnabled: true } โ†’ export OTLP to localhost:4318. See examples/vercel-ai-sdk.
Python OTel SDK (LangChain, CrewAI, OpenAI Agents SDKโ€ฆ)The standard exporter works as-is (protobuf included). See examples/python-opentelemetry.
OpenInference (LangChain, LlamaIndex, CrewAI, Mastraโ€ฆ)Any OpenInference instrumentor exporting OTLP.
OpenTelemetry GenAI semconvNative gen_ai.* spans, content as attributes or events.
Anything OTelPlain spans render too โ€” you just get less semantic enrichment.

No SDK lock-in: tracelet is just an OTLP endpoint + a viewer.

Why another one?

There are great LLM observability tools. None of them own the inner debug loop for a JS/TS agent developer:

local & offlineno accountno Docker stackno Pythonlive dev-tailnpx one-liner
traceletโœ…โœ…โœ…โœ…โœ…โœ…
Arize Phoenixโœ…โœ…โœ…โŒ (pip)~โŒ
Langfuse (self-host)โœ…โœ…โŒ (PG+ClickHouse+Redis)~โŒโŒ
Laminar (self-host)โœ…โœ…โŒ (PG+ClickHouse+RMQ)~~โŒ
LangSmithโŒโŒโ€”โ€”โœ…โŒ
Helicone~ (proxy)โŒโŒ~~โŒ

tracelet isn't trying to be your production analytics warehouse. It's the thing you keep open in a second window while you're building the agent โ€” like the Network tab, but for agent runs.

Outgrew local? tracelet emits/relays standard OTLP, so graduate to any of the tools above for production without re-instrumenting.

How it works

your agent โ”€โ”€OTLP/HTTP (pb|json)โ”€โ”€โ–ถ  :4318  โ”€โ”€โ–ถ  in-memory store  โ”€โ”€SSEโ”€โ”€โ–ถ  UI :4321
                                          (ring buffer, never persisted off-box)
  • Zero dependencies. Pure Node built-ins. The whole thing is a few hundred lines you can read.
  • Two ports. 4318 ingests OTLP (the convention), 4321 serves the UI.
  • In-memory ring buffer. Last 500 traces. Restart = clean slate โ€” unless you opt in to --persist <file>, which keeps history in a local JSONL file (still your disk, still nothing sent anywhere; Clear wipes it too).
  • Cost estimates. Traces and LLM spans show a ~$ figure computed from published list prices for common models (Claude/GPT/Gemini); unknown models simply show none โ€” it never guesses.

CLI

npx @jnmetacode/tracelet [options]
  -p, --port <n>      OTLP/HTTP ingest port   (default 4318)
      --ui-port <n>   Web UI port             (default 4321)
      --persist <f>   opt-in local history (JSONL; reloaded on start)
      --no-open       don't auto-open browser

Roadmap

  • Opt-in local history (--persist traces.jsonl) โ€” done
  • Diff two runs side by side
  • Cost estimates per model (list-price ~$ on traces and LLM spans) โ€” done
  • protobuf OTLP ingest (zero-dep decoder) โ€” done
  • Waterfall flamegraph zoom
  • One-line wrappers: tracelet/vercel, tracelet/langchain

PRs welcome. This is early โ€” issues and ideas are the most useful contribution right now.

Status

Early MVP. The ingest + live UI work today (node examples/demo.js to see it). Star/watch to follow along.

Sibling projects

Part of a small, local-first, zero-dependency toolkit for building AI agents โ€” see the toolkit overview & end-to-end recipe:

  • ๐Ÿ”ญ tracelet โ€” local DevTools to debug agent runs (this repo)
  • ๐Ÿณ skillet โ€” a package manager for agent skills
  • ๐Ÿง  engram โ€” a local, private memory layer for agents (and you)

License

MIT โ€” see LICENSE.