modelinfotest

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 1 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 modelinfotest holds REFERENCE formulas for tests. No production code may import it.

The accountant prices every bill (accountant.RequestCost). A test that pins the accountant to the formula that priced the same request before imports the reference from here, so the old formula has one test-only home and no production caller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoredBill

func StoredBill(p modelinfo.Price, fresh, cacheRead, cacheWrite, output, cacheWrite1h int64) float64

StoredBill is the OLD stored bill of one request: modelinfo.Price.Cost (each product rounded on its own, so no CPU fuses a multiply and an add, #1128) plus the one-hour write premium on the tokens billed at the 1-hour tier. Every write token is priced at the 5-minute rate, and the premium (1-hour rate minus 5-minute rate, never below 0) is added after. p holds the rates at the request's prompt size (Price.At).

accountant.RequestCost must give the same bits. This function exists to test that. Do not call it from production code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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