FoundationModel

class autogluon.cloud.FoundationModel(model_id: str, **kwargs)[source]

Pretrained foundation model inference on AWS.

Factory: FoundationModel(model_id, ...) dispatches on the model’s task and returns the appropriate task-specific subclass (TimeSeriesFoundationModel, TabularFoundationModel). Most users instantiate the subclass directly instead.

Examples

>>> model = FoundationModel("chronos-2")  # returns a TimeSeriesFoundationModel
>>> predictions = model.predict(data, prediction_length=24)
Parameters:
  • model_id – ID of the foundation model from the model registry. See Available models in the foundation model tutorial for the list of supported values.

  • cloud_output_path –

    S3 location where intermediate artifacts are stored. Accepts:

    • s3://bucket — a unique timestamped subfolder ag-<timestamp> is appended.

    • s3://bucket/prefix — used verbatim. Re-running with the same prefix will overwrite previously written artifacts.

    • None (default) — use the bucket saved in ~/.autogluon/cloud.yaml (set by autogluon.cloud.bootstrap() / autogluon.cloud.register()) and append a timestamped subfolder. Raises if no bucket is configured.

  • hyperparameters – Default hyperparameters applied to inference and (when supported) training.

  • model_artifact_uri – S3 URI of a pre-bundled model.tar.gz produced by cache_model_artifact(). When set, deploys skip the runtime HuggingFace download and load weights from the bundled artifact.

  • backend – Backend name or reusable SageMakerConfig with region, execution role, networking, encryption and tags. "sagemaker" uses default settings.

Methods

cache_model_artifact

Download model weights from HuggingFace, bundle them with the FM serve script into a SageMaker-compatible model.tar.gz, and upload to S3.

deploy

Deploy model to a real-time endpoint.

from_dict

Restore from to_dict() output.

from_json

Restore from a to_json() string.

predict

Subclasses override with task-specific signature.

to_dict

Serialize the model identity.

to_json

Serialize to_dict() output as a JSON string.