Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/app/celery/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,3 @@ def warm_llm_modules(**_) -> None:
broker_connection_retry_on_startup=True,
broker_pool_limit=settings.CELERY_BROKER_POOL_LIMIT,
)

28 changes: 21 additions & 7 deletions backend/app/celery/tasks/job_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def run_doctransform_job(self, project_id: int, job_id: str, trace_id: str, **kw


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_create_collection_job(self, project_id: int, job_id: str, trace_id: str, **kwargs):
def run_create_collection_job(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.collections.create_collection import execute_job

_set_trace(trace_id)
Expand All @@ -84,7 +86,9 @@ def run_create_collection_job(self, project_id: int, job_id: str, trace_id: str,


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_delete_collection_job(self, project_id: int, job_id: str, trace_id: str, **kwargs):
def run_delete_collection_job(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.collections.delete_collection import execute_job

_set_trace(trace_id)
Expand All @@ -98,7 +102,9 @@ def run_delete_collection_job(self, project_id: int, job_id: str, trace_id: str,


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_stt_batch_submission(self, project_id: int, job_id: str, trace_id: str, **kwargs):
def run_stt_batch_submission(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.stt_evaluations.batch_job import execute_batch_submission

_set_trace(trace_id)
Expand All @@ -112,7 +118,9 @@ def run_stt_batch_submission(self, project_id: int, job_id: str, trace_id: str,


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_stt_metric_computation(self, project_id: int, job_id: str, trace_id: str, **kwargs):
def run_stt_metric_computation(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.stt_evaluations.metric_job import execute_metric_computation

_set_trace(trace_id)
Expand All @@ -126,7 +134,9 @@ def run_stt_metric_computation(self, project_id: int, job_id: str, trace_id: str


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_tts_batch_submission(self, project_id: int, job_id: str, trace_id: str, **kwargs):
def run_tts_batch_submission(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.tts_evaluations.batch_job import execute_batch_submission

_set_trace(trace_id)
Expand All @@ -140,8 +150,12 @@ def run_tts_batch_submission(self, project_id: int, job_id: str, trace_id: str,


@celery_app.task(bind=True, queue="low_priority", priority=1)
def run_tts_result_processing(self, project_id: int, job_id: str, trace_id: str, **kwargs):
from app.services.tts_evaluations.batch_result_processing import execute_tts_result_processing
def run_tts_result_processing(
self, project_id: int, job_id: str, trace_id: str, **kwargs
):
from app.services.tts_evaluations.batch_result_processing import (
execute_tts_result_processing,
)

_set_trace(trace_id)
return execute_tts_result_processing(
Expand Down
76 changes: 55 additions & 21 deletions backend/app/celery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
logger = logging.getLogger(__name__)


def start_llm_job(
project_id: int, job_id: str, trace_id: str = "N/A", **kwargs
) -> str:
def start_llm_job(project_id: int, job_id: str, trace_id: str = "N/A", **kwargs) -> str:
from app.celery.tasks.job_execution import run_llm_job

task = run_llm_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
task = run_llm_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(f"[start_llm_job] Started job {job_id} with Celery task {task.id}")
return task.id

Expand All @@ -27,8 +27,12 @@ def start_llm_chain_job(
) -> str:
from app.celery.tasks.job_execution import run_llm_chain_job

task = run_llm_chain_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_llm_chain_job] Started job {job_id} with Celery task {task.id}")
task = run_llm_chain_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_llm_chain_job] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -37,7 +41,9 @@ def start_response_job(
) -> str:
from app.celery.tasks.job_execution import run_response_job

task = run_response_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
task = run_response_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(f"[start_response_job] Started job {job_id} with Celery task {task.id}")
return task.id

Expand All @@ -47,8 +53,12 @@ def start_doctransform_job(
) -> str:
from app.celery.tasks.job_execution import run_doctransform_job

task = run_doctransform_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_doctransform_job] Started job {job_id} with Celery task {task.id}")
task = run_doctransform_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_doctransform_job] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -57,8 +67,12 @@ def start_create_collection_job(
) -> str:
from app.celery.tasks.job_execution import run_create_collection_job

task = run_create_collection_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_create_collection_job] Started job {job_id} with Celery task {task.id}")
task = run_create_collection_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_create_collection_job] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -67,8 +81,12 @@ def start_delete_collection_job(
) -> str:
from app.celery.tasks.job_execution import run_delete_collection_job

task = run_delete_collection_job.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_delete_collection_job] Started job {job_id} with Celery task {task.id}")
task = run_delete_collection_job.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_delete_collection_job] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -77,8 +95,12 @@ def start_stt_batch_submission(
) -> str:
from app.celery.tasks.job_execution import run_stt_batch_submission

task = run_stt_batch_submission.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_stt_batch_submission] Started job {job_id} with Celery task {task.id}")
task = run_stt_batch_submission.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_stt_batch_submission] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -87,8 +109,12 @@ def start_stt_metric_computation(
) -> str:
from app.celery.tasks.job_execution import run_stt_metric_computation

task = run_stt_metric_computation.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_stt_metric_computation] Started job {job_id} with Celery task {task.id}")
task = run_stt_metric_computation.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_stt_metric_computation] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -97,8 +123,12 @@ def start_tts_batch_submission(
) -> str:
from app.celery.tasks.job_execution import run_tts_batch_submission

task = run_tts_batch_submission.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_tts_batch_submission] Started job {job_id} with Celery task {task.id}")
task = run_tts_batch_submission.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_tts_batch_submission] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand All @@ -107,8 +137,12 @@ def start_tts_result_processing(
) -> str:
from app.celery.tasks.job_execution import run_tts_result_processing

task = run_tts_result_processing.delay(project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs)
logger.info(f"[start_tts_result_processing] Started job {job_id} with Celery task {task.id}")
task = run_tts_result_processing.delay(
project_id=project_id, job_id=job_id, trace_id=trace_id, **kwargs
)
logger.info(
f"[start_tts_result_processing] Started job {job_id} with Celery task {task.id}"
)
return task.id


Expand Down
7 changes: 7 additions & 0 deletions backend/app/models/llm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"o1",
"o1-preview",
"o1-mini",
"gpt-5.4-pro",
"gpt-5.4-mini",
"gpt-5.4-nano",
"gpt-5",
"gpt-4-turbo",
"gpt-4",
"gpt-3.5-turbo",
],
}

Expand Down
2 changes: 1 addition & 1 deletion backend/app/models/llm/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TextLLMParams(SQLModel):
description="Reasoning configuration or instructions",
)
temperature: float | None = Field(
default=0.1,
default=None,
ge=0.0,
le=2.0,
)
Expand Down
Loading