Initial vLLM agent strategy
This commit is contained in:
13
app/scheduler/budget.py
Normal file
13
app/scheduler/budget.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from app.storage.repositories import Repository
|
||||
|
||||
|
||||
class Budget:
|
||||
def __init__(self, repo: Repository, max_tasks: int):
|
||||
self.repo = repo
|
||||
self.max_tasks = max_tasks
|
||||
|
||||
def remaining(self) -> int:
|
||||
return max(0, self.max_tasks - self.repo.count_budgeted_tasks())
|
||||
|
||||
def can_create_task(self) -> bool:
|
||||
return self.remaining() > 0
|
||||
Reference in New Issue
Block a user