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

    Function naiveTokenEstimator

    • Estimates token usage using a flat 4-characters-per-token ratio.

      Handles both plain string and multimodal content. Non-text content blocks are ignored (treated as zero tokens).

      Accuracy: ±25% for English prose. Suitable for load-shedding; not suitable for cost accounting.

      v3.7: counts request.system alongside message content and adds request.extraInputTokens verbatim. Non-text blocks still contribute zero characters (use the model-aware estimator's opaqueBlockTokens for per-block surcharges).

      Parameters

      Returns TokenEstimate