This template is designed to integrate easily with the main app in development.
A plugin consists of a React frontend and a Docker backend. It has a GitHub action that automatically runs npm run build and creates a release from the dist folder.
The main production app has an option to download a plugin from GitHub in the plugin manager.
The production Rust backend presents two SAM3-compatible model choices. Both use the Candle SAM3 runtime in-process; the model selector controls which checkpoint is downloaded and loaded.
| Selector value | Display label | Checkpoint source | Stored checkpoint | Token required | Prompt support |
|---|---|---|---|---|---|
sam3 |
SAM3 | Hugging Face facebook/sam3, file sam3.pt |
sam3.pt |
Yes | Image points, video points |
medical_sam3 |
Medical SAM3 | Hugging Face ChongCong/Medical-SAM3, file checkpoint.pt |
medical_sam3.pt |
No | Image points, video points |
The /model-status endpoint reports sam3 and medical_sam3 only, matching
the current production SAM3 surface. The /download-model endpoint stores
checkpoints under the plugin checkpoint directory, and /process lazy-loads
the selected checkpoint through the Candle SAM3 path before staging input
frames.
To get started with developing a plugin:
Option 1: Clone the main repository and make a folder/repository inside of the plugins folder. Push only that folder to GitHub.
Option 2: If it is easier for you, copy all the contents of the plugin-template folder into a completely separate repository. All of the usage steps should still work.
-
Follow the instructions in the README to install the app in development mode.
-
Open a terminal and
cdinto your plugin's folder. Then runnpm installto install your plugin's dependencies. -
Start the main app in development mode: Run
npm run devin the main project folder. -
Start the plugin in development mode: Run
npm run devin your plugin's folder. -
In the main app, go to the first menu dropdown and open the plugin manager. Click the plus, and paste the URL of your plugin (something like
http://localhost:5172) in the development plugin option.
npm run dev-backend uses backend dev compose files with:
- Rust backend compose files selected by local hardware:
backend/compose.dev.ymlwhen no NVIDIA GPU is detectedbackend/compose.gpu.dev.ymlwhennvidia-smiis available
- conditional Docker rebuilds only when backend build inputs change:
backend/Dockerfilebackend/Cargo.tomlbackend/Cargo.lockbackend/srcbackend/tests- backend compose files
Frontend-only edits do not trigger a backend image rebuild. Rust backend edits do rebuild the image because the release-style container compiles the Rust server into the runtime image.
Tagged releases publish two preinstallable plugin artifacts:
auto-segmentation-<tag>-cpu.zipauto-segmentation-<tag>-cuda.zip
The current production beta pin for Ouroboros package builds is:
- tag:
v0.4.0-beta.1 - CPU asset:
auto-segmentation-v0.4.0-beta.1-cpu.zip - CUDA asset:
auto-segmentation-v0.4.0-beta.1-cuda.zip - CPU backend image:
ghcr.io/chenglabresearch/ouroboros-autoseg-backend:v0.4.0-beta.1 - CUDA backend image:
ghcr.io/chenglabresearch/ouroboros-autoseg-backend:v0.4.0-beta.1-cuda
Both archives unpack to the normal Ouroboros plugin folder layout, including
package.json, index.html, icon.svg, compose.yml, frontend assets, and
plugin-release.json. The CPU artifact compose.yml points at
ghcr.io/chenglabresearch/ouroboros-autoseg-backend:<tag>. The CUDA artifact
points at ghcr.io/chenglabresearch/ouroboros-autoseg-backend:<tag>-cuda and
includes the NVIDIA GPU device reservation.
For production package preinstalls, unpack the selected artifact under
extra-resources/preinstalled-plugins/auto-segmentation/ before building the
Ouroboros package.
The GPU compose files use a CUDA-specific Docker target:
backend/compose.gpu.ymlfor packaged GPU backendsbackend/compose.gpu.dev.ymlfor local GPU development
Those compose files select the cuda-runtime Docker target and pass CANDLE_FEATURES=cuda, which forwards the plugin crate's cuda feature to the Candle dependencies. Building these images requires an NVIDIA-capable Docker environment with the NVIDIA container toolkit available.
The Publish Backend Image workflow publishes the Rust backend image to GHCR for release tags and commit SHAs:
ghcr.io/chenglabresearch/ouroboros-autoseg-backend:<release-tag>ghcr.io/chenglabresearch/ouroboros-autoseg-backend:sha-<commit>ghcr.io/chenglabresearch/ouroboros-autoseg-backend:<release-tag>-cudaghcr.io/chenglabresearch/ouroboros-autoseg-backend:sha-<commit>-cuda
The unsuffixed tags use the CPU runtime target, and the -cuda tags use the CUDA runtime target. The existing backend/compose.yml remains the local-build fallback. backend/compose.registry.yml is an opt-in packaged compose file for release builds that want to use a prebuilt immutable image by setting OUROBOROS_AUTOSEG_BACKEND_IMAGE.
The first lines of the package.json are important to identifying your plugin.
"name": "plugin-template",
"pluginName": "Plugin Template",
"icon": "./icon.svg",
"index": "./index.html",
"dockerCompose": "./compose.yml",
nameis considered to be the pluginidpluginNameis the display name of the pluginiconis thedist-relative path to the icon for the pluginindexis thedist-relative path to the index HTML file generated by the builddockerComposeis an optionaldist-relative path to a Docker Compose file to run the plugin backend.