Skip to main content

PromptMeasurementSource

Type Alias PromptMeasurementSource 

Source
pub type PromptMeasurementSource = MeasurementSource;

Aliased Type§

pub enum PromptMeasurementSource {
    Native {
        provider: String,
    },
    LocalExact {
        tokenizer: String,
    },
    Postflight,
    Heuristic,
}

Variants§

§

Native

The provider’s own token-counting endpoint answered (e.g. Anthropic messages/count_tokens, OpenAI Responses token counting, Gemini countTokens).

Fields

§provider: String
§

LocalExact

A real BPE tokenizer ran locally, but against a vocabulary that may not be the target provider’s own (e.g. cl100k standing in for a non-OpenAI vendor) — see FallbackEstimator (spc_011-C-01) for the concrete counter this describes.

Fields

§tokenizer: String
§

Postflight

The provider’s own postflight usage for this exact request, fed back after execution (spc_024-06). The authority a replay reuses — never a preflight guess.

§

Heuristic

No tokenizer ran at all; this is a coarse guess with a generous safety margin.