Skip to main content
ClaudeChatGPT

Langfuse Setup

Langfuse is an LLM engineering platform that helps you monitor, debug, and optimize your AI pipelines. It offers both self-hosted and cloud versions. With Langfuse, you can more easily debug and monitor your AI pipelines to understand what's happening under the hood.

Wren AI supports Langfuse for AI pipeline tracing and monitoring. After you have installed Wren AI, you can start using Langfuse by following the steps below.

info

In this guide, we will use the cloud version of Langfuse. If you want to use the self-hosted version, please refer to the Langfuse documentation.

To successfully connect to your own Langfuse instance from Wren AI, please make sure the following are configured correctly:

  1. You have a Langfuse instance running.
  2. You have the correct langfuse_host in ~/.wrenai/config.yaml.
  3. Wren AI (which runs in a Docker container) can access the Langfuse instance.

How to Set Up Langfuse

  • Go to Langfuse and click the "Sign Up" button to register an account.
    note

    Make sure your data region is set to EU, which means the langfuse_host is https://cloud.langfuse.com, the same as the default value of langfuse_host in Wren AI. Otherwise, you need to change the value of langfuse_host in ~/.wrenai/config.yaml to https://us.cloud.langfuse.com later.

    sign up
  • Create a new organization and project. create organization create project
  • Copy the secret key and public key from the project settings and fill them into the ~/.wrenai/.env file. Two keys, LANGFUSE_PUBLIC_KEY= and LANGFUSE_SECRET_KEY=, should already be inside. get api key
  • Relaunch Wren AI using the launcher.

How to Use Langfuse

After you have set up Langfuse and restarted Wren AI, ask a question in Wren AI and you will see traces appear in the Langfuse traces tab within a few seconds. The IDs are clickable, and you can see the details of the traces inside.

trace

On the trace details page, you can see the details of the trace, including the prompt, response, and execution time of each step.

trace details