Langfuse can trace RedPill calls through its OpenAI SDK wrapper. It records latency, usage, errors,
and, by default, model inputs and outputs.
Langfuse is a separate observability destination. Traced prompts and responses leave RedPill’s
trust boundary and are subject to your Langfuse deployment, retention, and access controls.
Install the current Python SDKs and set both services’ credentials:
Use your own LANGFUSE_BASE_URL for a self-hosted deployment.
Trace a request
Import OpenAI from langfuse.openai, then configure RedPill as the API endpoint:
The wrapper accepts the same streaming and async calls as the OpenAI SDK. Add trace names,
session identifiers, and low-sensitivity metadata only when they are useful for debugging or
aggregation.
Decide what to export
Before enabling tracing in production:
- Classify prompts, responses, tool arguments, retrieved documents, and metadata.
- Configure Langfuse masking before those values leave the application, or omit content entirely.
- Set retention and access controls for the Langfuse project.
- Use a self-hosted Langfuse deployment when its data must remain inside your own boundary.
Masking changes telemetry only; it does not change the request sent to RedPill. If another
OpenTelemetry exporter is active, configure its redaction separately.
Costs and receipts
Langfuse cost estimates depend on a matching model definition. RedPill model IDs or prices may need
a custom definition under Project Settings > Models. Treat the RedPill dashboard as the billing
source of truth.
Langfuse does not verify RedPill’s signed receipts. Fetch and verify a receipt separately when the
serving path is part of your security decision.