Skip to main content

Langfuse Setup

Langfuse is an llm engineering platform that helps you monitor, debug, and optimize your ai pipelines. It supports self-host and cloud version. With Langfuse, you can more easily debug and monitor your ai pipelines to understand what's happening under the hood in your ai pipelines.

Wren AI supports Langfuse for ai pipelines tracing and monitoring. After you have installed Wren AI, you can start to use 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-host version, please refer to the Langfuse documentation.

In order to successfully connect to your own Langfuse instance from Wren AI, please make sure these several extra setups 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 is running in docker container) could access the Langfuse instance.

How to Setup 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 in the ~/.wrenai/config.yaml file. There should be two keys: LANGFUSE_PUBLIC_KEY= and LANGFUSE_SECRET_KEY= inside already. get api key
  • Relaunch Wren AI using the launcher

How to Use Langfuse

After you have setup Langfuse and restart Wren AI, when you ask a question in Wren AI, you can start to see traces in Langfuse in the traces tab in a few seconds. The IDs are clickable, and you can see the details of the traces inside.

trace

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

trace details