Note:

Run Elyza LLM Model on OCI Compute A10.2 Instance with Oracle Resource Manager using One Click Deployment

Introduction

Oracle Cloud Infrastructure (OCI) Compute lets you create different types of shapes to test graphics Processing Unit (GPU) for Artificial Intelligence (AI) models deployed locally. In this tutorial, we will use A10.2 shape with a pre-existing VCN and subnet resources that you can select from the Oracle Resource Manager.

The Terraform code also includes configuring the instance to run a local Virtual Large Language Model (vLLM) Elyza model(s) for natural language processing tasks.

Objectives

Prerequisites

Task 1: Download the Terraform Code for One Click Deployment

Download ORM Terraform code from here: orm_stack_a10_2_gpu_elyza_models.zip, to implement Elyza vLLM model(s) locally which will allow you to select an existing VCN and a subnet to test local deployment of Elyza vLLM model(s) in an A10.2 instance shape.

Once you have the ORM Terraform code downloaded locally, follow the steps from here: Creating a Stack from a Folder to upload the stack and to execute apply of the Terraform code.

Note: Ensure you have created an OCI Virtual Cloud Network (VCN) and a subnet where the VM will be deployed.

Task 2: Create a VCN on OCI (Optional if not created already)

To create a VCN in Oracle Cloud Infrastructure, see: Video for Explore how to create a Virtual Cloud Network on OCI.

or

To create a VCN, follow the steps:

  1. Log in to the OCI Console, enter Cloud Tenant Name, User Name, and Password.

  2. Click the hamburger menu (≡) from the upper left corner.

  3. Go to Networking, Virtual Cloud Networks and select the appropriate compartment from List Scope section.

  4. Select VCN with Internet Connectivity, and click Start VCN Wizard.

  5. In the Create a VCN with Internet Connectivity page, enter the following information and click Next.

    • VCN NAME: Enter OCI_HOL_VCN.
    • COMPARTMENT: Select the appropriate compartment.
    • VCN CIDR BLOCK: Enter 10.0.0.0/16.
    • PUBLIC SUBNET CIDR BLOCK: Enter 10.0.2.0/24.
    • PRIVATE SUBNET CIDR BLOCK: Enter 10.0.1.0/24.
    • DNS Resolution: Select USE DNS HOSTNAMES IN THIS VCN.

    Create a VCN Configuration

    Description of the illustration setupVCN3.png

  6. In the Review page, review your settings and click Create.

    Review CV Configuration

    Description of the illustration setupVCN4.png

    It will take a moment to create the VCN and a progress screen will keep you apprised of the workflow.

    Workflow

    Description of the illustration workflow.png

  7. Once the VCN is created, click View Virtual Cloud Network.

    In real-world situations, you will create multiple VCNs based on their need for access (which ports to open) and who can access them.

Task 3: See cloud-init Configuration Details

The cloud-init script installs all the necessary dependencies, starts Docker, downloads and starts the vLLM Elyza model(s). You can find the following code in the cloudinit.sh file downloaded in Task 1.

dnf install -y dnf-utils zip unzip
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf remove -y runc
dnf install -y docker-ce --nobest
systemctl enable docker.service
dnf install -y nvidia-container-toolkit
systemctl start docker.service
...

Cloud-init will download all the files needed to run Elyza model and does not need your API token predefined in Hugging Face. API token will be needed for the launch of Elyza model using Docker in Task 6.

Task 4: Monitor the System

Track cloud-init completion and GPU resource usage with the following commands (if needed).

Task 5: Test the Model Integration

Interact with the model in the following ways using the commands or Jupyter Notebook details.

Task 6: Deploy the Model using Docker (if needed)

Alternatively, deploy the model using Docker for encapsulated environments:

You can query the model in the following ways:

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.