> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubik-agent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosted GPU Parser

> Learn how to deploy and manage your own optimized GPU parser instance.

This guide explains how to self-host our optimized GPU parser that allows for element highlighting.

<Note>
  **Disclaimer**: This deployment process is currently manual. We are working to streamline it in future updates. If you encounter any issues, need assistance, or have specific requirements for other cloud providers, please do not hesitate to reach out to us.
</Note>

## Prerequisites

* Access to the [UBIK Admin Console](https://app.ubik-agent.com/admin)
* Billing owner permissions

## Deployment Steps

1. **Navigate to the Admin Page**
   Go to [https://app.ubik-agent.com/admin](https://app.ubik-agent.com/admin). Here you have access to manage all users within your company.

   <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/1_admin_panel.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=40bcdee3c98587d6a830e054c0852a12" alt="Admin Page Overview" width="2924" height="1610" data-path="images/en/self-hosted-gpu-parser/1_admin_panel.png" />

2. **Initiate Deployment**
   Click on **Deploy Service**.

   <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/2_deploy_service.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=5dd3353ed5edfede26ac51d456781aed" alt="Deploy Service Button" width="2914" height="1606" data-path="images/en/self-hosted-gpu-parser/2_deploy_service.png" />

3. **Configure Service**
   In the deployment modal:
   * Select **"Parsing api (gpu optimized)"** for the service.
   * Select **"Digital Ocean"** as the provider.
   * Select your company (e.g., "demo\_company") as the billing owner.

4. **JSON Configuration**
   Insert the following JSON configuration into the deployment configuration field:

   ```json theme={null}
   {
     "region": "tor1",
     "instance_size": "gpu-4000adax1-20gb",
     "image": "gpu-h100x1-base",
     "health_check_path": "/healthcheck",
     "environment_vars": {
       "PORT": "8080",
       "NUM_WORKERS": "8"
     }
   }
   ```

   <Note>
     **Availability Note**: The cheapest option is `gpu-4000adax1-20gb` in `tor1` (shown above), but it is often out of stock.

     If the deployment fails due to unavailability, try the following configuration which uses `gpu-6000adax1-48gb` and is generally more available:

     ```json theme={null}
     {
       "region": "tor1",
       "instance_size": "gpu-6000adax1-48gb",
       "image": "gpu-h100x1-base",
       "health_check_path": "/healthcheck",
       "environment_vars": {
         "PORT": "8080",
         "NUM_WORKERS": "8"
       }
     }
     ```
   </Note>

   <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/3_deploy_service_filled.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=1382523c41b6fb8ee1356ec907200237" alt="Deployment Configuration" width="1512" height="1284" data-path="images/en/self-hosted-gpu-parser/3_deploy_service_filled.png" />

5. **Deploy**
   Click on **Deploy**. The service will enter a deployment state. This process typically takes around 15 minutes for the machine to be set up.

   <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/4_deployment_in_progress.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=5bacea7bf7c6f1d51b852bd9fef79178" alt="Deployment In Progress" width="2906" height="1602" data-path="images/en/self-hosted-gpu-parser/4_deployment_in_progress.png" />

## Access Management

Once the machine is ready and in a "Running" state, it is initially only associated with your company. You need to grant access to specific users or services.

<img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/5_deployment_ready.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=2e736a34d8ffbd58324466ccbb7a8875" alt="Service Ready" width="2914" height="1598" data-path="images/en/self-hosted-gpu-parser/5_deployment_ready.png" />

Once the machine is ready you’ll see that It will be in a running state. Now that the machine is responsive, let’s link it to a particular service of the platform:

<img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/6_service_registry_management.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=f2b00b5a23c7216f5bc09f2ed82459f5" alt="Service Registry Management" width="2902" height="1602" data-path="images/en/self-hosted-gpu-parser/6_service_registry_management.png" />

1. **Link to Service**
   * Click on **Add from deployment** and select your new machine.
     <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/7_add_from_deployement.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=56f32a4d459f96334e4bedbfdb1dfe07" alt="Add From Deployment" width="2904" height="1600" data-path="images/en/self-hosted-gpu-parser/7_add_from_deployement.png" />
   * Click on **Register**.
     <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/8_save_registry.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=f18bde6de886f21d6cdaad3dbb379868" alt="Register Service" width="2896" height="1596" data-path="images/en/self-hosted-gpu-parser/8_save_registry.png" />
   * Click on **Save**.
     <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/9_new_service_in_registry.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=3b0de59b4d8b8b6477740cb5a004b3de" alt="Save Service" width="3024" height="1032" data-path="images/en/self-hosted-gpu-parser/9_new_service_in_registry.png" />

2. **Manage Permissions**

   * In the service registry management, you have the new service that can be selected. Click on the **Key icon** to determine who should have access to the new service.
     <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/10_new_access.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=07df667d4e17bf13916eabf4f21332a1" alt="Service Registry" width="3022" height="1714" data-path="images/en/self-hosted-gpu-parser/10_new_access.png" />
   * In this menu, if you want to associate it to a particular user, you can select Grant access to **"A specific company"** and then **"The name of your company"**.
   * You can also select to grant access to a particular user that is inside your company for more granular access management.
     <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/11_new_access_filled.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=f3eaa276e6a394aa08286ae12320da4a" alt="Grant Access Menu" width="3024" height="1716" data-path="images/en/self-hosted-gpu-parser/11_new_access_filled.png" />

   You should now see the specific company associated with your service.

   <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/12_new_access_rules_added.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=3ff608f1f7972b5003685d721e2d458f" alt="Access Granted" width="3024" height="1700" data-path="images/en/self-hosted-gpu-parser/12_new_access_rules_added.png" />

## Important Notes

* **Cost Management**: This instance will keep running until you either:
  1. Reach a low balance of credits (less than 2 hours of service worth).
  2. Manually click on the **Delete deployment** action.
* **Warning**: Your credits can deplete quickly if you forget to kill the instance when it is no longer needed.

  <img src="https://mintcdn.com/ubikagents/RrxUUZPA04IzElpM/images/en/self-hosted-gpu-parser/13_deleting_parser.png?fit=max&auto=format&n=RrxUUZPA04IzElpM&q=85&s=a8dbe8c25c2dd59eaa121d58dbfaec07" alt="Delete Deployment" width="3024" height="1714" data-path="images/en/self-hosted-gpu-parser/13_deleting_parser.png" />
