Publish and Retrieve Models
Publish a trained model when you need to reuse it after the current Python process or notebook session ends.
Publication copies the complete model bundle to durable storage or a supported model registry.
Retrieval validates that bundle and restores a fitted Trainer.
Connector retrieval first fetches a local copy.
Choose the retention method by destination. Local Python deployments commonly use a retained filesystem, S3, or GCS. Snowflake notebooks can use Snowflake Model Registry. Databricks deployments can publish to Unity Catalog, or copy the complete bundle to a Unity Catalog volume and load it from that path in a later process. To register every fit automatically in MLflow, Unity Catalog, SageMaker, or Snowflake (preview) and promote versions with aliases, refer to Register and Promote Models.
Prerequisites
This page continues from Train a Model. Before you publish or retrieve a model, complete the following prerequisites:
- Complete a successful fit, which creates the reloadable model bundle that publication copies.
- Keep the matching word vectors available in the prediction environment for models with text embeddings.
Understand What a Model Bundle Contains
Every successful fit creates a reloadable bundle at fit_result.bundle_dir.
The bundle includes the trained checkpoint, model plan, query, effective training-table generation settings, metrics, and manifests required by Trainer.load().
The bundle does not include:
- Source tables or credentials
- The materialized graph snapshot or index
- Generated training or prediction inputs
- Prediction or embedding outputs, including the local holdout prediction file
- Complete epoch-by-epoch training history
- Post-training explanation files
Retain these artifacts separately before deleting scratch if you need to reuse them. Keep the entire bundle unchanged. A checkpoint by itself is not sufficient, and a model bundle cannot recreate missing source data or graph storage. Refer to Training Diagnostics and Inspect Model Explanations.
Publish During Training
Supply ModelOutputConfig to the fit call when you want a durable model copy.
This replaces the ordinary fit call. It does not require an additional training run.
ModelOutputConfig(connector, path=None, location=None) requires exactly one destination:
- Use
pathfor filesystem or object-storage publication. - Use
locationwithModelRegistryLocationfor a supported model registry.
Filesystem and Object Storage
Snowflake Model Registry
Unity Catalog Model Registry
Publish a model to a separate filesystem destination with a FileConnector:
Choose a new or empty destination that does not overlap the working bundle.
Filesystem publication creates an independent model copy. Its durability depends on the destination filesystem.
For S3 or GCS, use the corresponding output connector and a path within that connector.
fit_result.bundle_dir remains the working copy. fit_result.published_model describes the published copy.
Publish to Snowflake Model Registry with the connector configured for the notebook session:
The registry uses the connector’s database and schema. The notebook identity needs permission to create the model or add a version. Record the returned name and assigned version. Do not substitute an assumed version later.
Publish to Unity Catalog with connector, a kumo.DatabricksConnector set up as in Connect Your Data: Databricks from an installation of kumo-engine[databricks]. Replace main.ml.users_churn with <catalog>.<schema>.<model> in the connector’s catalog and schema, or with only <model>:
The connector’s identity needs USE CATALOG and USE SCHEMA, and permission to create the model or add a version to it. Record the returned version.
Copy to a Unity Catalog Volume
To keep the bundle in a Unity Catalog volume instead of the registry, copy the complete bundle after a successful fit. Use ARTIFACT_ROOT as described in Install Kumo Engine in a Databricks Notebook and give each run a separate directory:
Keep the complete copied directory, including its manifests. Record the path and verify that you can load it before deleting local scratch.
The volume copy survives a cluster restart while the volume and its grants are retained. The graph snapshot, generated training table, working model files, and detailed training history remain in driver local scratch unless retained separately. A model bundle does not contain source data, credentials, or the graph index. Refer to Training Diagnostics.
Retrieve a Published Model
Load only model bundles from publishers you trust. Retrieval validates the bundle and restores a fitted trainer for local execution. It does not perform registry-hosted inference.
For models with text embeddings, keep the matching word vectors available in the prediction environment. Retain the text package for its installed models, or recreate the registered embedding store and pass embedding_models=store when loading. Keep any custom embedding module importable after restart. Follow Reload a Trained Text Model and Custom Word Vectors before using the retrieval examples below.
Trainer.load() and Trainer.load_from_connector() restore a completed model for inference.
To initialize a new training run from the saved weights, pass the loaded trainer explicitly as warm_start.
Loading alone does not resume interrupted training.
Calling fit() without warm_start starts fresh.
Filesystem and Object Storage
Snowflake Model Registry
Unity Catalog Volume
Unity Catalog Model Registry
Load a retained local bundle directly:
Alternatively, fetch the filesystem publication through a FileConnector:
Use the same root as publication and the recorded path relative to that root.
Here, path="model-v1" identifies /path/to/retained-models/model-v1.
Retrieval copies the bundle into configured scratch and validates it before loading.
Keep scratch separate from the retained publication, allow room for the copy, and retain read access to the source.
For S3 or GCS, set storage_connector to the configured connector used for publication, then retrieve the bundle with its recorded path:
The connector must point to the publication storage and have read access. Use the address recorded at publication. Filesystem paths are relative to the configured root.
Reconnect to Snowflake, then load the exact version returned by publication:
Replace RECORDED_VERSION with published.version from the completed fit.
The connector must use the database and schema containing the registered model.
Omitting version selects the registry’s default version, which is not necessarily the most recently created version.
Use an explicit recorded version for repeatable retrieval.
Install kumo-engine[databricks], configure new local scratch, and load the complete bundle from its recorded Unity Catalog volume path:
Recreate the source connection, table and graph definitions, and a compatible graph snapshot before scoring. Use the restored trainer’s training_table_generation_plan to generate a new prediction table. Keep the original run directory until the new process completes a scoring check.
Reconnect with a DatabricksConnector, then load the version returned by publication:
Replace RECORDED_VERSION with published.version from the completed fit. To load by an alias instead, refer to Load a Model by Alias.
FileConnector, S3, GCS, Snowflake, and Databricks (Unity Catalog) support connector-based model retrieval.
A DatabricksConnector publishes to and retrieves from Unity Catalog with location=. For a Unity Catalog volume, copy the bundle and use Trainer.load() as shown above.
BigQuery does not support model publication or retrieval through this API.
It does support prediction export.
Find a Published Snowflake Model
Use a Snowflake connector whose identity can read the registry in the intended database and schema. List the visible Kumo model versions before choosing one to retrieve:
The listing returns published-model records ordered by name and version, with recorded training metadata and metrics for each version. The slice limits displayed records, not the registry listing itself. Discovery does not download model bundles. The listing includes only versions that carry Kumo’s metadata marker. An empty list can mean no visible Kumo versions even when other models exist in the registry. Check the connector’s database, schema, and registry permissions if an expected version is missing.
Copy the chosen record’s name and version into the explicit ModelRegistryLocation retrieval example above.
After retrieval, inspect the retained configuration and lineage to confirm the query and training snapshot associated with the model.
Recreate the Prediction Context
Loading a model restores its fitted state, but not its data. Before you make predictions in a new process, complete the following steps:
- Reconnect to the source data.
- Recreate compatible table, graph, and predictive-query definitions.
- Materialize or restore a compatible graph snapshot.
- Generate the population to score using the restored trainer’s generation settings.
The snapshot can contain updated data, provided the trained target, entity, relationships, and feature requirements remain compatible.
Next Steps
Continue to Make Predictions or Production Workflow.