async-bulkhead-llm - v3.17.0
    Preparing search index...

    Type Alias AdaptiveTokenEstimator

    type AdaptiveTokenEstimator = {
        estimator: TokenEstimator;
        corrections(): AdaptiveModelCorrection[];
        observe(request: LLMRequest, usage: TokenUsage): void;
        reset(model?: string): void;
    }
    Index
    estimator: TokenEstimator

    The estimator to pass as tokenBudget.estimator.

    • Record one completed call: the request as estimated, and the provider-reported actual usage. Wire this to the bulkhead's release event: on("release", (e) => { if (e.usage) observe(e.request, e.usage) }). Observations with a zero base input estimate are ignored (no ratio can be formed). Throws if usage fields are not non-negative integers.

      Parameters

      Returns void

    • Clear calibration for one model, or for all when omitted.

      Parameters

      • Optionalmodel: string

      Returns void