| name | langfuse-deploy-integration |
| description | Deploy Langfuse with your application across different platforms.
Use when deploying Langfuse to Vercel, AWS, GCP, or Docker,
or integrating Langfuse into your deployment pipeline.
Trigger with phrases like "deploy langfuse", "langfuse Vercel",
"langfuse AWS", "langfuse Docker", "langfuse production deploy".
|
| allowed-tools | Read, Write, Edit, Bash(docker:*), Bash(vercel:*), Bash(gcloud:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","langfuse","deployment","docker"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Langfuse Deploy Integration
Overview
Deploy Langfuse LLM observability alongside your application. Covers integrating the SDK for serverless (Vercel/Lambda), Docker, Cloud Run, and self-hosting the Langfuse server itself.
Prerequisites
- Langfuse API keys (cloud or self-hosted)
- Application using Langfuse SDK
- Target platform CLI installed
Instructions
Step 1: Vercel / Next.js Deployment
set -euo pipefail
vercel env add LANGFUSE_PUBLIC_KEY production
vercel env add LANGFUSE_SECRET_KEY production
vercel env add LANGFUSE_BASE_URL production
import { NextRequest, NextResponse } from "next/server";
import { LangfuseClient } from "@langfuse/client";
import { startActiveObservation, updateActiveObservation } from "@langfuse/tracing";
import OpenAI from "openai";
const langfuse = new LangfuseClient();
const openai = new OpenAI();
export async function POST(req: NextRequest) {
const { messages } = await req.json();
const response = (
{ : , : },
() => {
({
: ,
: messages,
: { : },
});
result = openai...({
: ,
messages,
});
({
: result.[].,
: {
: result.?.,
: result.?.,
},
});
result.[].;
}
);
.(response);
}