Answers "what's the right way to name/register custom pipelines like T2I→I2V": treat a Workflow like a card — a stable namespaced id in the same servable namespace, declared dependencies, and a two-level registry. No new concepts; mirrors how cards are registered (and vllm-omni's pipeline_registry). - program/workflow.py: Workflow gains `requires` (the cards it composes, derived from stages) and `validate(engine)` (fail-fast if a required card is absent, P7). New WorkflowRegistry: declarative workflow_id -> builder catalog for out-of-tree/ad hoc use. - runtime/engine.py: `_workflows` registry + register_workflow (validates deps, rejects id collision with a model_id) + serves(); engine.run routes a request whose model_id is a workflow to workflow.run — addressable exactly like a model. Single-model hot path untouched. - runtime/async_engine.py + serving/server.py: serves() and /models include workflows (discoverable as servables). - models/__init__.py: declarative `_WORKFLOWS` catalog (the cross-model analog of _BUILDERS) + register_workflows() helper; build_image_video_engine now registers the workflow too. Adding a custom pipeline = one catalog line. - Naming convention: dotted/namespaced workflow_id (`image_video.t2i_i2v`), distinct from kebab model ids, collision-checked. Renamed from `t2i_then_i2v`. - tests (+5, 12 total in the file): addressable by id, requires/validate, id collision, registry catalog, register_workflows helper. Full suite 114 passed. - designv4 §9.6: the naming & registration convention documented.
21 lines
563 B
Python
21 lines
563 B
Python
"""Program plane — compose a card's loops into a task (design_v3 §13)."""
|
|
from __future__ import annotations
|
|
|
|
from .specs import (
|
|
ComponentNode,
|
|
Edge,
|
|
EdgeKind,
|
|
ModelLoopNode,
|
|
Program,
|
|
ProgramKind,
|
|
ProgramNode,
|
|
always,
|
|
when_opt,
|
|
when_task,
|
|
)
|
|
from .workflow import Workflow, WorkflowRegistry, WorkflowStage
|
|
|
|
__all__ = ["Program", "ProgramKind", "ProgramNode", "ComponentNode", "ModelLoopNode",
|
|
"Edge", "EdgeKind", "always", "when_task", "when_opt",
|
|
"Workflow", "WorkflowStage", "WorkflowRegistry"]
|