Extending AutoPipeline
AutoPipeline already exposes several extension surfaces, but they are not all equivalent in cost.
In practice, most changes should stop at one of these three layers:
- a new
primitive - a new
moduleorpipe - a new
pipelinefamily
Choose the Smallest Extension Surface
| If you need to... | Preferred extension point | Typical files |
|---|---|---|
| Reuse a low-level backend, detector, segmenter, or helper across multiple pipes | Primitive | src/autopipeline/components/primitives/ |
Add a new executable metric, judge, or parsing block referenced by pipe_name | Module / Pipe | src/autopipeline/components/modules/ |
| Add a new runtime orchestration pattern with its own input shaping and execution flow | Pipeline family | src/autopipeline/pipelines/ |
The practical rule is simple:
- if YAML composition is enough, do not add a new Python type
- if several metrics need the same low-level capability, add a primitive
- if one new score or judge behavior must run from
metric_configs, add a pipe - if the runtime no longer fits
object-centric,human-centric, orvlm-as-a-judge, add a new pipeline family
What Is Already Registry-Backed
AutoPipeline relies on import-side-effect registration in several places:
PIPE_REGISTRYfor executable pipesEXPERT_REGISTRYfor expert-style primitivesCLIENT_REGISTRYfor backend clientsPROMPT_ADAPTER_REGISTRYfor prompt serializationPIPELINE_REGISTRYfor top-level pipeline families
That means a new class is not really part of the framework until the corresponding package __init__.py imports it.
Recommended Reading Order for Extension Work
- Read Components Overview to understand the runtime split between modules and primitives.
- Read Modules Overview and Primitives Overview to find an existing pattern close to your use case.
- Start with one of these focused guides:
Before You Add a New Type
The current codebase already contains a few important reusable pieces:
BasePipelinehandles config validation, parser-grounder loading, expert loading, image parsing, and metric pipe loading.parser-grounderis already the standard front end for region-aware pipelines.- one pipe class can expose multiple metrics because the YAML metric key and the registered
pipe_nameare different surfaces. - pipes with the same
(pipe_name, init_config)share one cached instance inside a pipeline runtime.
Those constraints mean the cheapest successful extension is often:
- reuse an existing primitive
- add one new metric branch in an existing pipe
- add one new pipeline YAML
Only go wider when that stops being structurally correct.
Current Framework Caveats
A few extension points are more hardcoded than they first appear:
parser-grounderis loaded explicitly by the existing region-aware pipeline families rather than throughmetric_configsBasePipelineonly mapsedit_areaandunedit_areaintomask_mode- human-centric expert loading is coupled to metric-name prefixes such as
face_*,hair_*, andbody_* - the runner and worker layer still contains explicit branching on the current pipeline families
This is why adding a primitive or a pipe is usually straightforward, while adding a new pipeline family requires more integration work.
Verification Strategy
No matter which layer you extend, validate in this order:
- import and registration
- one minimal config file
- one single-sample end-to-end run
- output artifact shape
- only then multi-worker execution
That order will save time because most real failures happen in registration, config merge, prompt assets, or runtime input-shape mismatches.