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 — use the raw OTel API (
initOTel/init_otel,getTracer/get_tracer) if you need direct control over theTracerProvider, or want to dual-export to your own OTel backend alongside Zespan.
startSpan calls made inside a withAgent block automatically link to that agent’s trace.
