MCPcopy Index your code
hub / github.com/latitude-dev/latitude-llm

github.com/latitude-dev/latitude-llm @python-sdk-7.4.0 sqlite

repository ↗ · DeepWiki ↗ · release python-sdk-7.4.0 ↗
13,200 symbols 49,635 edges 4,048 files 1,321 documented · 10%
README

Latitude — issue detection for AI agents

New: Latitude MCP server: connect your AI agent to Latitude →

Open source AI Agent Monitoring

Sentry, but for agents and LLMs.

License Build Commits last month npm downloads PyPI downloads GitHub stars Follow on X

Website  ·   Docs  ·   Changelog  ·   Slack  ·   X

<img src="https://github.com/latitude-dev/latitude-llm/raw/python-sdk-7.4.0/docs/assets/readme/gif-ui-light.gif?raw=true" alt="Demo of the Latitude UI showing LLM observability, issue tracking, and evals" width="800"/>

🌈 Why Latitude?

Latitude shows you what will break next in your AI Agent and helps you fix it before users notice.

  • Issue-centric: failed traces grouped into tracked issues, with status, size, and trend.
  • Human-aligned evals: evals built automatically from your team's judgments, with an alignment score that tracks drift from human judgment over time.
  • Agent-native traces: multi-turn sessions, tool calls, and full execution paths in one view.
  • Semantic search: find any trace by meaning, exact matches, or roughly similar sentences. No sampling, 100% of traces are searchable.
  • Issue alerts: get notified the moment a new issue is detected or an existing one escalates. Connect Slack, email, or webhooks.
  • MCP server: everything you can do in the Latitude UI, now available from your coding agent via MCP.

📚 Table of contents

⚡ Quick start

You can use Latitude for free, including 20K credits/month, 30-day data retention, and unlimited seats.

Sign up at latitude.so and grab your API key and project slug.

Recommended: ask your coding agent

Paste this prompt into Claude Code, Cursor, Windsurf, Codex, OpenCode, or another coding agent:

Read the Latitude Telemetry AI skill from https://raw.githubusercontent.com/latitude-dev/skills/refs/heads/main/skills/latitude-telemetry/SKILL.md and add tracing to this application.

Manual TypeScript setup

npm install @latitude-data/telemetry

This example uses OpenAI; replace it with the LLM SDK your app already imports.

import { Latitude } from "@latitude-data/telemetry";
import OpenAI from "openai";

const latitude = new Latitude({
  apiKey: process.env.LATITUDE_API_KEY!,
  project: process.env.LATITUDE_PROJECT_SLUG!,
  instrumentations: { openai: OpenAI },
});

const client = new OpenAI();

await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello" }],
});

await latitude.shutdown();

Every supported LLM call now shows up as a trace in Latitude. Use capture() at request, conversation, or agent boundaries when you want to add user IDs, session IDs, tags, or metadata.

Python and any OpenTelemetry-compatible runtime are also supported. Full setup, provider guides, and OTel passthrough are in the Start tracing guide.

🔌 Integrations

Latitude is provider-agnostic. Telemetry works out of the box with most model providers and frameworks (OpenAI, Anthropic, Bedrock, Vercel AI SDK, LangChain, and more), plus any OTEL-compatible application.

See the full integration list for setup instructions.

✳️ With Claude Code

Building inside Claude Code? We have a dedicated package that captures full session transcripts as traces. Check out docs.

npx -y @latitude-data/claude-code-telemetry install

Works in the terminal, the Desktop app, and IDE extensions.

🛠️ Development

Check out the Development setup and the Contributing guide to get started contributing to Latitude.

🏠 Self-host

Latitude is self-hostable at any scale, on fully open infrastructure. Pull the ready-to-go container images on Docker Hub:

Deploy on Railway

  • Single-host (simple) — a production-grade instance on one machine with Docker Compose, follow the Single-host guide.
  • Cluster (advanced) — a scalable, highly-available deployment on Kubernetes via a Helm chart, follow the Cluster guide.
  • One-click (Railway) — the whole stack on managed infrastructure, easy deploy through Railway.

👥 Community

Join the Slack community to ask questions, share feedback, and show what you're building.

📄 License

Latitude is licensed under the MIT License.

🤝 Contributing

Contributions are welcome. Read the Contributing Guide to get started, then join the Slack community, open an issue, or submit a pull request.

New to the project? Good first issues are a friendly place to start.

🧑‍💻 Thanks to all of our contributors

