pixano_inference.plugins
Discovery of custom model implementations shipped as installable packages.
A third-party model is packaged like any Python distribution and advertises itself through
a pixano_inference.models entry point. Because the package is installed in the same
environment as the server, it is importable both in the ingress process and in every Ray
Serve worker — no source directory needs to be shipped to workers.
Example plugin pyproject.toml::
[project.entry-points."pixano_inference.models"]
my_detector = "my_pkg.model" # importing the module runs @register_model
# or point directly at the class:
my_detector = "my_pkg.model:MyDetector"
At startup the server loads all such entry points (importing them registers their models). The core ships no model implementations and depends on no ML framework: every model -- including the first-party ones (SAM2, CLIP, Grounding DINO, ...) -- is a separate package discovered this way.
describe_plugins()
Summarise the last discovery: which model plugins loaded, and which failed and why.
Returns:
| Type | Description |
|---|---|
str
|
A one-line description for logs and error messages. |
Source code in pixano_inference/plugins.py
ensure_models_loaded(force=False)
Register all installed models (entry-point plugins).
Idempotent — safe to call from every entry point that needs the registry populated (config resolution, app creation, replica init).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force
|
bool
|
Re-run discovery even if it already ran in this process. |
False
|
Source code in pixano_inference/plugins.py
load_plugin_models()
Discover and import all pixano_inference.models entry-point plugins.
Each entry point is loaded (importing its module, which runs the @register_model
decorators); if it resolves to an :class:InferenceModel subclass, it is also
registered defensively. A failing plugin is logged and skipped rather than aborting
startup.
Returns:
| Type | Description |
|---|---|
``{"loaded"
|
[...], "failed": [...]}`` entry-point names. |