Breadcrumb

  1. Red Hat Interactive Learning Portal
  2. OpenShift AI learning
  3. Get started with vLLM
  4. Prerequisites for the vLLM developer environment

Get started with vLLM

Learn how to compress, serve, and benchmark LLMs with vLLM.

Set up your environment

Before we dive into optimizing and serving models, we need to set up our development environment. In this section, we will walk you through launching a JupyterLab workbench inside Red Hat OpenShift AI on the Developer Sandbox, cloning the required learning path repository, and retrieving your API key from the OpenShift cluster. Once these quick prerequisite steps are complete, you’ll have all the models, code modules, and access keys needed to kick off your first hands-on lesson.

  1. Open Red Hat OpenShift AI from the Developer Sandbox (Figure 1).

    The Developer Sandbox homepage with the OpenShift AI “Try it” button indicated.
    Figure 1: The Developer Sandbox homepage, where you’ll navigate to the OpenShift AI option.
  2. Head to the OpenShift AI dashboard and select your user’s project (Figure 2).

    Here, the project is circled in red on the OpenShift AI dashboard.
    Figure 2: Here, the project is circled in red on the OpenShift AI dashboard.
  3. Click on the Create a workbench button (Figure 3). This is where we’ll execute all the Python code for the learning path to help you download models, run vLLM, and more.

    Within the project, the button to Create a workbench is indicated here by a red circle.
    Figure 3: Within the project, the button to Create a workbench is indicated here by a red circle.
  4. On the Create workbench screen (Figure 4):

    1. Name your workbench vLLM Learning Path (or similar).
    2. Under Workbench image, select a JupyterLab instance with CUDA dependencies from the drop-down menu.
    3. Under Deployment size, select Large from the drop-down menu.
    The fields to create a workbench, including the workbench name, image, and deployment size.
    Figure 4: The fields to create a workbench, including the workbench name, image, and deployment size.
  5. Finally, once our development environment is ready after a minute or two, click the link (arrow symbol) to open it (Figure 5).

    A red circle indicates the link to the development environment on the Workbenches tab.
    Figure 5: Select the link to your development environment, indicated here by the red circle.

Clone the repository

  1. With your Developer environment open, on the left-hand sidebar, select Clone a Repository (Figure 6).

    The Clone a Repository button is the third option on the left-hand sidebar.
    Figure 6: The Clone a Repository button is the third option on the left-hand sidebar.
  2. Clone this repo inside the workbench: 

    git clone https://github.com/redhat-developer-demos/get-started-with-vllm
  3. The repository may take a bit of time to clone, since you’re also downloading the model’s weights. Once the cloning process completes, you’ll have each of the modules for the learning path ready to view (Figure 7).

    The first module in the repo, which is now viewable and will be the content of this learning path’s first lesson.
    Figure 7: The module “Optimizing a Model with LLM Compressor” is the first one we will use in the first lesson.

Note

For Lessons 2 and 3, you’ll need to query a vLLM instance. We have already deployed a few models in the shared OpenShift AI cluster for you to use.

 

Set up your API key

Our last few prerequisite steps will guide you through setting up your API key from the OpenShift web console.

  1. Return to the Developer Sandbox. This time, head to OpenShift itself, where cloud-native applications and resources run (Figure 8).

    The Developer Sandbox homepage, with the OpenShift “Try it” option indicated.
    Figure 8: The Developer Sandbox homepage, where you will navigate to the OpenShift option.
  2. Click the Terminal icon at the top right (Figure 9).

    The Terminal icon is indicated here by a red circle, on the top-right of the OpenShift web console screen.
    Figure 9: The Terminal icon is indicated here by a red circle, on the top-right of the OpenShift web console screen.
  3. Create a terminal session in the {username}-dev project (Figure 10).

    Screen showing the option to initialize a terminal session in the project.
    Figure 10: Initialize the terminal session within the project. The project name should appear in the drop-down menu.
  4. Run oc whoami -t (Figure 11). This output key will be used for the lessons in this learning path, specifically when using vLLM and benchmarking later on.

    In the terminal, the LLM API output key is indicated by a red circle.
    Figure 11: In the terminal, the LLM API output key is indicated by a red circle.

You’re now ready to start the first lesson!

Previous resource
Overview: Get started with vLLM
Next resource
Optimize a model with LLM Compressor