# How-To: Deploy Workload

{% hint style="warning" %}

### Important: Contact LatticaAI First

For **AI model deployments**, contact LatticaAI to discuss your model’s parameters. This consultation ensures that the model is compatible with encrypted data processing and can be successfully prepared as a homomorphic-ready workload.

For **Sunscreen-based TFHE programs**, you deploy a **compiled program artifact**. In this case, the homomorphic pipeline creation step does **not** apply.
{% endhint %}

<img src="/files/bvfGwHkUHd2ogh1qvhHy" alt="Diagram of the AI Model deployment process" class="gitbook-drawing">

{% stepper %}
{% step %}

### Register the Model

Before deployment, the AI model must be registered in the system to receive a unique identifier (**modelId**).

1. Use the **Management Client** via Python SDK to register the model.
2. Provide the required details during registration:
   * **Model Name**: This is a **mandatory field** and must be unique across the system.
   * **Optional Parameters**: You can include additional metadata, such as:
   * Description
   * Input type
   * Output type
3. **After registration,** a unique **model ID** will be generated and provided.

{% hint style="info" %}
**Model Management**: Once the model is registered, you can manage its settings (e.g., activate/deactivate, modify parameters) through the web console or Python SDK.
{% endhint %}
{% endstep %}

{% step %}

### Submit the AI Model LatticaAI Backend

Using the **Management Client or our Console**, submit the AI model associated with the registered **modelId**.
{% endstep %}

{% step %}

### Build the Homomorphic-Ready Model

After the AI model is submitted, LatticaAI prepares the model to process encrypted data securely.

1. Mastery builds the **Homomorphic Pipeline Model** from the submitted AI model.
2. During this process, the model status will remain **"Pending Pipeline"**.
3. Once the model is ready, its status will update to **"Active"**, and Mastery will notify you.

**Tracking**: You can monitor the model's status in the web console.

{% hint style="warning" %}
Currently, building a Homomorphic Pipeline requires the **Help Desk Service** assistance.

**Future Feature**: Automatic homomorphic-ready model creation from AI provider models will be supported in future releases.
{% endhint %}
{% endstep %}
{% endstepper %}

***

{% tabs %}
{% tab title="🌐Console" %}

<figure><img src="/files/Ids1NIvtldBVa0eNagTE" alt=""><figcaption></figcaption></figure>

1. **Open the Models Dashboard**
   * Click **Add Model** on the main dashboard. This opens a sidebar where you’ll enter your new model’s details.
2. **Provide Model Details**
   * **Name (required)**: Must be unique within your account.
   * **Description (optional)**: Briefly explain what your model does.
   * **Input/Output Types (optional)**: Specify whether your model uses images, audio, text, or vectors.
   * **Model Visibility (currently private only)**: Future versions will allow public sharing.
   * **Auto Restart (always On)**: A future release will offer manual restarts.
3. **Upload the AI Model File**
   * While not mandatory during initial registration, **the model file must be provided before any queries can run** (so it can be translated into a homomorphic-ready version).
   * If you have the file, click **Choose your Model here**. A placeholder diagram confirms the upload.
4. **Save Your Model**
   * **Nothing is saved until you click “Add.”** Changes, including file uploads, are only committed after pressing **Add** and seeing a success message.

{% hint style="warning" %}
Even if you receive a success message after providing all details, the model is not immediately ready for queries. We first need to build the homomorphic pipeline from your model, which can take additional time depending on its complexity. \
Once the homomorphic version is created and deployed, the model status changes to **Active**. For more information on model statuses, see our “[Model Settings](/how-to-guides/workload-lifecycle/how-to-modify-workload-settings.md)” documentation.
{% endhint %}
{% endtab %}

{% tab title="🧊Python SDK" %}

```python

# Create Plain Model
import LatticaManagement

# Authenticate
lattica = LatticaManagement("your_license_from_lattica_console")

# Register a new model...
model_id = lattica.create_model("model_name")

# Upload model...
with open("MyModel.pth", 'rb') as model_file:
    lattica.upload_plain_model_file(model_file, model_id)
    
```

{% endtab %}
{% endtabs %}


---

# 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://platformdocs.lattica.ai/how-to-guides/workload-lifecycle/how-to-deploy-workload.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.
