Framework Integrations
Observyze provides zero-code proxy integrations for popular frameworks like LangChain, LlamaIndex, and the Vercel AI SDK. By routing through our proxy, all chains and LLM calls are automatically traced without needing a custom plugin.
LangChain Integration
The easiest way to trace LangChain is to point the base URL to the Observyze proxy.
TypeScript Example
import { ChatOpenAI } from "@langchain/openai";
const model = new ChatOpenAI({
configuration: {
baseURL: "https://api.observyze.com/api/v1/proxy/openai/v1",
defaultHeaders: {
"Authorization": "Bearer ob_your_api_key",
"x-project-id": "proj_123"
}
}
});Vercel AI SDK
Use the custom provider setup to route Vercel AI SDK traffic through Observyze.
Next.js Route Handler
import { createOpenAI } from '@ai-sdk/openai';
import { generateText } from 'ai';
const observyzeProvider = createOpenAI({
baseURL: 'https://api.observyze.com/api/v1/proxy/openai/v1',
headers: {
Authorization: `Bearer ${process.env.OBSERVYZE_API_KEY}`,
'x-project-id': process.env.OBSERVYZE_PROJECT_ID
}
});
export async function POST(req: Request) {
const { text } = await generateText({
model: observyzeProvider('gpt-4o'),
prompt: 'Write a poem about tracing',
});
return Response.json({ text });
}