teff.provider.concurrency¶
teff.provider.concurrency
¶
Global per-provider concurrency guards.
Shared across :class:~teff.harness.Harness instances so parallel branches
(each with its own harness) throttle model traffic together instead of
blowing past provider rate limits.
Functions:
| Name | Description |
|---|---|
provider_concurrency |
Return the current global concurrency limit for provider (if any). |
set_provider_concurrency |
Globally cap concurrent model calls for provider. |
provider_concurrency
¶
provider_concurrency(provider)
Return the current global concurrency limit for provider (if any).
Returns the active semaphore's capacity (explicit or auto-grown via
max_parallel), or None when the provider has no semaphore.
Source code in teff/provider/concurrency.py
44 45 46 47 48 49 50 | |
set_provider_concurrency
¶
set_provider_concurrency(provider, limit)
Globally cap concurrent model calls for provider.
Overrides any per-harness max_parallel for that provider.
Pass limit <= 0 to remove the cap.
Source code in teff/provider/concurrency.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |