deployment.py 717 B

123456789101112131415161718192021222324252627
  1. from fastapi import APIRouter
  2. from app.schemas.deployment import DeployConfig, DeployResponse
  3. router = APIRouter()
  4. @router.post("/export", response_model=DeployResponse)
  5. async def export_adapter(config: DeployConfig):
  6. """合并 adapter 与基础模型,可选导出为 GGUF。"""
  7. return DeployResponse(
  8. job_id=config.job_id,
  9. status="pending",
  10. output_path=None,
  11. error=None,
  12. )
  13. @router.get("/{deploy_id}/status", response_model=DeployResponse)
  14. async def get_deployment_status(deploy_id: str):
  15. """获取导出/部署任务状态。"""
  16. return DeployResponse(
  17. job_id=deploy_id,
  18. status="pending",
  19. output_path=None,
  20. error=None,
  21. )