ZenLLM

Track your first request, then add the fields that make the analysis smarter

The basic SDK integration gets usage and cost into ZenLLM quickly. The explicit context telemetry fields make the context-waste and memory-efficiency analysis much more precise.

Quickstart

Initialize ZenLLM once, configure your team or customer context, and use the provider wrapper in place of your direct OpenAI client.

import zenllm
from zenllm import OpenAI

zenllm.init(api_key="zllm_your_api_key")
client = zenllm.get_client()
client.configure(team_id="engineering", customer_id="acme-corp")

llm = OpenAI(api_key="sk-your-openai-key")
response = llm.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Summarize this document"}],
    workflow_type="summarization",
)

Context telemetry

If your workload is conversational, agentic, or retrieval-heavy, send the new explicit fields so ZenLLM can separate history growth from static prompts and retrieval overhead.

session_id / agent_run_id / agent_step
history_tokens / system_prompt_tokens
retrieved_chunks / retrieved_context_tokens
memory_strategy / cache_read_tokens / cache_write_tokens / context_fingerprint