PeerLM SDK (legacy)
Still published, no longer a setup path — use OpenTelemetry.
The PeerLM SDK remains published for existing integrations, but it is no longer offered as the setup path for a new Monitor. Prefer OpenTelemetry: it carries richer structural and trace information and avoids adding another product-specific dependency.
Existing TypeScript integration
import { PeerLMClient } from "@peerlm/sdk";
const peerlm = new PeerLMClient({
apiKey: process.env.PEERLM_API_KEY!,
monitorId: "your-monitor-id",
sampleRate: 0.05,
});
peerlm.track({ prompt, systemPrompt, response, model, tokensIn, tokensOut, latencyMs });The SDK sends asynchronously and should never throw into the application request path. Include the production response and exact model whenever possible so observed control and cost evidence can be evaluated.
For new integrations
Open the Monitor's Sources panel and use the OpenTelemetry endpoint, authorization header, and peerlm.monitor_id resource attribute shown there.