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)
Methods
Core
list
list(*, search: str | None = None, framework: str | None = None, source: str | None = None, deployment_status: str | None = None, tag: str | None = None, workspace_id: str | None = None, limit: int | None = None) -> SyncPaginator[RegisteredModelSummary]
List registered models with pagination and filtering.
Each model is its summary; retrieve returns the full model.
Parameters
search(str | None, optional): Search by name, description, framework or algorithm.framework(str | None, optional): Filter by framework (e.g."pytorch","tensorflow").source(str | None, optional): Filter by source.deployment_status(str | None, optional): Filter by deployment status.tag(str | None, optional): Filter by tag.workspace_id(str | None, optional): Filter by workspace ID.limit(int | None, optional): Maximum number of items to return (default: all matching items).
create
create(*, name: str, framework: str, source: str | None = None, description: str | None = None, framework_version: str | None = None, python_version: str | None = None, tags: Sequence[str] | None = None, workspace_id: str | None = None, artifact: Mapping[str, Any] | None = None, manifest: Mapping[str, Any] | None = None, manifest_raw: str | None = None, problem_type: str | None = None, feature_names: Sequence[str] | None = None, input_fields: Sequence[Mapping[str, str]] | None = None, requirements: Sequence[str] | None = None, environment_variables: Mapping[str, str] | None = None, addons: Sequence[str] | None = None, data_sources: Sequence[str] | None = None) -> RegisteredModel
Register a new model.
Parameters
name(str): Human-readable model name.framework(str): Model framework (e.g.sklearn,pytorch).source(str | None, optional): Model source (e.g.external,upload,fine-tuning).description(str | None, optional): Optional description.framework_version(str | None, optional): The library version the model file was saved with (sklearn.__version__etc.).python_version(str | None, optional): The Python the model file was saved with.tags(Sequence[str] | None, optional): Optional tags.workspace_id(str | None, optional): Workspace to register the model in.artifact(Mapping[str, Any] | None, optional): An uploaded artifact reference dict, e.g. {s3Key, sizeMb?, s3Bucket?}.manifest(Mapping[str, Any] | None, optional): Parsed bundle manifest (free-form, fromupload_artifact).manifest_raw(str | None, optional): Raw manifest YAML text.problem_type(str | None, optional): The model's task,"classification"or"regression". Stored attraining.problemType; required by drift detection to compare the right distributions (set it if you plan to run :doc:drift-detectionon the model).input_fields(Sequence[Mapping[str, str]] | None, optional): A single model file's inputs in the order it takes them, e.g.[{"name": "tenure", "type": "int"}, {"name": "plan", "type": "string"}](typefloat,int,stringorbool). Required for a single.joblib/.pkl/.pt/.onnxfile: its inputs are fed in this order. Passfeature_nameswith the same names.requirements(Sequence[str] | None, optional): pip requirements a single file's pickle imports beyond its framework (e.g."category-encoders==2.6.3"), installed in its serving image.environment_variables(Mapping[str, str] | None, optional): The model's own environment variables, set on its serving pod. Names the platform sets (MODEL_*,STRONGLY_*,AWS_*,FRAMEWORK, ...) are refused.addons(Sequence[str] | None, optional): Secret references: add-on ids whose connections and credentials reach the model's pods inSTRONGLY_SERVICES(as an app's or a job's do; never written into the model). Each must be one you and the model's owner may use.data_sources(Sequence[str] | None, optional): Secret references: data source ids (e.g. anapidata source holding a site login or token) whose connections and credentials reach the model's pods inSTRONGLY_SERVICES.- `A single model file is registered only with ``framework_version```
(scikit-learn, xgboost, lightgbm, torch), ``python_version`` (apickle) and ``input_fields``: it is served with exactly that libraryand Python, and fed its inputs in that order.
retrieve
retrieve(model_id: str) -> RegisteredModel
Get a single registered model by ID.
update
update(model_id: str, *, name: str | None = None, description: str | None = None, tags: Sequence[str] | None = None, problem_type: str | None = None) -> RegisteredModel
Update a registered model; only the fields given change.
Parameters
model_id(str): The model.name(str | None, optional): A new name (unique among your models).description(str | None, optional): A new description.tags(Sequence[str] | None, optional): Its tags.problem_type(str | None, optional): The model's task:classification,regression,multiclass,multilabel,timeseriesorother. Setstraining.problemTypeand keeps the rest of its training record. Drift detection needsclassificationorregression: set it on a model registered without one (e.g. a run's model whose tasklog_modelcould not tell).
delete
delete(model_id: str) -> None
Delete a registered model, its deployment and its uploaded artifacts.
Raises ConflictError (409, model-in-use, naming them) while an A/B test
compares it, an app, workspace or job selects it, or a workflow or agent calls it, and
BadGatewayError (502) when its deployment could not be deleted (the
model is kept; the error's detail is the reason).
Lifecycle & actions
start
start(model_id: str) -> RegisteredModel
Start a previously-stopped registered model.
Raises ConflictError (409) for a model whose
RegisteredModel.retrain_reason is set.
stop
stop(model_id: str) -> RegisteredModel
Stop a deployed registered model (tears down its serving pod).
The platform deploys from a non-running state, so stop a running model
before deploying a different version of it (see deploy_version).
deploy
deploy(model_id: str, *, resources: Mapping[str, Any] | None = None, autoscaling: Mapping[str, Any] | None = None, scheduling_mode: str | None = None, auto_shutdown_minutes: int | None = None, schedule_rules: Sequence[Mapping[str, Any]] | None = None, scaling_mode: str | None = None, min_replicas: int | None = None, max_replicas: int | None = None, target_concurrency: int | None = None, use_spot: bool | None = None, spot_fallback: bool | None = None, instance_type: str | None = None) -> RegisteredModel
Deploy a registered model.
Parameters
model_id(str): The model ID.resources(Mapping[str, Any] | None, optional):{cpu, memory, disk, gpu, gpu_type, replicas}:cpu,memory,diskandgpu_typeare strings ("2","4Gi"),gpuandreplicasnumbers.autoscaling(Mapping[str, Any] | None, optional): The always-on HPA:{enabled, min_replicas, max_replicas, cpu_threshold, memory_threshold, scale_up_cooldown, scale_down_cooldown, target_concurrency}` (`enabled,min_replicasandmax_replicasrequired).scheduling_mode(str | None, optional):"always_on","on_demand"or"scheduled".auto_shutdown_minutes(int | None, optional): Idle minutes before an on-demand model scales to zero; 0 means always on.schedule_rules(Sequence[Mapping[str, Any]] | None, optional): A scheduled model's start and stop times, each{id, action: "start" | "stop", day_of_week: [0-6] (0 = Sunday), time: "HH:MM", timezone: IANA name}.scaling_mode(str | None, optional):"fixed"or"auto"(on-demand demand scaling).min_replicas, max_replicas(int | None, optional): The awake replica bounds forscaling_mode="auto".target_concurrency(int | None, optional): In-flight predictions per replica"auto"sizes for.use_spot(bool | None, optional): Run on spot capacity.spot_fallback(bool | None, optional): Withuse_spot, fall back to on-demand capacity when spot is unavailable (defaultTrue).instance_type(str | None, optional): An instance type override.:meth:update_servingchanges these without deploying. Any otherfield is refused by the server.Raises ``ConflictError`` (409) for a model whose- ```RegisteredModel.retrain_reason`` is set (an AutoML`
model that records no trainer image): retrain its AutoML job andpublish the new model.
Other
activate_baseline
activate_baseline(model_id: str, baseline_id: str) -> BaselineActivated
Make an earlier baseline its version's active one again.
Drift compares the version with it from the next analysis on.
activate_version
activate_version(model_id: str, version: int) -> RegisteredModel
Set the active version (served artifact/metrics) without deploying.
actuals_upload_url
actuals_upload_url(model_id: str, filename: str) -> UploadLink
Return a link to upload a CSV of actuals of any size.
(predictionId or entityId, actual, optionally actualAt).
import_actuals_file uploads and imports in one call.
analytics
analytics(model_id: str, *, period: str | None = None) -> ModelAnalytics
Get who calls a model, how often, and how fast and well it answers.
Parameters
model_id(str): The model's ID.period(str | None, optional): 7d, 30d (the default) or 90d.
baseline_upload_url
baseline_upload_url(model_id: str, filename: str) -> UploadLink
Return a link to upload a CSV of a version's reference rows of any size.
build_baseline_from_file uploads and builds in one call.
build_baseline
build_baseline(model_id: str, *, upload_id: str | None = None, filename: str | None = None, volume_id: str | None = None, path: str | None = None, version: int | None = None, analyze_daily: bool = False) -> BaselineJob
Build a version's drift baseline from its reference rows.
(the data it was trained or validated on): a CSV with a column per input feature and,
optionally, actual, prediction and confidence.
Parameters
upload_id, filename(str | None, optional): An upload frombaseline_upload_url.volume_id, path(str | None, optional): Or a file on a shared volume.version(int | None, optional): The version the rows describe (default: the active version).analyze_daily(bool, optional): Turn on the model's daily drift analysis once the baseline is kept (the first analysis counts as that day's run).
Returns
BaselineJob: The job. Its baseline becomes the version's active one, and the version's first drift analysis starts when it has production predictions from the last 7 days. Follow it withlist_baseline_jobs.
build_baseline_from_file
build_baseline_from_file(model_id: str, file: str | Path | BinaryIO, *, version: int | None = None, analyze_daily: bool = False) -> BaselineJob
Upload a local CSV of reference rows (streamed, any size) and build the baseline from it.
See build_baseline.
build_log_download_link
build_log_download_link(model_id: str) -> DownloadLink
Return a signed link (5 minutes) to the whole log of the model's current image build.
create_version
create_version(model_id: str, *, artifact: Mapping[str, Any], description: str | None = None, manifest: Mapping[str, Any] | None = None, manifest_raw: str | None = None, metrics: Mapping[str, Any] | None = None, framework_version: str | None = None, python_version: str | None = None, requirements: Sequence[str] | None = None, input_fields: Sequence[Mapping[str, str]] | None = None, environment_variables: Mapping[str, str] | None = None, addons: Sequence[str] | None = None, data_sources: Sequence[str] | None = None) -> ModelVersion
Add a new version to a registered model from an uploaded artifact.
Upload the new artifact first with upload_artifact and pass its
reference ({"s3Key": ...}) as artifact - or use
create_version_with_upload, which does both.
Parameters
model_id(str): The registered model's id.artifact(Mapping[str, Any]): Artifact reference{"s3Key", "s3Bucket"?, "sizeMb"?}.description(str | None, optional): Version description / changelog.manifest(Mapping[str, Any] | None, optional): Parsed manifest (for.zipbundles).manifest_raw(str | None, optional): Raw manifest text.metrics(Mapping[str, Any] | None, optional): Evaluation metrics for this version.framework_version, python_version, requirements(optional): For a single model file: the library and Python it was saved with and the pip requirements its pickle imports (seecreate).input_fields(Sequence[Mapping[str, str]] | None, optional): This version's inputs in order, when they differ from the model's.environment_variables(Mapping[str, str] | None, optional): This version's own environment variables: when it becomes the active version (activate_version,deploy_version) they replace the model's; left out, the model's stay.addons, data_sources(Sequence[str] | None, optional): This version's own secret references (add-on and data source ids whose credentials reach its pods inSTRONGLY_SERVICES): when it becomes the active version they replace the model's; left out, the model's stay.
Returns
ModelVersion:{"version": <int>, "modelId": <id>}- the new version number.
create_version_with_upload
create_version_with_upload(file: str | Path | BinaryIO, model_id: str, *, description: str | None = None, metrics: Mapping[str, Any] | None = None, framework_version: str | None = None, python_version: str | None = None, requirements: Sequence[str] | None = None, input_fields: Sequence[Mapping[str, str]] | None = None, environment_variables: Mapping[str, str] | None = None, addons: Sequence[str] | None = None, data_sources: Sequence[str] | None = None) -> ModelVersion
Upload a new artifact and add it as a new version, in one call.
The registry-level analogue of create_with_upload, but for a
model that already exists: it streams the new bundle up and appends a
version pointing at it. Deploy it with deploy_version.
Returns
dict[str, Any]:{"version": <int>, "modelId": <id>}.
create_with_upload
create_with_upload(file: str | Path | BinaryIO, *, name: str, framework: str, description: str | None = None, tags: list[str] | None = None, workspace_id: str | None = None, problem_type: str | None = None, feature_names: Sequence[str] | None = None, framework_version: str | None = None, python_version: str | None = None, input_fields: Sequence[Mapping[str, str]] | None = None, requirements: Sequence[str] | None = None, environment_variables: Mapping[str, str] | None = None, addons: Sequence[str] | None = None, data_sources: Sequence[str] | None = None) -> RegisteredModel
Upload a model artifact and register it in one call.
Combines upload_artifact (the bundle streamed to object storage and validated)
and create (the registry entry), attaching the uploaded artifact
and any parsed manifest so the model is immediately deployable.
Parameters
file(str | Path | BinaryIO): Path or open binary file - a.zipbundle with astrongly.manifest.yamlor a single.pkl/.joblib/.pt/.onnxartifact.name(str): Human-readable model name.framework(str): Model framework (sklearn,xgboost,pytorch,tensorflow,onnx,custom). A bundle manifest's framework, when present, takes precedence server-side.description(str | None, optional): Optional description.tags(list[str] | None, optional): Optional tags.workspace_id(str | None, optional): Optional workspace to register the model in.problem_type(str | None, optional): The model's task,"classification"or"regression". Set it if you plan to run drift detection on the model (drift requirestraining.problemType).feature_names(Sequence[str] | None, optional): The model's input names in order (tabular frameworks require them).framework_version(str | None, optional): The library version a single model file was saved with (required for scikit-learn, xgboost, lightgbm and torch files).python_version(str | None, optional): The Python a single.joblib/.pklfile was saved with (required for a pickle).input_fields(Sequence[Mapping[str, str]] | None, optional): A single model file's inputs in the order it takes them, e.g.[{"name": "tenure", "type": "int"}, {"name": "plan", "type": "string"}](typefloat,int,stringorbool). Required for a single.joblib/.pkl/.pt/.onnxfile: its inputs are fed in this order. Passfeature_nameswith the same names.requirements(Sequence[str] | None, optional): pip requirements a single file's pickle imports beyond its framework (e.g."category-encoders==2.6.3"), installed in its serving image.environment_variables(Mapping[str, str] | None, optional): The model's own environment variables, set on its serving pod. Names the platform sets (MODEL_*,STRONGLY_*,AWS_*,FRAMEWORK, ...) are refused.addons(Sequence[str] | None, optional): Secret references: add-on ids whose connections and credentials reach the model's pods inSTRONGLY_SERVICES(as an app's or a job's do; never written into the model). Each must be one you and the model's owner may use.data_sources(Sequence[str] | None, optional): Secret references: data source ids (e.g. anapidata source holding a site login or token) whose connections and credentials reach the model's pods inSTRONGLY_SERVICES.
Returns
RegisteredModel: The registeredRegisteredModel, ready todeploy.
Examples
import sys, sklearn
model = client.model_registry.create_with_upload(
"model.joblib",
name="churn-rf",
framework="sklearn",
framework_version=sklearn.__version__,
python_version=sys.version.split()[0],
problem_type="classification",
feature_names=["tenure", "monthly_spend"],
input_fields=[
{"name": "tenure", "type": "int"},
{"name": "monthly_spend", "type": "float"},
],
)
client.model_registry.deploy(model.id)
delete_version
delete_version(model_id: str, version: int) -> None
Delete one version of a model (a duplicate, or one no longer wanted).
Its image, its uploaded bundle (kept while another version is the same upload), its baselines and the drift analyses against them are deleted. Its predictions are kept and still name it; its number is never given to a later version.
Raises ConflictError (409) for the active version (deploy or activate
another one first), the only version (delete the model instead), a
version being deployed, and one whose baseline is being built; the
error's code says which (version-active, only-version,
version-deploying, baseline-building). NotFoundError (404)
for a version the model does not have.
deploy_version
deploy_version(model_id: str, version: int, *, resources: Mapping[str, Any] | None = None, autoscaling: Mapping[str, Any] | None = None, scheduling_mode: str | None = None, auto_shutdown_minutes: int | None = None, schedule_rules: Sequence[Mapping[str, Any]] | None = None, scaling_mode: str | None = None, min_replicas: int | None = None, max_replicas: int | None = None, target_concurrency: int | None = None, use_spot: bool | None = None, spot_fallback: bool | None = None, instance_type: str | None = None) -> RegisteredModel
Deploy a specific version: set it active and (re)deploy the pod.
Parameters
model_id(str): The model ID.version(int): The version to deploy.resources, autoscaling, scheduling_mode, ...(optional): The deploy's size and scaling: every keyworddeploytakes.Raises ``ConflictError`` (409) for a version whose ``retrain_reason`` is set.
download_build_log
download_build_log(model_id: str, dst_path: str | os.PathLike[str] | None = None) -> str
Download the whole log of the model's current image build; return where it was saved.
A running build's log is what it has written so far.
It comes straight from storage through a signed link
(build_log_download_link), written to disk as it arrives (<model>-<build>.log).
dst_path is a file, or a folder to save it in (default: its name, in
the current folder).
Parameters
model_id(str): The model ID.dst_path(str | os.PathLike | None, optional): Where to save it.
import_actuals
import_actuals(model_id: str, *, upload_id: str | None = None, filename: str | None = None, volume_id: str | None = None, path: str | None = None) -> ActualsImport
Import a CSV of actuals.
An upload (upload_id from actuals_upload_url and its filename) or a file on
a shared volume (volume_id and path). A job reads it; follow it with
list_actuals_imports.
import_actuals_file
import_actuals_file(model_id: str, file: str | Path | BinaryIO) -> ActualsImport
Upload a local CSV of actuals (streamed, any size) and import it.
list_actuals_import_rejections
list_actuals_import_rejections(model_id: str, import_id: str, *, search: str | None = None, limit: int | None = None) -> SyncPaginator[ActualsImportRejection]
Return the rows an actuals import could not record, each with its line and why.
list_actuals_imports
list_actuals_imports(model_id: str, *, search: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[ActualsImport]
Return the model's actuals imports (newest first): status and counts.
Parameters
sort(str | None, optional):-createdAt(default),status,rowsRead,recorded,rejected.
list_baseline_jobs
list_baseline_jobs(model_id: str, *, search: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[BaselineJob]
Return the model's baseline jobs (newest first).
Parameters
sort(str | None, optional):-createdAt(default),status,modelVersion.
list_callers
list_callers(model_id: str, *, period: str | None = None, search: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[ModelCaller]
List a model's callers over a period, with their predictions and failures.
Parameters
model_id(str): The model's ID.period(str | None, optional): 7d, 30d (the default) or 90d.search(str | None, optional): Only callers whose name, email, app or workflow contains this.sort(str | None, optional): predictions, errors, lastSeen or name; prefix - for descending. -predictions when omitted.limit(int | None, optional): The most callers to return; all of them when omitted.
list_versions
list_versions(model_id: str, *, sort: str | None = None, limit: int | None = None) -> SyncPaginator[ModelVersion]
List a registered model's versions, newest first.
Version 1 is created when the model is first registered; each call to
create_version (or create_version_with_upload) adds the
next. Use RegisteredModel.active_version (or the model's
activeVersion) to see which one is currently served.
Parameters
model_id(str): The model's id.sort(str | None, optional):"-version"(the API's default, newest first),"version"(oldest first),"createdAt"or"-createdAt"; another field is refused.limit(int | None, optional): The most to return; all of them when omitted.
logs
logs(model_id: str, *, log_type: str | None = None) -> ModelLogs
Get a registered model's build or runtime logs.
Parameters
model_id(str): The model's ID.log_type(str | None, optional): build (the default) or runtime.
predict
predict(model_id: str, input_data: Any, *, entity_id: str | None = None, source: str | None = None, path: str | None = None) -> Prediction
Run inference on a deployed registered model.
The model must be deployed (deployment status running). The request
is proxied to the model's pod through the AI Gateway, since model pods
are internal to the cluster.
Every prediction is recorded with its model version.
Parameters
model_id(str): The registered model's id.input_data(Any): 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). A model that resolves its features from a feature store takes just the entity keys ({"driver_id": 1002}); an entity the store has no current value for fails withUnprocessableEntityError(422).entity_id(str | None, optional): Your id for what is predicted; actuals can join on it.source(str | None, optional):"production"(default) or"test"; test predictions are kept out of production results (drift, A/B tests).path(str | None, optional): The route on the model to call when it serves more than one (e.g."parse_text"); omit it for the model's default.
Returns
Prediction: A dict withprediction/predictions,probabilities,latency_ms,prediction_id(prediction_idsfor several rows) andentity_id. Record actuals againstprediction_id(or yourentity_id) withrecord_actuals.
record_actuals
record_actuals(model_id: str, actuals: Sequence[Mapping[str, Any]]) -> ActualsRecordResult
Record actuals (true outcomes) for the model's predictions.
Parameters
actuals(Sequence[Mapping[str, Any]]): Each{"predictionId" or "entityId", "actual", "actualAt"?}(snake_case keys accepted). An entity id actual labels that entity's predictions made within the model's actuals window beforeactualAt(else now); either may arrive first. A second actual for the same key replaces the first.
Returns
ActualsRecordResult: How many were recorded or replaced, and the rows refused with why.
stats
stats(*, search: str | None = None, framework: str | None = None, source: str | None = None, deployment_status: str | None = None, tag: str | None = None, workspace_id: str | None = None) -> RegisteredModelStats
Count the registered models list lists, with the same filters.
It counts them in all, by deployment status, framework, source and latest drift result.
Every model you may use with these filters is counted (not a page).
Parameters
search, framework, source, deployment_status, tag, workspace_id(optional): Aslisttakes them.
Returns
RegisteredModelStats:total,by_deployment_status,by_framework,by_sourceandby_drift_status(Nonefor a model never analyzed), most first.
status
status(model_id: str) -> ModelServingStatus
Get a registered model's serving status.
Parameters
model_id(str): The model's ID.
Returns
ModelServingStatus: model_id, status, can_serve (whether it answers a prediction now, waking it if it is idle), retrain_reason (why it must be retrained before it can be deployed or started, None when it can be), active_version, version_count and updated_at.
update_monitoring
update_monitoring(model_id: str, *, record_inputs: bool | None = None, label_window_days: int | None = None) -> RegisteredModel
Change the model's monitoring settings; they apply from its next prediction.
Parameters
record_inputs(bool | None, optional): Keep each prediction's inputs and whole output (default on). Turn it off for models whose inputs are sensitive: predictions are still recorded, but input drift cannot be measured.label_window_days(int | None, optional): How long an actual keyed by entity id may take to arrive and still label that entity's predictions (1 to 90 days; default 14).
update_serving
update_serving(model_id: str, *, environment_id: str | None = None, resources: Mapping[str, Any] | None = None, autoscaling: Mapping[str, Any] | None = None, scheduling_mode: str | None = None, auto_shutdown_minutes: int | None = None, schedule_rules: Sequence[Mapping[str, Any]] | None = None, scaling_mode: str | None = None, min_replicas: int | None = None, max_replicas: int | None = None, target_concurrency: int | None = None, use_spot: bool | None = None, spot_fallback: bool | None = None, environment_variables: Mapping[str, str] | None = None, addons: Sequence[str] | None = None, data_sources: Sequence[str] | None = None) -> RegisteredModel
Change how the model is served (its Environment tab), without deploying.
A registry model has the scaling strategies a self-hosted model has:
always on (scheduling_mode="always_on", optionally with the
autoscaling HPA), on demand (auto_shutdown_minutes of at least
1, scaling_mode "fixed" or "auto" with min/max/target),
or scheduled (scheduling_mode="scheduled" with
schedule_rules), and optionally spot capacity. Scheduling and
demand scaling apply to a deployed model at once; resources and spot
from its next deploy.
A size is the whole workload: Strongly's helper services beside it
(sign-in proxy, outbound proxy, data volume mounts, model cache upload,
metrics) are taken out of it, never added on top (set 4 GB and the workload
uses 4 GB in total). A size too small to hold them is refused naming them.
A CPU, memory, GPU count or disk above the largest allowed machine's room
for one workload raises APIError with status_code 400 naming the
resource and both figures, and nothing is created or changed. Check
client.compute.list_pools() allowed_sizes (max_cpu,
max_memory_gib, max_disk_gib, max_gpus) before a large size.
Parameters
environment_id(str | None, optional): An environment to size the model by, or"custom"forresources.resources(Mapping[str, Any] | None, optional):{cpu, memory, gpu, gpu_type, disk, replicas}.gpu_type: One of the typeslist_gpu_optionslists (the admin Compute selection); any other is refused with a 400ValidationError.autoscaling(Mapping[str, Any] | None, optional): The always-on HPA:{enabled, min_replicas, max_replicas, cpu_threshold, memory_threshold}.scheduling_mode(str | None, optional):"always_on","on_demand"or"scheduled".auto_shutdown_minutes(int | None, optional): Idle minutes before an on-demand model scales to zero; 0 means always on.schedule_rules(Sequence[Mapping[str, Any]] | None, optional): A scheduled model's start and stop times, each{id, action: "start" | "stop", day_of_week: [0-6] (0 = Sunday), time: "HH:MM", timezone: IANA name}; at least one start and one stop.scaling_mode(str | None, optional):"fixed"or"auto"(on-demand demand scaling).min_replicas, max_replicas(int | None, optional): The awake replica bounds forscaling_mode="auto".target_concurrency(int | None, optional): In-flight predictions per replica"auto"sizes for.use_spot(bool | None, optional): Run on spot capacity.spot_fallback(bool | None, optional): Withuse_spot, fall back to on-demand capacity when spot is unavailable (defaultTrue).environment_variables(Mapping[str, str] | None, optional): The model's own environment variables, replacing its whole set ({}clears them); from its next deploy. Names the platform sets are refused.addons(Sequence[str] | None, optional): Secret references: add-on ids whose connections and credentials reach the model's pods inSTRONGLY_SERVICES(as an app's or a job's do; never written into the model). Each must be one you and the model's owner may use.data_sources(Sequence[str] | None, optional): Secret references: data source ids (e.g. anapidata source holding a site login or token) whose connections and credentials reach the model's pods inSTRONGLY_SERVICES. Each list replaces the model's whole list ([]clears it), from its next deploy.
Returns
RegisteredModel: The model.
upload_artifact
upload_artifact(file: str | Path | BinaryIO) -> UploadedArtifact
Upload a model artifact bundle to the registry's object store.
Parameters
file(str | Path | BinaryIO): A path or open binary file. Either a.zipbundle that contains astrongly.manifest.yaml(at its root or one level nested), or a single serialized model file (.pkl/.joblib/.pt/.onnx), up to 5 GB. It is streamed straight to object storage through a presigned link, then validated.
Returns
UploadedArtifact: The upload result:s3Key,sizeMb,bucketand, for manifest bundles,manifest/manifestRaw. Pass these tocreateto register the artifact - or just callcreate_with_upload, which does both.