gliner.streaming module¶
Synchronous fixed-batch and asynchronous streaming inference surfaces.
- class gliner.streaming.AsyncStreamingEngine(model, *, max_batch_size=32, batch_wait_timeout_ms=2.0, queue_capacity=4096)[source]¶
Bases:
objectDynamically microbatch independently arriving streaming sessions.
- async append(session_id, text, labels, *, threshold=0.5, flat_ner=True, multi_label=False, return_class_probs=False, recompute=False)[source]¶
Queue one append; concurrent callers are dynamically microbatched.
- class gliner.streaming.StreamingBatch(model, session_ids, labels)[source]¶
Bases:
objectPersistent fixed-order batch for synchronous streaming inference.
The session-to-row mapping is immutable, allowing the decoder KV cache to remain batched between calls without stacking or splitting historical keys.
- property closed: bool¶
- property initialized: bool¶