Expand description
Cost calculation, usage tracking, and pricing. Cost calculation, usage tracking, and pricing logic.
Structs§
- Endpoint
Usage - Accumulated usage for a single endpoint.
- LlmResponse
- Result of an LLM chat call including usage data.
- LlmUsage
- Usage info extracted from an LLM API response.
- Usage
Snapshot - Aggregated usage across all endpoints for a test or scenario run.
- Usage
Tracker - Thread-safe usage tracker for the test runner.
Functions§
- calculate_
llm_ cost - Calculates the cost of an LLM call based on token pricing.
- extract_
usage - Extracts token usage from an OpenAI-compatible API response JSON.