compass.utilities.costs#

COMPASS cost computation utilities

Module attributes

LLM_COST_REGISTRY

LLM Costs registry

Functions

compute_cost_from_totals(totals)

Compute total cost from total tracked usage

compute_total_cost_and_token_from_totals(totals)

Compute total cost and token counts together from tracked usage

compute_total_cost_from_usage(tracked_usage)

Compute total cost from total tracked usage

compute_total_tokens_from_totals(totals)

Compute total prompt/response token counts from tracked usage

cost_for_model(model_name, prompt_tokens, ...)

Compute the API costs for a model given the token usage