geclos csansoon andresgutgon neoxelox learningbizz cesr guillemwilly paulacavero ntizish Ashad-h cballou samufyi daavidrgz Bald1nh0 txus felpasl NewtTheWolf baibhavKumar1 cursoragent david8z eltociear marcos-muino-garcia PeterDaveHello timneutkens VaibhavWakde52 zhyd1997 buweiyuqi monotykamary <a href="https://github.com/wnor543" title="wnor543

Extension points exported contracts — how you extend this code

AnalyticsQueryReaderShape (Interface)
(no doc) [10 implementers]
packages/domain/spans/src/ports/analytics-query-reader.ts
ILogger (Interface)
(no doc) [6 implementers]
packages/sdk/typescript/src/core/logging/logger.ts
Logger (Interface)
(no doc) [5 implementers]
packages/telemetry/claude-code/src/logger.ts
SlackOAuthStateRedis (Interface)
(no doc) [4 implementers]
apps/web/src/server/slack-oauth-state.ts
ReportInput (Interface)
* MD report shape, the document the user reviews + commits when adopting a * winner. Target-agnostic scaffolding (heade
tools/ai-benchmarks/src/optimize/report-renderer.ts
CachedOAuthTokenAuthResult (Interface)
* Wire shape used in Redis. OAuthTokenAuthResult.expiresAt is a `Date` * in memory but JSON-serialized as ISO 8
packages/platform/oauth-token-auth/src/validate-oauth-token.ts
TraceIngestionRateLimitRedis (Interface)
(no doc) [2 implementers]
apps/ingest/src/rate-limit/trace-ingestion.ts
TouchBufferConfig (Interface)
* Configuration options for TouchBuffer.
apps/api/src/middleware/touch-buffer.ts

Core symbols most depended-on inside this repo

json
called by 1463
packages/platform/testkit/src/hono/test-client.ts
get
called by 1066
packages/domain/shared/src/cache.ts
OrganizationId
called by 805
packages/domain/shared/src/id.ts
query
called by 698
packages/domain/spans/src/ports/analytics-query-reader.ts
parse_obj_as
called by 698
packages/sdk/python/src/latitude_sdk/core/pydantic_utilities.py
ProjectId
called by 522
packages/domain/shared/src/id.ts
withPostgres
called by 511
packages/platform/db-postgres/src/with-postgres.ts
parse
called by 427
packages/domain/spans/src/otlp/content/index.ts

Shape

Function 7,651
Interface 2,353
Method 1,767
Class 1,426
Route 2
Enum 1

Languages

TypeScript85%
Python15%

Modules by API surface

apps/web/src/routes/_authenticated/projects/$projectSlug/-components/onboarding-integration-snippets.ts66 symbols
packages/domain/scores/src/ports/score-analytics-repository.ts56 symbols
packages/domain/shared/src/errors.ts50 symbols
tools/ai-benchmarks/src/scripts/benchmark-optimize.ts49 symbols
tools/live-seeds/src/runtime.ts45 symbols
packages/telemetry/python/tests/telemetry/capture_test.py43 symbols
packages/domain/organizations/src/errors.ts42 symbols
packages/sdk/python/src/latitude_sdk/datasets/client.py40 symbols
packages/sdk/python/src/latitude_sdk/client.py40 symbols
apps/workflows/src/activities/taxonomy-gardening-activities.ts40 symbols
packages/telemetry/claude-code/src/otlp.ts39 symbols
packages/domain/evaluations/src/helpers.ts39 symbols

Dependencies from manifests, versioned

@ai-sdk/amazon-bedrock5.0.0-beta.41 · 1×
@ai-sdk/anthropic4.0.0-beta.37 · 1×
@ai-sdk/google4.0.0-beta.49 · 1×
@ai-sdk/openai3.0.73 · 1×
@ai-sdk/openai-compatible3.0.0-beta.36 · 1×
@ai-sdk/openai7
@ai-sdk/otel1.0.0-beta.127 · 1×
@ai-sdk/react3.0.216 · 1×
@anthropic-ai/sdk0.104.1 · 1×
@arizeai/openinference-instrumentation-langchain4.0.12 · 1×
@aws-sdk/client-bedrock-runtime3.1069.0 · 1×
@aws-sdk/client-s33.1042.0 · 1×

Datastores touched

dummyDatabase · 1 repos
latitude_developmentDatabase · 1 repos
latitude_testDatabase · 1 repos
my_test_dbDatabase · 1 repos

For agents

$ claude mcp add latitude-llm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact