Execution
Share model-request capacity and account for inference resources across concurrent branches.
AdmissionPool
Section titled “AdmissionPool”Limit active and queued requests, giving episodes and branches turns in the queue.
This pool runs up to eight operations at once and holds up to 64 waiting operations before rejecting further submissions.
Definition
AdmissionPool.init
Section titled “AdmissionPool.init”AdmissionPool.run
Section titled “AdmissionPool.run”AdmissionPool.cancel
Section titled “AdmissionPool.cancel”AdmissionPool.aclose
Section titled “AdmissionPool.aclose”CapacityError
Section titled “CapacityError”Report that a request could not be admitted within the configured execution-capacity bounds.
Definition
ExecutionServices
Section titled “ExecutionServices”Share request capacity, critic predictions, and usage accounting across agents. Agents derived for compaction use the same services, so compaction work is charged to the enclosing episode.
Share up to eight simultaneous generation or critic requests within this process. Pass Execution(services=services) to participating agents. Calls go directly to each agent’s policy or critic object. An outer owner can share these services across collectors with own=False; close the services after all collections finish. Model clients remain the caller’s responsibility.
Definition
Fields
ExecutionServices.attach_budget
Section titled “ExecutionServices.attach_budget”Register the branch’s resource allowance if that branch has no budget attached yet.
ExecutionServices.remaining
Section titled “ExecutionServices.remaining”Return the branch’s remaining allowance. A branch without an attached budget has the default unrestricted allowance.
ExecutionServices.charge
Section titled “ExecutionServices.charge”Deduct the supplied usage from the branch’s allowance.
ExecutionServices.astart
Section titled “ExecutionServices.astart”Enter the service lifecycle. Local resources start when first used, so the default hook performs no work.
ExecutionServices.generate
Section titled “ExecutionServices.generate”Submit a generation request and account for its model call, prompt tokens, output tokens, and any failure under the supplied owner.
ExecutionServices.predict
Section titled “ExecutionServices.predict”Submit a batch of critic contexts and account for the request under the supplied owner.
ExecutionServices.aenter
Section titled “ExecutionServices.aenter”ExecutionServices.aexit
Section titled “ExecutionServices.aexit”ExecutionServices.release_episode
Section titled “ExecutionServices.release_episode”Remove an episode’s accounting after all its work has finished. Saved checkpoints retain their resource allowances.
ExecutionServices.aclose
Section titled “ExecutionServices.aclose”Cancel active and queued requests in the pool. Policy and critic clients stay with their caller.
Identify the episode, branch, and invocation responsible for work in an admission pool.
Definition
Fields
Accumulate physical inference usage, including model calls and token counts.
Definition
Fields
ResourceBudget
Section titled “ResourceBudget”Track the model calls, prompt tokens, and output tokens a branch can still use. Each checkpoint carries its remaining allowance.
This branch can use 20 model calls and 8,192 generated tokens, with no prompt-token limit. Charging usage returns a new budget with the remaining allowance.
Definition
Fields