Documentation
¶
Overview ¶
Package cost is the Stage-1 namespace for cost-tracking types and functions in package engine. See ../REFACTOR_PLAN.md.
New code in hawk should import this package instead of reaching into engine for cost symbols. Implementation will move here in Stage 2.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDisplay ¶
FormatDisplay renders a USD value for terminal display.
func LoadHistory ¶
LoadHistory reads persisted cost entries from analytics storage.
func ModelPricing ¶
ModelPricing returns input + output USD-per-million-token prices for a model.
Types ¶
type ModelPrice ¶
type ModelPrice = engine.ModelPrice
ModelPrice is a per-million-token price tuple for a single model.
type Optimizer ¶
type Optimizer = engine.CostOptimizer
Optimizer recommends cheaper models / shorter prompts when costs trend up.
type Recommendation ¶
type Recommendation = engine.Recommendation
Recommendation is an Optimizer's suggested change.
type RequestCost ¶
type RequestCost = engine.RequestCost
RequestCost is the cost of a single LLM request.
type Tracker ¶
type Tracker = engine.CostTracker
Tracker accumulates per-session cost and persists it to analytics.
func NewTracker ¶
NewTracker returns a tracker scoped to the given session.