log
2026-06-25 7c4c956be0c3c4c2f76f181e356779003bc8f998
video-claw/video-claw/backend/api/routers/pipelines.py
@@ -5,7 +5,7 @@
from urllib.parse import quote
from typing import Optional
from fastapi import APIRouter, BackgroundTasks, HTTPException, Query
from fastapi import APIRouter, BackgroundTasks, HTTPException, Query, Response
from fastapi.responses import HTMLResponse, StreamingResponse
from api.schemas.pipelines import (
@@ -149,14 +149,41 @@
@router.get("/api/models")
async def get_api_models(
    response: Response,
    media_type: Optional[str] = Query(None, pattern="^(image|video)$"),
    model_type: Optional[str] = Query(None, pattern="^(llm|vlm|t2i|i2i|video)$"),
    ability: Optional[str] = Query(None),
    verified_only: bool = False,
):
    from config import Config
    response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
    if model_type:
        base_models = get_models_by_type(model_type)
        # Inject models from config.yaml that might not be in hardcoded list
        config_models = Config.as_dict().get("models", {})
        type_to_keys = {
            "llm": ["llm"],
            "vlm": ["vlm"],
            "t2i": ["image_t2i"],
            "i2i": ["image_it2i"],
            "video": ["video", "video_first_frame", "video_start_end", "video_reference"]
        }
        existing_ids = {m["id"] for m in base_models}
        for key in type_to_keys.get(model_type, []):
            cfg_id = config_models.get(key)
            if cfg_id and cfg_id not in existing_ids:
                base_models.append({
                    "id": cfg_id,
                    "name": cfg_id,
                    "provider": "custom",
                    "type": [model_type],
                    "concurrency": 3
                })
                existing_ids.add(cfg_id)
        models = []
        for model in get_models_by_type(model_type):
        for model in base_models:
            capabilities = model_type_capabilities(model_type, model)
            models.append({
                "id": model["id"],