---
title: "Langfuse"
description: "LLM tracing for the ai module."
url: https://plate.findmalek.engineer/docs/langfuse
markdown: https://plate.findmalek.engineer/docs/langfuse.md
group: "Modules"
---

# Langfuse

The `langfuse` module sends traces of AI SDK calls to [Langfuse](https://langfuse.com), cloud or self-hosted. It requires the [`ai`](https://plate.findmalek.engineer/docs/ai.md) module, which the cli turns on for you. It is off by default.

```bash
findplate create my-app --modules langfuse
```

## What it adds

Files and folders:

- `apps/api/src/langfuse.ts`

Packages:

- `@langfuse/otel`
- `@langfuse/vercel-ai-sdk`
- `@opentelemetry/sdk-node`

## Env keys

```bash
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_BASE_URL=https://cloud.langfuse.com
```

`apps/api/src/langfuse.ts` registers the OpenTelemetry span processor. Without the keys nothing is sent. A compose file is in [self-hosted tools](https://plate.findmalek.engineer/docs/self-hosted.md#langfuse).

## Remove

Run `findplate remove langfuse` in the project, see [add and doctor](https://plate.findmalek.engineer/docs/add-doctor.md#findplate-remove). It deletes the files the module owns, strips its code from shared files and drops its packages, only where you haven't edited them.

If you'd rather do it by hand: for a new project leave `langfuse` out of `--modules`. In a project that already exists, delete the paths above, drop its packages from the `package.json` files, remove its env block and fix what `pnpm check-types` reports.

## Swap

Point `LANGFUSE_BASE_URL` at your own instance.
