Skip to content

feat: add PrimingGroup and MLPipeline SDK methods#420

Open
brandon-wada wants to merge 15 commits intomainfrom
priming_sdk
Open

feat: add PrimingGroup and MLPipeline SDK methods#420
brandon-wada wants to merge 15 commits intomainfrom
priming_sdk

Conversation

@brandon-wada
Copy link
Copy Markdown
Collaborator

@brandon-wada brandon-wada commented Mar 27, 2026

Summary

Adds SDK methods for the new PrimingGroup public API. Priming Groups are groupings of detectors that share a common semantic query and can utilize a common base model. In the future, priming groups may allow for cross detector learning and other multi-task and meta-learning techniques.

In introducing priming groups, we also expose MLPipelines. Every detector has one active MLPipeline but constantly runs multiple MLPipelines under the hood that are compared against the top performing active model. Whenever Groundlight determines that there is a better performing model, we will switch that model to be the active model.

Currently, a priming group can be created from an existing and trained MLPipeline, which one can get given an active detector. The new PrimingGroup will use a frozen version of the MLPipeline for the first inference on a new detector created using the PrimingGroups. If shadow pipelines are disallowed on the PrimingGroup, that frozen model will be used indefinitely by the detector. Otherwise, the frozen model will be used until one of the other MLPipelines on the detector is evaluated to be a better fit.

We add the following methods in this PR

  • list_detector_pipelines(detector) — list all MLPipelines for a detector
  • create_priming_group(name, source_ml_pipeline_id, ...) — create a PrimingGroup seeded from an existing trained model
  • list_priming_groups() — list all priming groups owned by this account
  • get_priming_group(priming_group_id) — retrieve by ID
  • delete_priming_group(priming_group_id) — soft-delete

We also add new pydantic models: MLPipeline, PrimingGroup in generated/model.py.

Usage

```python
gl = Groundlight()

pipelines = gl.list_detector_pipelines(detector)
active = next(p for p in pipelines if p.is_active_pipeline and p.cached_vizlogic_key)

pg = gl.create_priming_group(
name="door-detector-primer",
source_ml_pipeline_id=active.id,
canonical_query="Is the door open?",
disable_shadow_pipelines=True,
)

new_detector = gl.create_detector(
name="new-door-detector",
query="Is the door open?",
priming_group_id=pg.id,
)
```

brandon-wada and others added 15 commits March 27, 2026 19:47
New Groundlight client methods:
- list_detector_pipelines(detector) -> List[MLPipeline]
- list_priming_groups() -> List[PrimingGroup]
- create_priming_group(name, source_ml_pipeline_id, canonical_query, disable_shadow_pipelines) -> PrimingGroup
- get_priming_group(priming_group_id) -> PrimingGroup
- delete_priming_group(priming_group_id)

New pydantic models in generated/model.py: MLPipeline, PrimingGroup,
PaginatedMLPipelineList, PaginatedPrimingGroupList.

PrimingGroups let users seed new detectors with a pre-trained model binary
so they skip the cold-start period. Detectors created with priming_group_id
(already supported in create_detector) will start with the primed model active.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant