Model Registry
The Model Registry versions and deploys trained models. Use this resource to register models, manage versions, and promote them to deployment.
Access it as client.model_registry on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: search, framework, source, deployment_status, tag, workspace_id
for model in client.model_registry.list():
print(model.id)
# Create
created = client.model_registry.create(
name="churn-rf",
framework="sklearn",
)
print(created.id)
# Read it back
fetched = client.model_registry.retrieve(created.id)
# Delete (returns None; raises on failure)
client.model_registry.delete(created.id)
Methods
Core
list
list(*, search: Optional[str] = None, framework: Optional[str] = None, source: Optional[str] = None, deployment_status: Optional[str] = None, tag: Optional[str] = None, workspace_id: Optional[str] = None, limit: Optional[int] = None) -> SyncPaginator[RegisteredModel]
List registered models with pagination and filtering.
Args:
search: Search by name, description, or framework.
framework: Filter by framework (e.g. "pytorch", "tensorflow").
source: Filter by source.
deployment_status: Filter by deployment status.
tag: Filter by tag.
workspace_id: Filter by workspace ID.
limit: Maximum number of items to return (default: all matching items).
create
create(*, name: str, framework: str, source: Optional[str] = None, description: Optional[str] = None, framework_version: Optional[str] = None, python_version: Optional[str] = None, tags: Optional[Sequence[str]] = None, workspace_id: Optional[str] = None, artifact: Optional[Mapping[str, Any]] = None, manifest: Optional[Mapping[str, Any]] = None, manifest_raw: Optional[str] = None, problem_type: Optional[str] = None, feature_names: Optional[Sequence[str]] = None) -> RegisteredModel
Register a new model.
Args:
name: Human-readable model name.
framework: Model framework (e.g. sklearn, pytorch).
source: Model source (e.g. external, upload, fine-tuning).
description: Optional description.
framework_version: Framework version string.
python_version: Python version string.
tags: Optional tags.
workspace_id: Workspace to register the model in.
artifact: An uploaded artifact reference, a plain dict with camelCase wire keys, e.g. {"s3Key": ..., "sizeMb": ..., "s3Bucket": ...}.
manifest: Parsed bundle manifest (free-form, from upload_artifact).
manifest_raw: Raw manifest YAML text.
problem_type: The model's task, "classification" or "regression". Stored at training.problemType. Required by drift detection to compare the right distributions, so set it at registration if you plan to monitor the model for drift.
feature_names: The training feature columns, in input order. Required for tabular models (sklearn, xgboost, lightgbm, strongly-automl) so predictions are labelled for drift analysis.
from strongly import Strongly
model = client.model_registry.create(
name="churn-rf",
framework="sklearn",
source="upload",
tags=["production"],
artifact={"s3Key": "uploads/churn-rf.joblib", "sizeMb": 4.2},
)
retrieve
retrieve(model_id: str) -> RegisteredModel
Get a single registered model by ID.
update
update(model_id: str, *, name: Optional[str] = None, description: Optional[str] = None, framework: Optional[str] = None, tags: Optional[Sequence[str]] = None) -> RegisteredModel
Update a registered model.
delete
delete(model_id: str) -> None
Delete a registered model.
Lifecycle & actions
deploy
deploy(model_id: str, **kwargs) -> Dict[str, Any]
Deploy a registered model.
Args: model_id: The model ID. **kwargs: Additional deployment parameters.
predict
predict(model_id: str, input_data: Any, *, entity_id: Optional[str] = None, log_prediction: Optional[bool] = None) -> Dict[str, Any]
Run inference on a deployed registered model (deployment status running).
The request is proxied to the model's pod through the AI Gateway, since model
pods are internal to the cluster.
Args:
model_id: The registered model's id.
input_data: The prediction input, forwarded to the model's serving endpoint.
For the built-in tabular server pass a list/array of feature rows
(e.g. X[:3]), a {"instances": rows} dict, or a single
{feature: value} row dict. numpy arrays and pandas DataFrames/Series
are accepted directly (converted to lists), so you can pass X[:3]
instead of X[:3].tolist().
entity_id: Optional id used to match this prediction with a later
ground-truth record for drift detection. Defaults to a server-generated id.
log_prediction: Whether to log this prediction for drift detection
(default True). Pass False to skip logging.
Returns a dict with prediction/predictions, probabilities, latency_ms,
prediction_id and entity_id. Keep prediction_id/entity_id to attach ground
truth later for drift analysis.
# Pass feature rows directly - a list/array of rows, a numpy array, or a
# pandas DataFrame. (A single {feature: value} dict or {"instances": rows}
# also work.) Do NOT wrap them in {"features": ...}.
result = client.model_registry.predict(
"model_abc123",
[[3.1, 4.2], [8.0, 9.1]],
entity_id="order-1042",
)
print(result["prediction"], result["entity_id"])
Artifacts
create_with_upload
create_with_upload(file: Union[str, Path, BinaryIO], *, name: str, framework: str, description: Optional[str] = None, tags: Optional[List[str]] = None, workspace_id: Optional[str] = None, problem_type: Optional[str] = None, feature_names: Optional[Sequence[str]] = None) -> RegisteredModel
Upload a model artifact and register it in one call - the easiest way to get a locally trained model into the registry and ready to deploy.
Args:
file: A path or open binary file. Either a .zip bundle containing a
strongly.manifest.yaml (root or one level nested) for a custom serving
script, or a single .joblib / .pkl / .pt / .onnx artifact for the
built-in servers.
name: Human-readable model name.
framework: sklearn, xgboost, pytorch, tensorflow, onnx, or custom.
A bundle manifest's framework, when present, takes precedence server-side.
description, tags, workspace_id: Optional metadata.
problem_type: The model's task ("classification" / "regression"); set it for drift monitoring.
feature_names: Training feature columns, in input order. Required for tabular models so predictions are labelled for drift analysis.
Returns the registered RegisteredModel, ready to deploy().
model = client.model_registry.create_with_upload(
"model.joblib", name="churn-rf", framework="sklearn",
)
client.model_registry.deploy(model.id)
upload_artifact
upload_artifact(file: Union[str, Path, BinaryIO]) -> Dict[str, Any]
Lower-level: upload just the artifact bundle (multipart). Returns s3Key,
sizeMb, bucket and, for manifest bundles, manifest / manifestRaw - the
fields create() needs to attach the artifact. Use this only when you want to
register separately; otherwise prefer create_with_upload.
Versioning
A registered model accumulates versions. Version 1 is created when you register the model; you add later versions as you retrain, and choose which one is served.
list_versions
list_versions(model_id: str) -> List[ModelVersion]
List the model's version history. The currently served version is
RegisteredModel.active_version (read it from retrieve(model_id)).
create_version
create_version(model_id: str, *, artifact: Mapping[str, Any], description: Optional[str] = None, manifest: Optional[Mapping[str, Any]] = None, manifest_raw: Optional[str] = None, metrics: Optional[Mapping[str, Any]] = None) -> Dict[str, Any]
Add a new version from an already-uploaded artifact. Upload it first with
upload_artifact and pass its reference ({"s3Key": ...}) as artifact.
Returns {"version": <int>, "modelId": <id>}.
create_version_with_upload
create_version_with_upload(file: Union[str, Path, BinaryIO], model_id: str, *, description: Optional[str] = None, metrics: Optional[Mapping[str, Any]] = None) -> Dict[str, Any]
The registry analogue of create_with_upload for a model that already exists:
streams the new bundle up and appends it as a new version. Returns
{"version": <int>, "modelId": <id>}.
added = client.model_registry.create_version_with_upload(
"model_v2.joblib", model.id, description="retrained on more data"
)
client.model_registry.deploy_version(model.id, added["version"])
activate_version
activate_version(model_id: str, version: int) -> Dict[str, Any]
Point the served artifact/metrics at a version without redeploying.
deploy_version
deploy_version(model_id: str, version: int) -> Dict[str, Any]
Set a version active and (re)deploy the serving pod with that version's artifact. Rolling back is just deploying an earlier version again.