Chapter 2. Set up your working environment


To set up your working environment for customizing models, complete these tasks:

  1. For disconnected environments, mirror the Python index.
  2. Create a custom workbench image that is based on a base image that is configured to use the Red Hat Python index and install packages. Install JupyterLab in your custom workbench image so that you can run example notebooks.
  3. From your running workbench, import example notebooks.

2.1. About the Red Hat Python index

Red Hat AI includes a maintained Python package index that provides secure and reliable access to supported libraries, with full support for disconnected environments. For details about Red Hat support for the Python package index, see Support philosophy: A secure platform.

Table 2.1 lists the images that are configured to use the Red Hat Python index.

Notes:

  • NVIDIA CUDA, AMD GPU, and AMD ROCm RPM repositories are configured, but disabled.
  • The images listed in Table 2.1 have RHEL RPM repositories enabled. A RHEL RPM is a package file used for the Red Hat Package Manager system on Red Hat Enterprise Linux (RHEL). An RPM file contains all the necessary components for an application, such as executable files, configuration files, and documentation. It simplifies the process of distributing, installing, and managing software by bundling everything into a single, standalone file.

    You can install additional RPMs, but you must have a Red Hat Extended Update Support (EUS) subscription and you must run your container image in root mode (for example, podman run --user 0).

    For more information about Red Hat Package Manager, see Introduction to RPM.

If you are using a disconnected environment, use the following code example to access the Red Hat Python index content and copy it locally. You can then upload the packages into your own internal hosting service:

#!/bin/bash -x

URL=https://console.redhat.com/api/pypi/public-rhai/rhoai/3.2/cuda12.9-ubi9/simple/

wget \
--verbose \
--mirror \
--continue \
--no-host-directories \
--cut-dirs=4 \
$URL
Copy to Clipboard Toggle word wrap

2.3. Install packages and JupyterLab

To ensure reliable and secure access to supported libraries, start your model customization workflow by creating a workbench image that is based on a Red Hat base image that is configured to use the Red Hat Python index. These base images are listed in Table 2.1.

Note: When you create a custom workbench image that is based on one of the images listed in Table 2.1, install JupyterLab. You can use JupyterLab to run the example model customization notebooks.

For guidance on custom workbenches, see Creating a custom workbench image from your own image.

When you use one of the images listed in Table 2.1 as a base image, both pip and uv commands are pre-configured to use the Red Hat Python index and system trust store for HTTPS.

When you run a pip install command, it installs the package version referenced in the Red Hat Python index, ensuring that you are installing a version of the library that is secure and reliably accessible.

For example, use the following commands to install the model customization libraries:

  • Install the data processing library:

    pip install docling
    Copy to Clipboard Toggle word wrap
  • Install the synthetic data generation library:

    pip install sdg-hub
    Copy to Clipboard Toggle word wrap
  • Install the model training library:

    pip install training-hub
    Copy to Clipboard Toggle word wrap

    Install the model training library with CUDA support:

    pip install training-hub[cuda]
    Copy to Clipboard Toggle word wrap

    Note: For additional options and details for installing the model training library, see Training Hub installation guidelines.

2.4. Import example notebooks

To get started with customizing your models, you can run provided example notebooks and scripts. Table 2.2 lists the Git repositories that provide example notebooks for each model customization component.

For a comprehensive tutorial that demonstrates an AI/ML workflow, see the Knowledge Tuning example on the Red Hat AI examples site.

The Knowledge Tuning tutorial is a curated collection of Jupyter notebooks that includes examples of using Docling to process data, training-hub to fine-tune a model on that data, and KServe to deploy the final model for a Question and Answer application.

Expand
Table 2.2. Model customization example notebooks
Model customization componentGit clone example repositoryBranchDirectory

Data processing using docling

https://github.com/opendatahub-io/data-processing.git

stable-3.0

notebooks/

Synthetic data generation

https://github.com/Red-Hat-AI-Innovation-Team/sdg_hub.git

main

examples

Training

https://github.com/Red-Hat-AI-Innovation-Team/training_hub.git

main

examples

End-to-end example for model customization with these components

https://github.com/red-hat-data-services/red-hat-ai-examples.git

main

knowledge-tuning

2.4.1. Clone an example Git repository

Follow these steps to clone a Git repository from the JupyterLab environment provided with your OpenShift AI workbench.

Prerequisites

  • You have the https URL and branch for one of the example Git repositories listed in Table 2.2.

Procedure

  1. From the OpenShift AI dashboard, go to the project where you created a workbench.
  2. Click the link for your workbench. If prompted, log in and allow JupyterLab to authorize your user.

    Your JupyterLab environment window opens.

    The file-browser window shows the files and directories that are saved inside your own personal space in OpenShift AI .

  3. Bring the content of an example Git repo inside your JupyterLab environment:

    1. On the toolbar, click the Git Clone icon.
    2. Enter a Git https URL.
    3. Select the Include submodules option, and then click Clone.
  4. If you want to use a branch other than main (for example, the data processing example repo uses the stable-3.0 branch), change the branch:

    1. In the left navigation bar, click the Git icon, and then click Current Branch to expand the branches and tags selector panel.
    2. On the Branches tab, in the Filter field, enter the branch name.
    3. Select the branch.

      The current branch changes to the branch that you selected.

Verification

  • In the file browser, double-click the newly-created directory to see the example files.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top