feat: LLM queue optimizer — resource-aware batch scheduler (closes #2) #15
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/peregrine#15
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/llm-queue-optimizer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
scripts/task_scheduler.py: Resource-awareTaskSchedulersingleton grouping LLM tasks by type into per-type deques, scheduling batches by VRAM budget (deepest queue wins), running each type serially to avoid repeated model context-switching.scripts/task_runner.py:submit_task()routescover_letter,company_research, andwizard_generatethrough the scheduler; all other types continue spawning free threads.scripts/db.py:reset_running_tasks()— marks onlyrunningtasks failed on restart, leavingqueuedintact for the scheduler to resume.app/app.py:_startup()usesreset_running_tasks()instead of the old inline SQL that cleared bothqueuedandrunningrows.config/llm.yaml.example: Documentsscheduler.vram_budgetsandmax_queue_depthconfig keys.tests/test_task_scheduler.py(new): 24 tests covering all behaviors.Test plan
test_generate_calls_llm_router, issue #12)app/app.pysyntax verified withpy_compile