Available for: Python and TypeScript.
Wrap a custom LLM call
UsestartSpan (start_span in Python) to create a span around any call — a hypothetical in-house model client, in this example:
span.setEvalScore() for attaching evaluation scores, and the run helper for linking nested wrapped calls as children.
Other building blocks
Two more primitives cover the rest of what a custom integration typically needs:- Agent tracing — use
withAgent/with_agentwhen your custom framework runs a multi-step agent loop (planning, tool calls, handoffs) rather than a single call. - OpenTelemetry integration — if your framework already emits OTel spans (OpenLLMetry, OpenInference, or any spec-compliant instrumentation), point it at Zespan’s OTLP endpoint directly, no Zespan SDK required. The same page also covers the raw OTel API (
initOTel/init_otel,getTracer/get_tracer) for directTracerProvidercontrol or dual-exporting to your own backend.
startSpan calls made inside a withAgent block automatically link to that agent’s trace.
