dragon.ai.inference.batching.Batch
- class Batch[source]
Bases:
objectA collection of items to be processed together.
- __init__(items: List[BatchItem], batch_id: int, created_at: float)[source]
Initialize a Batch instance.
Methods
__init__(items, batch_id, created_at)Initialize a Batch instance.
Attributes
Extract chat-template continuation flags from the batch.
Extract formatted prompts from batch items.
Extract per-request JSON schema overrides from the batch.
Extract latency metrics from batch items.
Extract response queues from batch items.
Get the batch size.
Extract per-request tool definitions from the batch.
Extract user prompts from batch items.
- __init__(items: List[BatchItem], batch_id: int, created_at: float)[source]
Initialize a Batch instance.
- property response_queues: List[Queue]
Extract response queues from batch items.
- Returns:
List of response queues.
- Return type:
list[dragon.native.Queue]
- property latency_metrics: List[Tuple[float, float, float]]
Extract latency metrics from batch items.
- property tools_list: List[List[Dict[str, Any]] | None]
Extract per-request tool definitions from the batch.
Chat requests may carry OpenAI-style tool schemas. The batch preserves one entry per request so the LLM process can apply each request’s tool definitions when formatting chat messages.
- property json_schema_list: List[dict | None]
Extract per-request JSON schema overrides from the batch.
A schema entry enables vLLM guided or structured decoding for that request.
Nonemeans the request should use free-form generation.