/** * Rate lookup for a turn's tokens. * * The kernel had a cost calculation and no data to feed it: `costInfo` moved * only when a host passed `pricing` to `query()`, no shipped surface passed * one, and so every turn reported a total of zero. `turnConfig.costLimitUsd` is * enforced against that same total, which made a declared budget a budget that * could never trigger. * * This is the data. It is IN-TREE and versioned at build time rather than * fetched, so a cost number is reproducible from a commit and an offline turn * still prices correctly — a runtime fetch gives neither. See * `scripts/generate-model-prices.mjs` for why the source is reviewed rather * than refreshed, and `rates.source.json` for the rates themselves. */ import type { ModelPricing } from '../utils/cost.js'; import { VENDOR_RATES } from './catalogue.generated.js'; export type { VendorRates } from './catalogue.generated.js'; export { VENDOR_RATES }; /** Lowercase, snapshot suffix removed. Exported because tests assert it. */ export declare function normaliseModelId(model: string): string; /** * The rate card for a model, or `undefined` when nobody here has one. * * `undefined` is a real answer and the caller must keep it distinct from a * rate of zero. Zero means this turn genuinely costs nothing — the local * drivers, which bill per token exactly never. `undefined` means the total is * unknowable, and a caller that flattens the two reproduces the defect this * whole module exists to remove, one level down. * * ## Matching is exact, and that is the point * * The neighbouring context-window table matches on longest substring, and it * is right to: a window guessed one size small costs a compaction pass. A rate * guessed one row across costs the caller money and moves their budget. Inside * a single vendor here, ids one character apart differ in price by 4x and by * 24x. So a near-miss is not a degraded answer, it is a wrong one, and this * returns `undefined` instead — which is safe by construction, because * `undefined` refuses rather than proceeds. * * The cost of exactness is stated rather than hidden: a model the vendor has * released since this table was reviewed is unpriced until somebody adds the * row. That is a visible, fixable gap. A silently wrong total is neither. */ export declare function resolveModelPricing(providerId: string, model: string | undefined): ModelPricing | undefined; //# sourceMappingURL=index.d.ts.map