OptionaladmissionPresent only when bounded admission classes are configured.
Underlying async-bulkhead-ts-compatible stats.
OptionaldeduplicationPresent only when deduplication is enabled.
Number of distinct in-flight deduplication keys.
Cumulative requests that shared an existing in-flight call.
Currently applied atomic admission-limit snapshot.
LLM-layer request stats.
OptionalobservePresent after at least one observe-mode bypass has occurred.
OptionaltokenPresent only when tokenBudget is configured.
Budget headroom reserved for priority: "high" requests.
Cumulative actual tokens consumed (usage.input + usage.output),
summed across releases that reported TokenUsage. Releases without
usage contribute 0 — totalConsumed is meaningful only when
getUsage is wired up consistently. Not clamped: over-consumption
(actual > reserved) is reported as-is.
Cumulative tokens held beyond original reservations because
reportUsage() reported consumption exceeding the reserved hold.
Overrun expands inFlightTokens (possibly above budget), which
correctly blocks new admissions until the overrunning work releases.
stop.overrunAllowanceTokens (v3.18) bounds how far it can go.
Cumulative tokens returned to the budget via the refund mechanism —
both early refunds from reportUsage() and refunds at release.
Cumulative tokens reserved at admission across all successful admissions. Monotonically increasing.
async-bulkhead-llm — public API surface.
This entry point re-exports everything the package supports; the implementation lives in focused modules:
types.ts— request/result/options/stats/event typeserrors.ts—LLMBulkheadRejectedErrorand the two errors for admitted work that ended earlyprofiles.ts—PROFILESpresetsestimators.ts— naive + model-aware estimators,extractTextLengthadaptive.ts—createAdaptiveTokenEstimator(v3.8)dedup.ts— deduplication internals (keying, share safety)validation.ts— internal numeric/estimate/usage guardsbulkhead.ts—createLLMBulkhead: validates options and wires the engine parts togetherreconfigurable-bulkhead.ts— internal concurrency gate (global slot count and queue)engine/— the parts of the admission engine, one concern per file (limits, token ledger, class slots, admission counts, capacity checks, the admitted token,run(), observe mode, deduplication, stats, shutdown, the running calls and the stop triggers); the full list is in the header ofbulkhead.tsDeep-importing the internal modules is not supported; the package
exportsmap exposes only this entry point.