initcost

package
v0.0.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package initcost is init being up front about its cost, since it is never bounded (design 10 Q6): what a token of its spend is worth, and the table of what each phase spent. Spend reads in weighted tokens first, with about what it cost beside it when prices are known.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Table

func Table(rows []Row) string

Table is rows as a markdown table, with their total, the raw counts beside the weighted tokens and the cost estimate.

func Unit

func Unit(c *spend.Cache, agent string) string

Unit says what a token of a run of the adapter named agent is worth: an input token of its default model, at its cached price, or a raw token while no price is known.

Types

type Row

type Row struct {
	Phase                      string
	Input, CachedInput, Output int64
	Weighted                   spend.Spend
}

Row is one phase's tokens, raw and Weighted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL