> ## 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.

# GitHub - Demo

### Types of Repo

User Repo: If the repository belongs to the user you can directly Install the Inferless app in your GitHub account and give access to the selected repo from the installation process Org Repo :

For org repository access you have to make sure that the org Owner installs the Inferless and gives Inferlesss access to the repos you want to import, after using your own GitHub you will be able to set it up.

### 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 Github, select `Github`as the method of upload from the `Provider` list.

* To proceed with the upload, you will need to connect your `Github account`. This is a mandatory step as this helps us download the file from your Github 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/gh2-provider.png?fit=max&auto=format&n=QJ9zE2jx7w8an0q6&q=85&s=7ccc3b1531cc57279b0d67514bf5c940" alt="" width="2734" height="1446" data-path="images/gh2-provider.png" />
</Frame>

### Step 3: Enter the model details

* Select your `Github Repository` and the `branch`.
* Model Name: The desired name of the model that you wish to give
* GitHub Repo: Make sure you have the app.py and input\_schema.py defined

  <Frame caption="Enter the details as noted">
    <img src="https://mintcdn.com/inferless-68/QJ9zE2jx7w8an0q6/images/gh3-model-details.png?fit=max&auto=format&n=QJ9zE2jx7w8an0q6&q=85&s=7b91368a652b4bf7dbf627dec18417d8" alt="" width="2734" height="1436" data-path="images/gh3-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 Github 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 Github 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 github --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>     
   ```
