Skip to main content
Foglamp shows you what your AI app is doing: cost, speed, token usage, full traces, and prompt/response logs. It works with agents built on the Vercel AI SDK and takes two lines of code to set up. Foglamp is TypeScript-only and supports AI SDK v4, v5, v6, and v7. You add the foglamp package to your app, and traces are sent to a backend you can run yourself or use as a hosted service.
On AI SDK v4, v5, and v6, Foglamp wraps the ai module with foglamp/wrap. On v7 (beta), it uses the SDK’s built-in telemetry API. Both produce the same traces. The Quickstart helps you pick.

Why Foglamp

One user action in an AI app can trigger several model calls, tool calls, and retries, each with its own cost and speed. Regular monitoring tools were not built for that. Foglamp is.

Cost tracking

Every span is priced as it arrives, split by input, output, reasoning, and cached tokens. If a model has no known price, you see a dash, never a wrong $0.

Traces

Each generateText or streamText call becomes a trace, with its steps and tool calls as spans. Group them into agents, workflows, and runs.

Latency

p50/p95/p99 latency and time to first token, read from the SDK’s own metrics.

Self-host or hosted

Run the whole stack with docker compose up, or point the SDK at the hosted service. The code is the same either way.

How it works

  • SDK sits in your app, collects spans, and sends them in batches. If no API key is set it does nothing at all. It never throws and never slows down your model calls.
  • Ingest API checks your API key, prices each span, and stores it.
  • Dashboard shows traces, workflows, agents, sessions, cost, evals, and alerts. See the dashboard tour.

Next steps

Quickstart

Install the SDK and see your first trace in minutes.

Data model

Learn what traces, spans, workflows, runs, and sessions are.

SDK reference

Every option and integration method.

Dashboard tour

Traces, workflows, agents, sessions, evals, cost, and alerts.

Self-hosting

Run the full stack on your own servers.

Troubleshooting

Not seeing traces? Common causes and fixes.