Interface ICostCalculator

Assembly: redb.Route.Llm.dll

Prices one provider response so a cost budget can be enforced. The engine asks this once per
iteration and once before the first call (to prove the model can be priced at all).

Return null only when this deployment cannot price the call at all — a model whose rates it
does not know. A calculator that knows the rates returns 0m for zero usage; returning
null there would make the engine refuse a cost-budgeted run it could actually enforce.

public interface ICostCalculator

Methods

Estimate(LlmUsage, LlmConnectionFactory)

Estimated cost in USD for one response, or null when the model cannot be priced.

decimal? Estimate(LlmUsage usage, LlmConnectionFactory factory)