Skip to content

src/dazzle_back/runtime/llm_queue.py

Generated: 2026-03-30T04:38:47.530192+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Background job queue for async LLM intent execution.

Provides: - In-process async queue with configurable workers - Per-model semaphore (concurrency cap) - Per-model token bucket (rate limiting) - AIJob lifecycle management (pending → running → completed/failed) - LLM event emission on completion/f...

Key Exports

  • TokenBucket
  • LLMJob
  • LLMJobQueue
  • acquire
  • submit
  • start
  • shutdown
  • pending_count

Dependencies

Imports

  • __future__.annotations
  • asyncio
  • logging
  • time
  • collections.abc.Awaitable
  • collections.abc.Callable
  • dataclasses.dataclass
  • typing.TYPE_CHECKING
  • typing.Any
  • dazzle_back.runtime.event_bus.LLMEventType
  • dazzle_back.runtime.llm_executor.ExecutionResult
  • dazzle_back.runtime.llm_executor.LLMIntentExecutor
  • uuid
  • dazzle_back.runtime.event_bus.EntityEvent
  • dazzle_back.runtime.event_bus.EntityEventType

Event Interactions

Consumes: EntityEvent

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_llm_queue.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.