Skip to main content

Generate a report in LiteLLM Lens

Since v0.8.0

Use Reports to investigate a question about agent traces already in Lens. Choose a template or write your own question, set an analysis budget, select the traces, and generate a report with findings and recommended changes

Before you start​

You need traces in Lens, a connected analysis model, and administrator access to generate reports. People with read access can open completed reports

Open Reports. If Lens asks you to connect an analysis model, select Set up analysis and finish that setup before generating the report. You can choose a template first

If you have no reports, Lens opens the template page. If you have existing reports, select Generate report

1. Choose a template or write a question​

Select a template to fill in Question and What to look for. Edit either field before running the report

TemplateRun onInvestigate
Cost efficiencyCoding agentsRepeated work, failed commands, context growth, and cost-reduction experiments
Engineering workflowsCoding agentsWork that shared instructions, scripts, or tools could support
Resolution qualitySupport agentsUnresolved requests, repeated troubleshooting, and escalation decisions
Knowledge gapsSupport agentsMissing guidance, failed retrieval, and conflicting answers
Tool reliabilityTool-using agentsTool failures, repeated calls, and workarounds
Unexpected usageAny agentUsage boundaries and attempts to redirect the agent

To investigate something else, select Write your own question. Enter the question you want answered and use What to look for to explain the context, comparisons, and output you need

For a coding-agent review, you could enter:

Question

Where do our coding agents spend time on avoidable setup?

What to look for

Examine repeated dependency installation, test-service startup, and failed test commands. Compare sessions that reuse an existing environment with those that rebuild it. Preserve test isolation. Recommend the first change to make and a task we can rerun to check it

Keep the question connected to evidence the traces contain. To investigate support resolution, include the conversation and tool results that show whether the customer's request succeeded. A polite final answer alone does not establish resolution

2. Set the analysis budget​

Enter your budget in Analysis spending limit (USD). This limit applies to generating the report. It is separate from the agent usage costs recorded in the selected traces

The form shows an estimated analysis cost when an estimate is available. Use the estimate to choose a starting budget, not as a guarantee of total spend or completion time

A larger scope can require more analysis. If the report reaches its limit, read its review limits before acting on the findings. An incomplete review can preserve useful findings, but it does not establish that Lens examined the whole selection

3. Select the agents and traces​

Under Agents, choose one or more agents, or select All agents. Set Time range to the period you want to examine. For Custom dates, enter From and To using your local time. The completed report records the time window and timezone

Open More options to narrow the selection. Use Only traces matching a signal for a saved signal, or Add metadata filter to match a metadata key and value from your traces

To cap the review, enter a whole number from 1 to 1,000 in Maximum traces (optional), beside the analysis spending limit. Leave it blank to select up to 100 traces. The maximum applies to traces selected for analysis; matching-trace counts and measured totals still cover the full filtered scope

Before running, check the matching trace count and the number selected for analysis. Broaden the time range or remove a filter if no traces match. For a comparison, include the relevant counterexamples: successful deliveries as well as bounces, or required setup as well as repeated setup

Configure a question, agent scope, analysis budget, and optional maximum traces

4. Generate the report​

Select Generate report. The report page shows the current analysis, delegated tasks when present, elapsed time, and analysis spend

A timing estimate depends on the information available. An estimate of time until the spending limit is not a promised completion time

You can leave the page and return through Reports. Open the report under In progress while it runs or Completed reports when it finishes

5. Review and test a recommendation​

Start with Recommended changes. Select a finding to read the observed sequence, supporting traces, and suggested verification

Completed coding report with recommended changes followed by measurements and evidence

This walkthrough uses fictional sessions to show the report format

Check the report's scope and review limits. Recorded totals can cover a broader selection than the traces examined for a finding. Missing cost or timing data also limits what you can conclude

For example, “Keep the test environment running between tasks” should explain which sessions repeated setup and whether that setup was necessary. Test it on the same tasks with the same assertions and isolated test data. Compare the new results before treating the proposed change as a saving

Use Copy link to share the report with someone who has access to Reports. Use Download Markdown to save the document. Select Run again to review the question and scope before generating another report. Lens restores the saved maximum-traces setting so you can keep or change it

If the report cannot finish​

Open the report under Needs attention, read the error, and select Edit and try again. Check the analysis-model connection and the trace selection. If the earlier review exhausted its budget, narrow the question or scope, or increase the analysis spending limit within the supported range