RHEL AI Command Line Assistant Setup Guide
This guide walks you through setting up the Red Hat Enterprise Linux AI (RHEL AI) command line assistant, which lets you interact with an AI model directly from your terminal. You’ll configure the necessary tools, authenticate, and run your first prompt. Before starting, ensure you have a Red Hat account and a valid RHEL AI subscription or entitlement.
What You’ll Need
- A Red Hat account with an active RHEL AI subscription or entitlement.
- A RHEL 9 system (or later) with root or sudo access.
- An internet connection to download packages and authenticate.
- Basic familiarity with the Linux command line.
Step-by-Step
- Verify your RHEL version and subscription. Run
cat /etc/redhat-releaseto confirm you’re on RHEL 9 or later. Then runsubscription-manager statusto ensure your system is registered and subscribed to the RHEL AI repository. If not, register withsubscription-manager register --username YOUR_USERNAMEand attach a subscription. - Enable the RHEL AI repository. Use
subscription-manager repos --enable rhel-9-for-x86_64-appstream-rpms(adjust for your architecture). This repository contains the AI packages. - Install the command line assistant package. Run
dnf install rhel-ai-cli. If the package name differs, search withdnf search rhel-aito find the exact name. - Set up authentication. The assistant needs a Red Hat API key. Go to the Red Hat Hybrid Cloud Console, navigate to your account settings, and generate an API token. Then run
rhel-ai-cli configureand paste the token when prompted. This stores the token securely in your user config. - Verify the installation. Run
rhel-ai-cli --versionto confirm the tool is installed and working. You should see the version number. - Run your first prompt. Type
rhel-ai-cli "What is the capital of France?"and press Enter. The assistant will send the prompt to the AI service and display the response. If you get an authentication error, re-check your API token. - Explore common options. Use
rhel-ai-cli --helpto see available flags, such as--modelto choose a specific model,--outputto save responses to a file, and--interactivefor a chat session. - Set up interactive mode (optional). For a more conversational experience, run
rhel-ai-cli --interactive. This starts a session where you can have multi-turn conversations.
Common Mistakes
- Using the wrong repository. Ensure you enable the correct repository for your RHEL version and architecture. Using an older or incompatible repo can cause installation failures.
- Forgetting to authenticate. The assistant won’t work without a valid API token. Double-check that you’ve run
rhel-ai-cli configureand pasted the token correctly. - Assuming the package name. The package might be named differently than expected. Always search with
dnf searchifdnf install rhel-ai-clifails. - Overlooking system requirements. The assistant may require certain libraries or Python versions. If you see dependency errors, update your system with
dnf updatebefore installing.
Tips
- Use
--modelto switch between different AI models if multiple are available. Check the documentation for the list of supported models. - Save frequently used prompts as shell aliases to speed up your workflow.
- For long outputs, pipe the result to
lessor redirect to a file with> output.txt. - Keep your API token secure; treat it like a password. Rotate it periodically from the console.
- If you’re behind a proxy, set the
HTTP_PROXYandHTTPS_PROXYenvironment variables before running the assistant.
Troubleshooting
Installation fails with “No package found.” This usually means the repository isn’t enabled or the package name is wrong. Re-run the repo enable command and search again. Also verify your subscription includes RHEL AI.
Authentication error when running a prompt. Your API token may be expired or invalid. Re-generate a new token in the console and re-run rhel-ai-cli configure. Also check that your system clock is correct, as time skew can cause token validation failures.
Command not found after installation. The binary might not be in your PATH. Try logging out and back in, or run source /etc/profile to refresh your environment. If that fails, locate the binary with which rhel-ai-cli or find it in /usr/bin or /usr/local/bin.
Slow responses or timeouts. Check your internet connection and firewall settings. Ensure that outbound HTTPS traffic to the Red Hat AI service is allowed. If you’re using a VPN, try disconnecting it temporarily to see if that helps.
Error messages about missing dependencies. Run dnf install -y rhel-ai-cli --allowerasing to let dnf resolve dependency conflicts. If that doesn’t work, manually install the missing libraries as indicated in the error message.
Frequently Asked Questions
Do I need a separate subscription for RHEL AI?
Yes, RHEL AI is an add-on to a standard RHEL subscription. You need an entitlement that includes RHEL AI to access the repository and the AI service.
Can I use the assistant without an internet connection?
No, the assistant sends prompts to a cloud-based AI service, so an internet connection is required. There is no offline mode.
What AI models are available?
The available models depend on your subscription and the version of the assistant. Typically, you can choose from several open-source models like Granite and Llama. Check the official documentation for the current list.
Is the command line assistant free?
It’s included with a valid RHEL AI subscription. If you have a developer subscription, it may be included at no extra cost, but standard production subscriptions may incur additional fees.
How do I update the assistant?
Run dnf update rhel-ai-cli to get the latest version. It’s recommended to update regularly to receive bug fixes and new features.
Can I use the assistant in scripts?
Yes, you can use it in shell scripts. Just call the command with the prompt as an argument and capture the output. Use the --output flag to save responses to a file for easier parsing.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.