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

# GitLab - Demo

## Follow these steps to import model file from GitLab

### Step 1: Add Model in your workspace.

* Navigate to your desired workspace in Inferless and Click on `"Add a custom model" `button that you see on the top right. An import wizard will open up.

<Frame caption="Click on Add Model">
  <img src="https://mintcdn.com/inferless-68/gmxryf1AUBjwgBTM/images/step1-common-add-model.png?fit=max&auto=format&n=gmxryf1AUBjwgBTM&q=85&s=335816a9e142a39c2f38ec3f82f7e1d5" alt="" width="3416" height="1868" data-path="images/step1-common-add-model.png" />
</Frame>

### Step 2: Choose the source of your model.

* Since we are using a model from Gitlab, select `Gitlab`as the method of upload from the `Provider` list.

* To proceed with the upload, you will need to connect your `Gitlab account`. This is a mandatory step as this helps us download the file from your Gitlab if the repo you are pulling is from an open account.

<Frame caption="After you have selected Repo ">
  <img src="https://mintcdn.com/inferless-68/QJ9zE2jx7w8an0q6/images/gl-1-provider.png?fit=max&auto=format&n=QJ9zE2jx7w8an0q6&q=85&s=6449167a5f88b5dfcc111f59a737a424" alt="" width="2738" height="1450" data-path="images/gl-1-provider.png" />
</Frame>

### Step 3: Enter the model details

* **Model Name:** The desired name of the model that you wish to give.

* **Choose Gitlab Repo:** Select the desired repo from the drop-down

* **Input Schema:** If you don't have the file input\_schema.py you will have the provide the Input/Output Json

<Frame caption="Enter the details as noted">
  <img src="https://mintcdn.com/inferless-68/QJ9zE2jx7w8an0q6/images/gl-2-model-details.png?fit=max&auto=format&n=QJ9zE2jx7w8an0q6&q=85&s=be2ebaf057d91c85a91203e962313a6a" alt="" width="2734" height="1448" data-path="images/gl-2-model-details.png" />
</Frame>

* In case you would like to set up `Automatic rebuild` for your model, enable it
  * You would need to set up a webhook for this method. Click [here](/model-import/automatic-build-via-webhooks) for more details.

### Step 4: Configure Machine and Environment.

* Choose the type of machine, and specify the minimum and maximum number of replicas for deploying your model.
  * **Min scale** -
  ```
  The number of inference workers to keep on at all times.  
  ```
  * **Max scale -**
  ```
  The maximum number of inference workers to allow at any point of time  
  ```
  * Configure Custom Runtime ( If you have pip or apt packages), choose Volume, Secrets and set Environment variables like Inference Timeout / Container Concurrency / Scale Down Timeout

<Frame caption="Set runtime and configuration">
  <img src="https://mintcdn.com/inferless-68/vUTTbQ74sBpn0RYd/images/common-machine-env.png?fit=max&auto=format&n=vUTTbQ74sBpn0RYd&q=85&s=3eaef88476d1f11ee23700d3a88895c5" alt="" width="2728" height="1436" data-path="images/common-machine-env.png" />
</Frame>

### Step 5: Review your model details

* Once you click "Continue," you will be able to review the details added for the model.

* If you would like to make any changes, you can go back and make the changes.

* Once you have reviewed everything, click `Deploy` to start the model import process.

<Frame caption="Review all the details carefully before proceeding">
  <img src="https://mintcdn.com/inferless-68/vUTTbQ74sBpn0RYd/images/common-deploy.png?fit=max&auto=format&n=vUTTbQ74sBpn0RYd&q=85&s=9d046c6e502d80dd98ffb3b129facf8b" alt="" width="2742" height="1450" data-path="images/common-deploy.png" />
</Frame>

### Step 6 : Run your model

* Once you click submit, the model import process would start.

* It may take some time to complete the import process, and during this time, you will be redirected to your workspace and can see the status of the import under `"In Progress/Failed"` tab.\\
  <Frame caption="View the model under `In-Progress/ Failed`">
    <img src="https://mintcdn.com/inferless-68/vUTTbQ74sBpn0RYd/images/common-in-progress.png?fit=max&auto=format&n=vUTTbQ74sBpn0RYd&q=85&s=528f121c863b5a68dbb485ea97b1405a" alt="" width="2724" height="1436" data-path="images/common-in-progress.png" />
  </Frame>

* If you encounter any errors during the model import process or if you want to view the build logs for any reason, you can click on the three dots menu and select "View build logs". This will show you a detailed log of the import process, which can help you troubleshoot any issues you may encounter.

* Post-upload, the model will be available under "My Models"

* You can then select the model and go to `-> API -> Inference Endpoint details. `Here you would find the API endpoints that can be called. You can click on the copy button on the right and can call your model.

<Frame caption="Under the API Tab, you can view the API endpoint details.">
  <img src="https://mintcdn.com/inferless-68/vUTTbQ74sBpn0RYd/images/common-api-call.png?fit=max&auto=format&n=vUTTbQ74sBpn0RYd&q=85&s=4cf7b8f43919c8c509b8c61d1eb3f5bc" alt="" width="2732" height="1454" data-path="images/common-api-call.png" />
</Frame>

### Extra Step: Getting API key details

* You can now call using this from your end. The inference result would be the output for these calls.
* In case you need help with API Keys:
  * Click on settings, available on the top, next to your Workspace Name
  * Click on "Workspace API keys"
  * You can view the details of your key or generate a new one\\
    <Frame caption="Sample for now">
      <img src="https://mintcdn.com/inferless-68/vUTTbQ74sBpn0RYd/images/common-workspace-api.png?fit=max&auto=format&n=vUTTbQ74sBpn0RYd&q=85&s=2f473cf4a12b3697fd10c468a0f1957c" alt="" width="2732" height="1446" data-path="images/common-workspace-api.png" />
    </Frame>

### Using CLI

If your model is stored in Gitlab repo. Make sure you follow [this](https://docs.inferless.com/model-import/file-structure-req/importing-from-github) folder structure.

1. Login to [Inferless.com](https://inferless.com/) and click on three dot menu near the profile picture

2. Click on [Manage integrations](https://console.inferless.com/user/integration) and connect with your Gitlab account were the model is stored.

3. Once you’re done with integration. Run this command to initialise the model

   ```bash theme={null}
   inferless init --name <modelname> --provider gitlab --url <repourl> --branch <branchname> --autobuild
   ```

4. Now that your model is initialised.

   * To do default deployment use this

   ```bash theme={null}
   inferless deploy --gpu t4 
   ```

   * To do customised deployment use this

   ```bash theme={null}
   inferless deploy --gpu t4 --region <regionname> --fractional --runtime <runtimename> --volume <volumename>     
   ```
