Chapter 6. Using a containerized command-line assistant for disconnected environments
The command-line assistant for disconnected environments is available as a Developer Preview. You can use it in air-gapped networks, remote locations, and other environments with limited internet connectivity.
The command-line assistant for disconnected environments is packaged in a UBI-based container, with key components such as the redhat-knowledge-bridge image built on Red Hat Hardened Images and includes simplified configuration, orchestration, and basic lifecycle management.
Changing the RHEL Offline Container model to unsupported models can enable the execution of arbitrary code or compromise the integrity of your Red Hat Enterprise Linux (RHEL) systems.
The command-line assistant tool is Developer Preview software only. Red Hat does not support Developer Preview software in any way and is not functionally complete or production-ready. Do not use Developer Preview software for production or business-critical workloads. Developer Preview software provides early access to upcoming product software in advance of its possible inclusion in a Red Hat product offering. Customers can use this software to test functionality and provide feedback during the development process. This software might not have any documentation, is subject to change or removal at any time, and has received limited testing. Red Hat might provide ways to submit feedback on Developer Preview software without an associated SLA.
For more information about the support scope of Red Hat Developer Preview software, see Developer Preview Support Scope.
With the command-line assistant for disconnected environments, you can create a container image targeted for a single system. This container image includes the following components:
-
An
installercontainer to pull the other required containers, install therhel-clacommand, and optionally configures a systemd service. -
The
RHEL Knowledge Bridgecontainer to bridge offline knowledge components. -
A
postgresdatabase container to store local application data. -
A
ramalamacontainer to run the Large Language Model (LLM) inference service. -
The
lightspeed stackcontainer, which includes the command-line assistant tool. The
Red Hat Offline Knowledge Portalcontainer to serve local documentation.The container image includes the
Phi-4-mini-instruct-Q4_K_Mmodel, and serves as the default model for theramalamacontainer.
The container image is intended for local, disconnected use on a single system. It is not designed for multi-system deployments or large-scale environments.
6.1. Installing the command-line assistant in disconnected environments Copy linkLink copied to clipboard!
Install the command-line assistant in a disconnected environment by using container images available from the Red Hat Container Registry and Quay.io. Manually transfer the installer image and its dependency images to the local storage of the offline system in the disconnected environment.
Prerequisites
- Your RHEL system is registered to a Red Hat Satellite subscription. For additional details, see the Does the offline RHEL command-line-assistant require the system to be registered? article.
- You have requested and obtained an API key for the RHOKP container. To request your API key, access the Red Hat Offline Knowledge Portal or contact your Red Hat account representative.
- You have Podman installed.
-
You have the
container-toolsmeta-package installed. -
You have created the
$HOME/.configand$HOME/.local/binfolders. Software requirements:
- Operating system: A supported operating system version, such as RHEL 9.6 or later, RHEL 10 or later, Fedora 43 or later, Windows 11 with WSL2 and Podman, or macOS 15 or later.
Hardware requirements:
- Storage: At least 35 to 40 GB of available disk space across all system types, to accommodate the container images and local LLM models.
Memory and Processing:
- For CPU-only systems: At least 8 GB of RAM and 2 CPU cores.
- For GPU-capable systems: At least 4 GB of RAM and a GPU with at least 4 GB of VRAM.
- For Mac computers: A machine equipped with an M2 chip or later.
Procedure
On the connected RHEL system, complete the following steps:
Log in to the Red Hat registry:
$ podman login registry.redhat.ioDownload the
installerand all dependency images:$ podman pull registry.redhat.io/rhel-cla/installer-rhel10:latest $ podman pull registry.access.redhat.com/hi/postgresql:18 $ podman pull registry.redhat.io/lightspeed-core/lightspeed-stack-rhel9:v0.6-latest $ podman pull quay.io/ramalama/ramalama:latest $ podman pull registry.redhat.io/rhel-cla/rhel-knowledge-bridge-rhel10 $ podman pull registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latestSave all the images as a single
tarfile:$ podman save -o rhel-cla-installer-images.tar \ registry.redhat.io/rhel-cla/installer-rhel10:latest \ registry.access.redhat.com/hi/postgresql:18 \ registry.redhat.io/lightspeed-core/lightspeed-stack-rhel9:v0.6-latest \ quay.io/ramalama/ramalama:latest \ registry.redhat.io/rhel-cla/rhel-knowledge-bridge-rhel10 \ registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latest
-
Transfer the
rhel-cla-installer-images.tarfile to the disconnected system by using a USB drive, network share, or other transfer method. On the disconnected system, load the image:
$ podman load -i rhel-cla-installer-images.tarOn the disconnected system, run the
installercontainer. This command uses the loaded image and installs the offline command-line assistant on your system.$ podman run -u : --rm \ -v $HOME/.config:/config:Z \ -v $HOME/.local/bin:/config/.local/bin:Z \ rhel-cla/installer-rhel10:latestOptional: To automatically start the offline command-line assistant containers each time the system boots, as a
systemdservice, run the following command:$ rhel-cla enable-serviceInstall the
command-line-assistantclient package on your offline RHEL system:# sudo dnf install command-line-assistantUpdate the
endpointconfiguration option.-
Open the
/etc/xdg/command-line-assistant/config.tomlfile in a text editor. Locate the
endpointvariable and change its value to the address of the system hosting your offline command-line assistant containers. For example, to connect to the local system:endpoint = "http://127.0.0.1:8501/v1"Restart the
cladservice to apply the new configuration:$ sudo systemctl restart cladAfter the installation is complete, you can use the
rhel-clacommand to start, stop, uninstall, and check the status of the offline command-line assistant.
-
Open the
Start the containers:
$ rhel-cla start
Verification
Check if the offline command-line assistant is running:
$ rhel-cla statusVerify that the container is running:
$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS ba655e5efdcd installer-rh… /sbin/init 30 seconds ago Up 29 secondsIt might take about a minute for the
rlsapiand theragdbcontainers to initialize completely.If the assistant is not running, start it:
$ rhel-cla startCheck if the client is correctly configured by asking the following question:
$ c "What is an immutable file?" + Asking Red Hat Lightspeed This feature uses AI technology. Do not include any personal information or other sensitive information in your input. Interactions may be used to improve Red Hat's products or services.
6.2. Configuring the GPU that you want to use with the command-line assistant Copy linkLink copied to clipboard!
For better performance, configure the graphics processing unit (GPU) setting by editing the ~/.config/rhel-cla/.env file. This file contains information to enable you to select the correct container image and device settings for your hardware.
Prerequisites
- You have installed the command-line assistant in a disconnected environment. See Installing the command-line assistant in disconnected environments.
-
You have run the
installercontainer to generate the initial configuration files.
Procedure
Open the
~/.config/rhel-cla/.envfile in a text editor. For example:$ vi ~/.config/rhel-cla/.envOptional: Configure NVIDIA-specific variables. If you need to restrict visibility to specific GPU devices or define explicit driver capabilities on Linux, locate and uncomment the following lines by removing the
#symbol, then update their values as needed:# NVIDIA-specific settings (Linux only - uncomment if needed) # CUDA_VISIBLE_DEVICES=0 # NVIDIA_DRIVER_CAPABILITIES="compute,utility"Restart the assistant to apply the changes:
$ rhel-cla stop $ rhel-cla start
Troubleshooting
Resolve GPU errors after restarting an EC2 instance.
When you use the offline command-line assistant on a GPU-enabled AWS EC2 instance, the
rhel-cla startcommand might fail after the instance is stopped and restarted. This error occurs because the GPU ID changes after a restart. To work around this problem, regenerate the NVIDIA Container Device Interface (CDI) configuration file by running the following command:$ nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yamlThis updates the reference of the system to the GPU, enabling the
rhel-claservice to start correctly.
6.3. Changing the LLM to a custom model Copy linkLink copied to clipboard!
To use a locally installed custom model, copy the model file into the ramalama LLM container and update your configuration.
Prerequisites
-
The
rhel-claservice has been started at least once by (rhel-cla start).
Procedure
Identify the running container ID:
$ podman ps | grep ramalama 6eef0fb344b7 quay.io/ramalama/ramalama:0.16.0 ramalama --store ... 7 seconds ago Up 7 seconds 0.0.0.0:8000->8000/tcp, 0.0.0.0:8888->8888/tcp rhel-cla-llamacpp-modelCopy the LLM model file into the
ramalamacontainer by replacing <path_to_local_model> with your local path and <container_id> with the container ID found in the previous step:$ podman cp path_to_local_llm_file.gguf 6eef0fb344b7:/models/Alternatively, you can copy the LLM model file directly to the local volume path:
$ cp path_to_local_llm_file.gguf ~/.local/share/containers/storage/volumes/llamacpp-models/_data/Stop the
rhel-claservice:$ rhel-cla stopEdit the
~/.config/rhel-cla/.envand add the following configuration to theLLMvariable:LLM="file:///models/llm_file.gguf"Restart the
rhel-claservice:$ rhel-cla start