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. Start a JupyterLab workbench that is pre-configured to use the Red Hat Python index to run example notebooks.

    Note

    The default workbenches provided with the Red Hat OpenShift AI installation are pre-configured to use the Red Hat Python index, except for the Jupyter | TensorFlow | ROCm | Python 3.12 image. Instead, you must create a custom workbench image based on the following base image:

    Red Hat Ecosystem catalog base image for rhai/base-image-rocm-6.4-rhel9

  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 a list of packages in an index for a specific OpenShift AI release and runtime, go to the Red Hat AI Components Indexes page.

For details about Red Hat support for the Python package index, see Support philosophy: A secure platform.

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://packages.redhat.com/api/pypi/public-rhai/rhoai/3.4/cuda12.9-ubi9/simple/
 wget \
     --verbose \                 # Show detailed progress
     --mirror \                  # Mirror the directory structure
     --continue \                # Resume partial downloads
     --no-host-directories \     # Don't create host-named directories
     --cut-dirs=4 \              # Remove first 4 path segments
     $URL

2.3. Install packages and JupyterLab

To ensure reliable and secure access to supported libraries, start your model customization workflow with a JupyterLab workbench that is pre-configured with theRed Hat Python index.

When you use one of the images, 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
  • Install the synthetic data generation library:

    pip install sdg-hub
  • Install the model training library:

    pip install training-hub

    Install the model training library with CUDA support:

    pip install training-hub[cuda]

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

  • Install the inference time scaling library:

    pip install its-hub

2.4. Import example notebooks

To get started with customizing your models, you can run provided example notebooks and scripts. The following table 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.1. Model customization example notebooks
Model customization componentGit clone example repositoryBranchDirectory

Data processing using Docling

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

stable

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

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

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 Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top