Enterprise agent platform for building, deploying, and operating AI teammates.
feat: expose Xinference video Lightning capabilities (#3750)
Chris Qin4e781241f9a2
diff --git a/frontend/src/components/pages/model-management-dialog.test.tsx b/frontend/src/components/pages/model-management-dialog.test.tsxindex b3288900b..138e9a2fd 100644--- a/frontend/src/components/pages/model-management-dialog.test.tsx+++ b/frontend/src/components/pages/model-management-dialog.test.tsx@@ -201,3 +201,45 @@ describe("ModelManagementDialog Bedrock settings", () => {expect(screen.queryByText("common.refresh")).not.toBeInTheDocument()})})++describe("ModelManagementDialog Xinference video catalog", () => {+ afterEach(cleanup)++ it("lets users select either running instance when model names match", async () => {+ apiRequestMock.mockReset().mockResolvedValueOnce({+ ok: true,+ json: async () => ({+ models: [+ { id: "MiniMax-H3", model_uid: "h3/fast", category: "video", lightning_inference_steps: 8 },+ { id: "MiniMax-H3", model_uid: "h3/base", category: "video" },+ ],+ }),+ }).mockResolvedValueOnce({+ ok: true,+ json: async () => ({ id: 21 }),+ })+ renderDialog({+ initialProviderId: "xinference",+ activeTab: "video",+ providers: [{+ id: "xinference",+ name: "Xinference",+ description: "Xinference",+ icon: <span>xinference</span>,+ category: ["video"],+ defaultBaseUrl: "https://xinference.example.com",+ requires_base_url: true,+ }],+ })++ fireEvent.click(screen.getByTitle("models.dialog.refreshModels"))+ fireEvent.click(screen.getByText("models.form.selectModel"))+ expect(await screen.findByRole("button", { name: "h3/base" })).toBeInTheDocument()+ fireEvent.click(screen.getByRole("button", { name: "h3/fast" }))+ fireEvent.click(screen.getByRole("button", { name: "models.form.create" }))++ await waitFor(() => expect(apiRequestMock).toHaveBeenCalledTimes(2))+ const request = apiRequestMock.mock.calls[1][1]+ expect(JSON.parse(request.body)).toMatchObject({ model_name: "h3/fast" })+ })+})diff --git a/frontend/src/components/pages/model-management-dialog.tsx b/frontend/src/components/pages/model-management-dialog.tsxindex 9e03eeddb..2462fe53c 100644--- a/frontend/src/components/pages/model-management-dialog.tsx+++ b/frontend/src/components/pages/model-management-dialog.tsx@@ -608,6 +608,9 @@ export function ModelManagementDialog({const models = catalog.models// Strip 'models/' prefix from Gemini models returned by the SDK APIconst cleanedModels = models.map(model => {+ if (formData.model_provider === 'xinference' && category === 'video' && model.model_uid) {+ return { ...model, id: model.model_uid }+ }if (model.id && model.id.startsWith('models/')) {return { ...model, id: model.id.substring(7) }}diff --git a/frontend/src/lib/models.ts b/frontend/src/lib/models.tsindex 449da563d..0a513f8f5 100644--- a/frontend/src/lib/models.ts+++ b/frontend/src/lib/models.ts@@ -472,6 +472,7 @@ export interface Provider {export interface ProviderModel {id: string;+ model_uid?: string;object: string;created: number;owned_by: string;diff --git a/src/xagent/core/model/video/adapter.py b/src/xagent/core/model/video/adapter.pyindex bfc102893..24ffb9cbb 100644--- a/src/xagent/core/model/video/adapter.py+++ b/src/xagent/core/model/video/adapter.py@@ -1,3 +1,5 @@+import asyncio+from collections.abc import Mappingfrom typing import Anyimport aiohttp@@ -8,10 +10,27 @@ from ...model import VideoModelConfigfrom ...model.providers import canonical_provider_namefrom ...retry import create_retry_wrapperfrom .ark import ArkVideoModel-from .base import BaseVideoModel, BilledVideoTaskError+from .base import BaseVideoModel, BilledVideoTaskError, VideoGenerationCapabilitiesfrom .xinference import XinferenceVideoModel+async def get_video_generation_capabilities(+ models: Mapping[str, BaseVideoModel],+) -> dict[str, VideoGenerationCapabilities]:+ """Let each provider discover capabilities for its configured models."""+ by_provider: dict[type[BaseVideoModel], dict[str, BaseVideoModel]] = {}+ for model_id, model in models.items():+ inner = getattr(model, "_inner", model)+ by_provider.setdefault(type(inner), {})[model_id] = inner+ batches = await asyncio.gather(+ *(+ provider.discover_generation_capabilities(group)+ for provider, group in by_provider.items()+ )+ )+ return {model_id: info for batch in batches for model_id, info in batch.items()}++def retry_on(exc: Exception) -> bool:# Checked first because the cause walk below would otherwise find the# network error a polling timeout was raised from, and retry a generationdiff --git a/src/xagent/core/model/video/base.py b/src/xagent/core/model/video/base.pyindex cf8237395..28d6768dd 100644--- a/src/xagent/core/model/video/base.py+++ b/src/xagent/core/model/video/base.py@@ -1,5 +1,13 @@from abc import ABC, abstractmethod-from typing import Any, List, Optional+from collections.abc import Mapping+from dataclasses import dataclass+from typing import Any, List, Optional, Self+++@dataclass(frozen=True)+class VideoGenerationCapabilities:+ supports_lightning: bool | None = False+ lightning_inference_steps: int | None = Noneclass BilledVideoTaskError(RuntimeError):@@ -26,6 +34,13 @@ class BilledVideoTaskTimeout(BilledVideoTaskError, TimeoutError):class BaseVideoModel(ABC):+ @classmethod+ async def discover_generation_capabilities(+ cls, models: Mapping[str, Self]+ ) -> dict[str, VideoGenerationCapabilities]:+ """Describe the optional generation features of configured instances."""+ return {model_id: VideoGenerationCapabilities() for model_id in models}+"""Abstract base class for video generation models."""@propertydiff --git a/src/xagent/core/model/video/xinference.py b/src/xagent/core/model/video/xinference.pyindex 57714938c..0f5705b3a 100644--- a/src/xagent/core/model/video/xinference.py+++ b/src/xagent/core/model/video/xinference.py@@ -4,8 +4,9 @@ import asyncioimport base64import jsonimport logging+from collections.abc import Mappingfrom pathlib import Path-from typing import Any, List, Optional+from typing import Any, List, Optional, Selffrom urllib import parsefrom urllib.request import url2pathname@@ -17,7 +18,7 @@ from ...utils.public_download import download_public_inputfrom ..chat.token_context import MediaCallTypefrom ..media_metering import record_provider_usagefrom ..public_http import create_public_model_aiohttp_session-from .base import BaseVideoModel, BilledVideoTaskError+from .base import BaseVideoModel, BilledVideoTaskError, VideoGenerationCapabilitieslogger = logging.getLogger(__name__)# "No response body yet", distinct from anything a server could return.@@ -25,6 +26,49 @@ _NOT_RECEIVED: Any = object()REFERENCE_MEDIA_FETCH_TIMEOUT = 60.0+async def fetch_running_xinference_models(+ base_url: str, api_key: str | None, *, timeout: float = 30.0+) -> dict[str, dict[str, Any]]:+ """Read the live catalog keyed by the exact UID used for generation."""+ headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}+ async with create_public_model_aiohttp_session(+ timeout=aiohttp.ClientTimeout(total=timeout)+ ) as session:+ async with session.get(+ f"{base_url.rstrip('/')}/v1/models", headers=headers+ ) as response:+ response.raise_for_status()+ payload = await response.json()+ entries = payload.get("data") if isinstance(payload, dict) else None+ if not isinstance(entries, list):+ return {}+ return {+ item["id"]: item+ for item in entries+ if isinstance(item, dict) and isinstance(item.get("id"), str) and item["id"]+ }+++def lightning_inference_steps(model_info: dict[str, Any]) -> int | None:+ """Xinference advertises a step count when the instance supports the switch."""+ steps = model_info.get("lightning_inference_steps")+ if type(steps) is int and steps > 0:+ return steps+ return None+++async def _load_capability_catalog(+ base_url: str, api_key: str | None+) -> dict[str, dict[str, Any]]:+ try:+ return await fetch_running_xinference_models(base_url, api_key, timeout=10)+ except Exception as exc:+ logger.warning(+ "Could not read Xinference video capabilities: %s", type(exc).__name__+ )+ return {}++def _to_plain_data(value: Any) -> Any:if value is None or isinstance(value, (str, int, float, bool)):return value@@ -103,6 +147,31 @@ def _size_from_resolution_ratio(class XinferenceVideoModel(BaseVideoModel):"""Xinference video model client using OpenAI-compatible video endpoints."""+ @classmethod+ async def discover_generation_capabilities(+ cls, models: Mapping[str, Self]+ ) -> dict[str, VideoGenerationCapabilities]:+ endpoints = {(model.base_url, model.api_key) for model in models.values()}+ catalogs = await asyncio.gather(+ *(_load_capability_catalog(*endpoint) for endpoint in endpoints)+ )+ catalogs_by_endpoint = dict(zip(endpoints, catalogs, strict=True))+ capabilities = {}+ for model_id, model in models.items():+ model_info = catalogs_by_endpoint[model.base_url, model.api_key].get(+ model._model_uid+ )+ if model_info is None:+ capabilities[model_id] = VideoGenerationCapabilities(+ supports_lightning=None+ )+ continue+ steps = lightning_inference_steps(model_info)+ capabilities[model_id] = VideoGenerationCapabilities(+ steps is not None, steps+ )+ return capabilities+def __init__(self,model_name: str,diff --git a/src/xagent/core/tools/adapters/vibe/video_tool.py b/src/xagent/core/tools/adapters/vibe/video_tool.pyindex 7246b4a87..eb0e07fcf 100644--- a/src/xagent/core/tools/adapters/vibe/video_tool.py+++ b/src/xagent/core/tools/adapters/vibe/video_tool.py@@ -66,7 +66,7 @@ class VideoGenerationTool(VideoGenerationToolCore):VideoGenerationFunctionTool(self.list_available_models,name="list_video_models",- description="List all available video generation models, including model ID, availability status, and detailed description information.",+ description="List available video models and their live Lightning capabilities. For each model, supports_lightning is true, false, or null when unknown. lightning_inference_steps is the loaded Lightning adapter's step count.",),]diff --git a/src/xagent/core/tools/core/video_tool.py b/src/xagent/core/tools/core/video_tool.pyindex 80101e966..7b7afe2be 100644--- a/src/xagent/core/tools/core/video_tool.py+++ b/src/xagent/core/tools/core/video_tool.py@@ -13,6 +13,7 @@ import osimport shutilimport uuidfrom collections.abc import Mapping+from dataclasses import asdictfrom pathlib import Pathfrom typing import Annotated, Any, Dict, Optional, TypeAliasfrom urllib import parse@@ -22,6 +23,7 @@ from pydantic import Fieldfrom ....config import get_max_upload_size_bytes, get_media_download_max_bytesfrom ...file_ref import build_workspace_file_ref, guess_mime_type, parse_file_id_ref+from ...model.video.adapter import get_video_generation_capabilitiesfrom ...model.video.ark import ArkVideoModel, seedance_duration_limitsfrom ...model.video.base import BaseVideoModelfrom ...model.video.xinference import XinferenceVideoModel@@ -31,7 +33,12 @@ from ...utils.media_download import (resolve_workspace_media_path,)from ...workspace import TaskWorkspace-from .media_errors import INVALID_REQUEST, media_error_fields, media_failure_fields+from .media_errors import (+ INVALID_REQUEST,+ PROVIDER_UNAVAILABLE,+ media_error_fields,+ media_failure_fields,+)logger = logging.getLogger(__name__)@@ -53,6 +60,7 @@ _VIDEO_TOOL_ARG_KEYS = {"duration","resolution","generate_audio",+ "use_lightning","watermark","return_last_frame","first_frame_image_url",@@ -175,7 +183,7 @@ When given a user request, rewrite and enrich the prompt into a concise professi- Describe the subject, action, camera motion, lighting, visual style, environment, and mood.- Use concrete temporal language for motion and scene progression.- Preserve user-specified text only when the user explicitly asks for visible text.-- Prefer the default model marked with ⭐[DEFAULT]. Only specify model_id if the user explicitly requests a different model.+- Prefer the default model marked with ⭐[DEFAULT]. Specify model_id when the user requests a different model or the default lacks the requested Lightning capability.Available models (⭐[DEFAULT] marks the configured default model):{}@@ -191,6 +199,7 @@ Parameters:- duration (optional): legacy alias for seconds.- resolution (optional): provider alias such as "480p", "720p", or "1080p"; converted with ratio when size is omitted.- generate_audio (optional): whether to generate synchronized audio. Defaults to true when supported.+- use_lightning (optional): omit for ordinary requests. Xinference uses a loaded Lightning adapter by default. Call list_video_models first for an explicit Lightning choice or when the user clearly prioritizes fidelity over speed. If supports_lightning=true, set false for the fidelity-over-speed preference or to disable Lightning. Set true for an explicit Lightning request, matching the requested step count if given.- watermark (optional): whether to include provider watermark. Defaults to true when supported.- return_last_frame (optional): ask the provider to return the last frame URL when supported.- first_frame_image_url / last_frame_image_url (optional): Seedance-style first/last-frame control.@@ -669,6 +678,7 @@ The generated video URL is temporary on the provider side, so completed videos apoll_interval: float = 30.0,timeout: Optional[float] = None,model_id: Optional[str] = None,+ use_lightning: Optional[bool] = None,**kwargs: Any,) -> Dict[str, Any]:actual_model_id = model_id or "default"@@ -676,6 +686,7 @@ The generated video URL is temporary on the provider side, so completed videos atry:kwargs = self._normalize_extra_kwargs(kwargs)kwargs.pop("allowed_local_media_roots", None)+ use_lightning = kwargs.pop("use_lightning", use_lightning)if not _has_value(ratio):ratio = Noneexplicit_ratio = ratio is not None@@ -731,6 +742,27 @@ The generated video URL is temporary on the provider side, so completed videos a"return_last_frame": return_last_frame,"poll_interval": poll_interval,}+ if use_lightning is not None:+ capabilities = await get_video_generation_capabilities(+ {actual_model_id: video_model}+ )+ supported = capabilities[actual_model_id].supports_lightning+ if supported is None:+ return {+ "success": False,+ "error_category": PROVIDER_UNAVAILABLE,+ "error": "Could not verify whether the selected model supports Lightning.",+ "video_path": None,+ }+ if not supported:+ return {+ "success": False,+ "error_category": INVALID_REQUEST,+ "error": "The selected model does not advertise a Lightning switch.",+ "video_path": None,+ }+ generate_params["use_lightning"] = use_lightning+effective_seconds = self._normalize_seconds(seconds if seconds is not None else duration)@@ -974,8 +1006,9 @@ The generated video URL is temporary on the provider side, so completed videos a"video_path": None,}- def list_available_models(self) -> Dict[str, Any]:+ async def list_available_models(self) -> Dict[str, Any]:try:+ capabilities = await get_video_generation_capabilities(self._video_models)models_info = []for model_id, model in self._video_models.items():models_info.append(@@ -984,6 +1017,7 @@ The generated video URL is temporary on the provider side, so completed videos a"available": True,"abilities": getattr(model, "abilities", []),"description": self._model_descriptions.get(model_id, ""),+ **asdict(capabilities[model_id]),})diff --git a/src/xagent/web/services/model_list_service.py b/src/xagent/web/services/model_list_service.pyindex cdfa1b543..545301a7d 100644--- a/src/xagent/web/services/model_list_service.py+++ b/src/xagent/web/services/model_list_service.py@@ -4,8 +4,6 @@ import inspectimport loggingfrom typing import Any, Dict, List, Optional-import aiohttp-from ...core.model.providers import (ENDPOINT_KIND_OFFICIAL,canonical_provider_name,@@ -13,7 +11,10 @@ from ...core.model.providers import (default_base_url_for_provider,get_supported_provider_metadata,)-from ...core.model.public_http import create_public_model_aiohttp_session+from ...core.model.video.xinference import (+ fetch_running_xinference_models,+ lightning_inference_steps,+)from ...core.utils.security import redact_sensitive_textlogger = logging.getLogger(__name__)@@ -179,33 +180,9 @@ async def fetch_xinference_video_models(if not base_url:raise ValueError("base_url is required for Xinference video")- from ...core.model.chat.basic.xinference import _normalize_model_list_response-- headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}- timeout = aiohttp.ClientTimeout(total=30.0)- async with create_public_model_aiohttp_session(timeout=timeout) as session:- async with session.get(- f"{base_url.rstrip('/')}/v1/models", headers=headers- ) as response:- if response.status != 200:- try:- detail = await response.json()- except Exception:- detail = await response.text()- raise RuntimeError(- f"Failed to list Xinference video models: HTTP {response.status}, detail: {detail}"- )- response_data = await response.json()- data_list = response_data.get("data", []) if isinstance(response_data, dict) else []- models_list = {- str(item["id"]): item- for item in data_list- if isinstance(item, dict) and item.get("id")- }- normalized_models = _normalize_model_list_response(models_list)-+ models = await fetch_running_xinference_models(base_url, api_key)result: List[Dict[str, Any]] = []- for model_uid, model_info in normalized_models:+ for model_uid, model_info in models.items():abilities = [str(item) for item in model_info.get("model_ability", [])]model_type = str(model_info.get("model_type", ""))is_video = model_type == "video" or any(@@ -213,17 +190,19 @@ async def fetch_xinference_video_models()if not is_video:continue- result.append(- {- "id": model_info.get("model_name", model_uid),- "model_uid": model_uid,- "model_type": model_type,- "category": "video",- "model_ability": ["generate"],- "abilities": ["generate"],- "description": model_info.get("model_description", ""),- }- )+ model = {+ "id": model_info.get("model_name", model_uid),+ "model_uid": model_uid,+ "model_type": model_type,+ "category": "video",+ "model_ability": ["generate"],+ "abilities": ["generate"],+ "description": model_info.get("model_description", ""),+ }+ steps = lightning_inference_steps(model_info)+ if steps is not None:+ model["lightning_inference_steps"] = steps+ result.append(model)return resultdiff --git a/tests/core/tools/core/test_video_tool_core.py b/tests/core/tools/core/test_video_tool_core.pyindex 6f53b5c9d..4aacb573c 100644--- a/tests/core/tools/core/test_video_tool_core.py+++ b/tests/core/tools/core/test_video_tool_core.py@@ -1,4 +1,5 @@import base64+import jsonimport loggingfrom contextlib import contextmanagerfrom pathlib import Path@@ -8,10 +9,14 @@ from unittest.mock import AsyncMock, Mockimport pytestfrom xagent.config import get_max_upload_size_bytes+from xagent.core.model.video import xinference as xinference_videofrom xagent.core.model.video.ark import ArkVideoModelfrom xagent.core.model.video.base import BaseVideoModelfrom xagent.core.model.video.xinference import XinferenceVideoModel-from xagent.core.tools.adapters.vibe.video_tool import VideoGenerationFunctionTool+from xagent.core.tools.adapters.vibe.video_tool import (+ VideoGenerationFunctionTool,+ create_video_tool,+)from xagent.core.tools.core.video_tool import VideoGenerationToolCore@@ -281,6 +286,128 @@ async def test_generate_video_keeps_workspace_image_ref_for_xinference(mock_work]+async def test_list_video_models_reports_lightning_by_running_uid(+ monkeypatch, mock_workspace+):+ catalog = AsyncMock(+ return_value={+ "custom/fast": {"model_name": "MiniMax-H3", "lightning_inference_steps": 8},+ "custom/four": {"model_name": "MiniMax-H3", "lightning_inference_steps": 4},+ "custom/base": {"model_name": "MiniMax-H3"},+ }+ )+ monkeypatch.setattr(xinference_video, "fetch_running_xinference_models", catalog)+ models: dict[str, BaseVideoModel] = {+ name: XinferenceVideoModel(model_name="MiniMax-H3", model_uid=f"custom/{name}")+ for name in ("fast", "four", "base", "missing")+ }+ models["other"] = ArkVideoModel(model_name="seedance")+ _, list_tool = create_video_tool(models, workspace=mock_workspace)++ result = await list_tool.run_json_async({})++ assert result["success"] is True+ assert {+ model["model_id"]: (+ model["supports_lightning"],+ model["lightning_inference_steps"],+ )+ for model in result["models"]+ } == {+ "fast": (True, 8),+ "four": (True, 4),+ "base": (False, None),+ "missing": (None, None),+ "other": (False, None),+ }+ catalog.assert_awaited_once()+++ "options, path_suffix, expected_mode",+ [+ ({}, "", None),+ ({"use_lightning": True}, "", True),+ (+ {"use_lightning": False, "input_reference": "data:image/png;base64,aW1n"},+ "/image",+ False,+ ),+ (+ {+ "use_lightning_bool": False,+ "first_frame_image_url": "data:image/png;base64,aW1n",+ "last_frame_image_url": "data:image/png;base64,aW1n",+ },+ "/flf",+ False,+ ),+ ],+)+async def test_generate_video_forwards_lightning_without_overriding_steps(+ monkeypatch, mock_workspace, options, path_suffix, expected_mode+):+ catalog = AsyncMock(return_value={"h3": {"lightning_inference_steps": 8}})+ monkeypatch.setattr(xinference_video, "fetch_running_xinference_models", catalog)+ model = XinferenceVideoModel(model_name="MiniMax-H3", model_uid="h3")+ post = AsyncMock(return_value={"data": [{"b64_json": "dmlkZW8="}]})+ monkeypatch.setattr(+ model, "_post_video_form" if path_suffix else "_post_video_json", post+ )+ generate_tool, _ = create_video_tool({"h3": model}, workspace=mock_workspace)++ result = await generate_tool.run_json_async(+ {"prompt": "Animate this scene", **options}+ )++ assert result["success"] is True+ post.assert_awaited_once()+ _, path, body = post.await_args.args[:3]+ assert path == f"/v1/video/generations{path_suffix}"+ assert body["model"] == "h3"+ kwargs = json.loads(body["kwargs"])+ assert "num_inference_steps" not in kwargs+ if expected_mode is None:+ assert "use_lightning" not in kwargs+ catalog.assert_not_awaited()+ else:+ assert kwargs["use_lightning"] is expected_mode+ catalog.assert_awaited_once()+++ "catalog, error_category",+ [+ ({"h3": {"lightning_inference_steps": True}}, "invalid_request"),+ ({"h3": {}}, "invalid_request"),+ ({}, "provider_unavailable"),+ ],+)+async def test_generate_video_requires_advertised_lightning_support(+ monkeypatch, mock_workspace, catalog, error_category+):+ monkeypatch.setattr(+ xinference_video,+ "fetch_running_xinference_models",+ AsyncMock(return_value=catalog),+ )+ model = XinferenceVideoModel(model_name="h3")+ generate = AsyncMock()+ monkeypatch.setattr(model, "generate_video", generate)+ generate_tool, _ = create_video_tool({"h3": model}, workspace=mock_workspace)++ result = await generate_tool.run_json_async(+ {"prompt": "Animate this scene", "use_lightning": False}+ )++ assert result["success"] is False+ assert result["error_category"] == error_category+ generate.assert_not_awaited()++@pytest.mark.asyncioasync def test_download_video_rejects_local_video_outside_workspace(tmp_path: Path, mock_video_model, mock_workspacediff --git a/tests/web/test_model_api.py b/tests/web/test_model_api.pyindex ae91c055a..4e44eab65 100644--- a/tests/web/test_model_api.py+++ b/tests/web/test_model_api.py@@ -4086,6 +4086,9 @@ class TestModelAPI:class FakeResponse:status = 200+ def raise_for_status(self):+ pass+async def __aenter__(self):return self@@ -4101,6 +4104,17 @@ class TestModelAPI:"model_type": "video","model_ability": ["text_to_video"],},+ {+ "id": "h3/fast",+ "model_name": "MiniMax-H3",+ "model_type": "video",+ "lightning_inference_steps": 8,+ },+ {+ "id": "h3/base",+ "model_name": "MiniMax-H3",+ "model_type": "video",+ },{"id": "chat-model","model_name": "qwen",@@ -4129,7 +4143,7 @@ class TestModelAPI:return FakeResponse()monkeypatch.setattr(- "xagent.web.services.model_list_service.aiohttp.ClientSession",+ "xagent.core.model.video.xinference.aiohttp.ClientSession",FakeClientSession,)@@ -4145,8 +4159,8 @@ class TestModelAPI:assert response.status_code == 200data = response.json()- assert data["count"] == 1- assert data["models"] == [+ assert data["count"] == 3+ assert data["models"][:1] == [{"id": "Wan2.1-1.3B","model_uid": "wan-video",@@ -4157,6 +4171,10 @@ class TestModelAPI:"description": "",}]+ assert {+ model["model_uid"]: model.get("lightning_inference_steps")+ for model in data["models"][1:]+ } == {"h3/fast": 8, "h3/base": None}assert FakeClientSession.created_timeouts[0].total == 30.0def test_fetch_xinference_video_provider_models_handles_unexpected_response(@@ -4165,6 +4183,9 @@ class TestModelAPI:class FakeResponse:status = 200+ def raise_for_status(self):+ pass+async def __aenter__(self):return self@@ -4190,7 +4211,7 @@ class TestModelAPI:return FakeResponse()monkeypatch.setattr(- "xagent.web.services.model_list_service.aiohttp.ClientSession",+ "xagent.core.model.video.xinference.aiohttp.ClientSession",FakeClientSession,)