# MLCloudModel

The `MLCloudModel` represents an ML model that makes predictions on NatML's cloud infrastructure. As such, it forms the basis for implementing cloud predictors in code.

## Creating the Model

```csharp
/// <summary>
/// Create a cloud ML model.
/// </summary>
/// <param name="tag">Predictor tag.</param>
/// <param name="accessKey">NatML access key.</param>
static Task<MLCloudModel> Create (string tag, string accessKey = null);
```

The model can be created from a predictor on NatML Hub:

{% embed url="<https://hub.natml.ai/>" %}
NatML Hub predictor catalog.
{% endembed %}

{% hint style="info" %}
The predictor MUST have an active prediction endpoint.
{% endhint %}

## Making Predictions

```csharp
/// <summary>
/// Make a prediction on one or more cloud ML features.
/// </summary>
/// <param name="inputs">Input cloud ML features.</param>
/// <returns>Output cloud ML features.</returns>
MLFeatureCollection<MLCloudFeature> Predict (params MLCloudFeature[] inputs);
```

The `MLCloudModel` model defines a `Predict` method which makes predictions on one or more `MLCloudFeature` instances.

{% hint style="warning" %}
The input and output features MUST be disposed when they are no longer needed. Call `Dispose` on the individual features, or on the returned feature collection to do so.
{% endhint %}

## Disposing the Model

```csharp
/// <summary>
/// Dispose the model and release resources.
/// </summary>
void Dispose ();
```

Refer to the [Disposing the Model](/unity/api/mlmodel.md#disposing-the-model) section of the [`MLModel`](/unity/api/mlmodel.md) class for more information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.natml.ai/unity/api/mlmodel/mlcloudmodel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
