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), alongside the built-in backends. This is the recommended way to extend Pixano Inference and the foundation for a shared "model store" of installable models.
ensure_models_loaded(force=False)
Register all available models: built-in backends and 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. |