feat(US7+US8): finetune management and health check test
- app/models/finetune_models.py: FinetuneStartRequest, FinetuneStartResponse, FinetuneStatusResponse
- app/services/finetune_service.py: submit_finetune + get_finetune_status via run_in_executor; status map running→RUNNING, succeeded→SUCCESS, failed→FAILED, unknown→RUNNING; LLMCallError on SDK failure
- app/routers/finetune.py: POST /finetune/start + GET /finetune/status/{job_id} with get_llm_client dependency
- tests/test_finetune_service.py: 12 unit tests (TDD, written before implementation)
- tests/test_finetune_router.py: 6 integration tests
- tests/test_health.py: GET /health → 200 {"status":"ok"}
Full suite: 72/72 passing (was 53)
This commit is contained in:
18
app/models/finetune_models.py
Normal file
18
app/models/finetune_models.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class FinetuneStartRequest(BaseModel):
|
||||
jsonl_url: str
|
||||
base_model: str
|
||||
hyperparams: dict | None = None
|
||||
|
||||
|
||||
class FinetuneStartResponse(BaseModel):
|
||||
job_id: str
|
||||
|
||||
|
||||
class FinetuneStatusResponse(BaseModel):
|
||||
job_id: str
|
||||
status: str
|
||||
progress: int | None = None
|
||||
error_message: str | None = None
|
||||
Reference in New Issue
Block a user