Langfuse integration
Langfuse is an AI platform that includes prompt management capabilities.
To reference prompts in Langfuse:
-
Install the langfuse SDK:
npm install langfuse
-
Set the
LANGFUSE_PUBLIC_KEY
,LANGFUSE_SECRET_KEY
, andLANGFUSE_HOST
environment variables as desired. -
Use the
langfuse://
prefix for your prompts, followed by the Langfuse prompt id and version. For example:prompts:
- 'langfuse://foo-bar-prompt:3'
providers:
- openai:gpt-4o-mini
tests:
- vars:
# ...
Variables from your promptfoo test cases will be automatically plugged into the Langfuse prompt as variables.