OptionaladmissionOptional bounded policy-class table for tenant/application isolation.
The library enforces protected floors plus hard class ceilings. Capacity
above a class floor is accounted as borrowed from the shared remainder.
Identity mapping, weights, and distributed lending policy remain gateway /
control-plane responsibilities. Class keys are fixed at construction to
keep state and metric cardinality bounded; applyLimits() may change only
their numeric limits.
OptionaldeduplicationEnable in-flight request deduplication.
true — use the default key functionDeduplicationOptions — customize the key functionfalse / omitted — disabledOptionalinitialInitial revision for the admission-limit snapshot. Default: 0.
Subsequent applyLimits() calls must use a strictly higher revision.
Maximum number of requests in-flight simultaneously. Set to 0 to
start fail-closed until a higher-revision limit snapshot enables work.
OptionalmaxMaximum number of requests waiting for admission.
Default: 0 (fail-fast). Prefer setting via profile.
Model identifier. Used by the default estimator for ratio lookup.
One bulkhead per model is the strongly recommended deployment pattern.
When routing multiple models through one bulkhead, set model on
individual LLMRequest objects for accurate estimation.
OptionalprofileOpinionated defaults for common deployment patterns. Explicit options always override profile defaults.
OptionaltimeoutWaiting timeout in milliseconds. Applies to queued requests only.
Has no effect when maxQueue is 0.
OptionaltokenToken budget enforcement. Admission fails fast when the in-flight token
ceiling is reached, regardless of concurrency headroom or profile.
Omit to disable token-aware admission.
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—LLMBulkheadRejectedErrorprofiles.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(admission, budget, events)Deep-importing the internal modules is not supported; the package
exportsmap exposes only this entry point.