from pydantic import BaseModel, Field class ModelInfo(BaseModel): id: str name: str model_type: str path: str | None = None is_downloaded: bool = False context_length: int | None = None supported_peft_methods: list[str] = [] class ModelDownloadRequest(BaseModel): model_id: str = Field(..., description="HuggingFace or ModelScope model ID, e.g. 'meta-llama/Llama-3.1-8B'") use_modelscope: bool = Field(default=False, description="Use ModelScope instead of HuggingFace") class ModelDownloadResponse(BaseModel): model_id: str status: str # "downloading" | "completed" | "failed" path: str | None = None error: str | None = None