Langfuse
Langfuse can be used with Superagent to enable detailed production traces and a granular view on quality, cost and latency.
Website - langfuse.com
GitHub - langfuse/langfuse
Setting up Langfuse with Docker
For quickly trying out langfuse with Superagent, a basic docker compose example is provided in the folder libs/.docker/external/observabillity/langfuse/
For a production setup refer to the official documentation on self hosting Langfuse.
Run langfuse with docker compose
The following setup is provided based on the docker compose documentation from langfuse.
-
cd
into the langfuse example folder -
Copy the
.env.example
file into a.env
file -
For quickly trying out Langfuse you can keep the default environment variables, though it is advised to review them and change the
NEXTAUTH_SECRET
andSALT
to a more secure secret and a salt. -
Start Langfuse with docker compose using the provided
run.sh
script in the same folder. -
Access langfuse in the browser once the service is up.
http://localhost:3100 or http://langfuse-server:3100 if you have added the following to your
hosts
file. -
Sign up for an account using any credentials.
-
Create a project named
superagent
-
Under
settings
andAPI Keys
- create a new API Key, copy the Public Key and Secret Key. -
Enter the values in the superagent docker
.env
file located atlibs/.docker/.env
Langfuse container logs
Stop Langfuse
Use the provided stop.sh
script to stop running services for lanfguse
Uninstall Langfuse
Use the provided uninstall.sh
script to remove running services for lanfguse
Setting up Langfuse Cloud
Alternatively you can use the cloud hosted version of Langfuse.
-
Sign up for an account here https://cloud.langfuse.com/
-
Setup a project named
superagent
-
Under
settings
andAPI Keys
- create a new API Key, copy the Public Key and Secret Key. -
Enter the values in the superagent docker
.env
file