RHEL - 在离线的 RHEL 10 中部署 Lightspeed 命令行助手

《OpenShift / RHEL / DevSecOps 汇总目录》

文章目录

  • [Lightspeed 命令行助手离线运行架构](#Lightspeed 命令行助手离线运行架构)
  • [安装 Lightspeed 命令行助手](#安装 Lightspeed 命令行助手)
  • [使用 Lightspeed 命令行助手](#使用 Lightspeed 命令行助手)
  • 参考

Lightspeed 命令行助手离线运行架构

安装 Lightspeed 命令行助手

以下环境为 RHEL 10 或 RHEL 9.6,命令默认使用 root 用户运行。

  1. 在系统中创建必要的目录。
bash 复制代码
$ mkdir ~/.config
$ mkdir -p ~/.local/bin
  1. 基于容器安装 Lightspeed 命令行助手离线环境。注意:可将 registry.redhat.io 改为离线镜像库的地址。
bash 复制代码
$ podman login registry.redhat.io
$ podman run -u : --rm -v $HOME/.config:/config:Z -v $HOME/.local/bin:/config/.local/bin:Z registry.redhat.io/rhel-cla/installer-rhel10:latest install-systemd

⚠️  Red Hat Enterprise Linux (RHEL) command line assistant is a tool that uses AI technology. Do not include any personal information or other sensitive information in your input. Results should not be relied on without human review. More information available: https://red.ht/3JqbWuu.

ℹ️  🚀 Installing rhel-cla command...
✅ 🎉 RHEL CLA installed!

ℹ️  📁 Files installed:
   • Command: ~/.local/bin/rhel-cla
   • Config: ~/.config/rhel-cla/.env
   • Runner: ~/.config/rhel-cla/rhel-cla-runner.sh

⚠️  ⚠️  NVIDIA GPU users (Linux): Edit ~/.config/rhel-cla/.env and uncomment:
   LLAMACPP_IMAGE="quay.io/ramalama/cuda:latest"

⚠️  ⚠️  If running MacOS or Windows, make the command executable:
    chmod +x ~/.local/bin/rhel-cla

⚠️  ⚠️  Make sure ~/.local/bin is in your PATH
   # For bash:
 echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
   # For zsh:
 echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
   # For fish:
 fish_add_path ~/.local/bin

ℹ️  🚀 Quick start:
    rhel-cla start
    rhel-cla status
    rhel-cla stop

ℹ️  🗑️  Uninstall RHEL CLA:
    rhel-cla uninstall
  1. 修改配置文件。可将 LLM,RLSAPI_IMAGE,PGV_DB_IMAGE,LLAMACPP_IMAGE 使用的资源改为离线地址。另外如果有 NVIDIA GPU,可使用 LLAMACPP_IMAGE="quay.io/ramalama/cuda:latest" 一行的配置,并且使用 HOST_DEVICE="/dev/nvidia0"配置。
bash 复制代码
$ vi /root/.config/rhel-cla/.env
  1. 启动 RHEL 命令行助手的离线环境。
bash 复制代码
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
$ rhel-cla start
ℹ️  Starting RHEL CLA...
Loading configuration from: /root/.config/rhel-cla/.env
Using configured device: /dev/dri
Cleaning up any existing rhel-cla pod...
157ed9ec610c06ad2dc1e92c62244466c108c0011d6182d4a5df0b55fe182408
Creating model volume...
Checking for model from registry.redhat.io/rhel-cla/installer-rhel10:latest: Phi-4-mini-instruct-Q4_K_M.gguf
✅ Model Phi-4-mini-instruct-Q4_K_M.gguf already present in volume
Creating rhel-cla pod...
564ba035768f6d9ab0030d54f97ac195b152fdaeeeb4acadedeb23d35055d36b
Starting pgvector database...
Trying to pull registry.redhat.io/rhel-cla/rag-database-rhel10:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob e08da0a07a49 done   |
Copying blob a9031b52db2b done   |
Copying config bfc8ae290c done   |
Writing manifest to image destination
Storing signatures
ae823ab0e3e2c2376be37392111efe43a22e68748077f1ab494964511faf10ce
Starting model server (this may take time to download the model)...
Using extracted model: file:///models/Phi-4-mini-instruct-Q4_K_M.gguf
Trying to pull quay.io/ramalama/ramalama:latest...
Getting image source signatures
Copying blob 6b0210dfe625 done   |
Copying blob bacb9627c0f0 done   |
Copying config 845fddd033 done   |
Writing manifest to image destination
e9c3f8472260d86a1a875b7a7372e4f8bf34a9724a75a3b7a713d156a1112d3c
Waiting for model server to be ready...
Attempt 1/60 - Waiting for model server...
Attempt 2/60 - Waiting for model server...
Attempt 3/60 - Waiting for model server...
Attempt 4/60 - Waiting for model server...
Attempt 5/60 - Waiting for model server...
Attempt 6/60 - Waiting for model server...
Attempt 7/60 - Waiting for model server...
Attempt 8/60 - Waiting for model server...
Attempt 9/60 - Waiting for model server...
Attempt 10/60 - Waiting for model server...
Attempt 11/60 - Waiting for model server...
Attempt 12/60 - Waiting for model server...
Attempt 13/60 - Waiting for model server...
Attempt 14/60 - Waiting for model server...
Attempt 15/60 - Waiting for model server...
Attempt 16/60 - Waiting for model server...
Attempt 17/60 - Waiting for model server...
Attempt 18/60 - Waiting for model server...
Attempt 19/60 - Waiting for model server...
Attempt 20/60 - Waiting for model server...
Model server is ready!
Detected model name: /models/Phi-4-mini-instruct-Q4_K_M.gguf
Starting API server...
Trying to pull registry.redhat.io/rhel-cla/rlsapi-rhel10:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob c34187e1de1c done   |
Copying blob 3a82aec6fcfc done   |
Copying config d3d0d1c0a1 done   |
Writing manifest to image destination
Storing signatures
994fcf0454d5cced426c6914db3c651c89afef3a6668ceca44fa609cfaed1d74

✅ RHEL CLA pod is running!

Services available at:
  • API:          http://localhost:8000
  • Model Server: http://localhost:8888
  • Database:     http://localhost:5432

Useful commands:
  podman logs rhel-cla-llamacpp-model      # View model server logs
  podman logs rhel-cla-rlsapi              # View API server logs
  podman logs rhel-cla-pgvector            # View pgvector database logs
  podman pod stop rhel-cla                 # Stop all containers
  podman pod rm rhel-cla                   # Remove pod and containers

ℹ️  Install the RHEL command-line-assistant client package on your RHEL system and configure the endpoint as described here: https://red.ht/3JqbWuu
  1. 查看运行的容器,其中包括模型 rhel-cla-llamacpp-model、数据库 rhel-cla-pgvector、API 服务 rhel-cla-rlsapi。
bash 复制代码
$ podman ps
CONTAINER ID  IMAGE                                                   COMMAND               CREATED         STATUS         PORTS                                           NAMES
6d12206bc5c2  localhost/podman-pause:5.4.0-1744156800                                       11 minutes ago  Up 10 minutes  0.0.0.0:8000->8000/tcp, 0.0.0.0:8888->8888/tcp  564ba035768f-infra
ae823ab0e3e2  registry.redhat.io/rhel-cla/rag-database-rhel10:latest                        10 minutes ago  Up 10 minutes  0.0.0.0:8000->8000/tcp, 0.0.0.0:8888->8888/tcp  rhel-cla-pgvector
e9c3f8472260  quay.io/ramalama/ramalama:latest                        ramalama --store ...  9 minutes ago   Up 9 minutes   0.0.0.0:8000->8000/tcp, 0.0.0.0:8888->8888/tcp  rhel-cla-llamacpp-model
994fcf0454d5  registry.redhat.io/rhel-cla/rlsapi-rhel10:latest        ./start_uvicorn.s...  7 minutes ago   Up 7 minutes   0.0.0.0:8000->8000/tcp, 0.0.0.0:8888->8888/tcp  rhel-cla-rlsapi
  1. 安装命令行助手
bash 复制代码
$ dnf install command-line-assistant
  1. 修改 /etc/xdg/command-line-assistant/config.toml 文件。
bash 复制代码
$ vi /etc/xdg/command-line-assistant/config.toml
  1. 将 endpoint 指向本地。
bash 复制代码
endpoint = "http://127.0.0.1:8000/"
  1. 重启 clad 服务。
bash 复制代码
$ systemctl restart clad

使用 Lightspeed 命令行助手

  1. 问一个英文问题。
bash 复制代码
$ c "How do I list all active systemd services?"
⁻₊+ Asking RHEL Lightspeed
────────────────────────────────────────────────────────────────────────

You can list all active systemd services by using the following command in your terminal:

Snippet ────────────────
systemctl list-units --type=service --state=active
────────────────────────

This command will display all services that are currently active and running on your system.


────────────────────────────────────────────────────────────────────────
Always review AI-generated content prior to use.
  1. 问一个中文问题。
bash 复制代码
 c "如何设置主机名?"
⁺₊+ Asking RHEL 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.
────────────────────────────────────────────────────────────────────────

Hello! I'd be happy to help you with setting up your hostname on Red Hat Enterprise Linux. Please follow the instructions below:

1. Open your terminal.

2. Type the following command to edit the hostname file:
Snippet ────────────────
sudo vi /etc/hostname
────────────────────────

3. In the file, replace the existing hostname with your desired hostname. Save and exit the file.

4. Next, type the following command to edit the hosts file:
Snippet ────────────────
sudo vi /etc/hosts
────────────────────────

5. In the file, add a new line with your IP address followed by your desired hostname. For example:
Snippet ────────────────
192.168.1.10 myhostname
────────────────────────

6. Save and exit the file.

7. Finally, reboot your system for the changes to take effect.

I hope this helps! Let me know if you have any further questions.

────────────────────────────────────────────────────────────────────────
Always review AI-generated content prior to use.

参考

https://www.redhat.com/en/blog/use-rhel-command-line-assistant-offline-new-developer-preview

https://github.com/rhel-lightspeed/command-line-assistant

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/interacting_with_the_command-line_assistant_powered_by_rhel_lightspeed/containerized-command-line-assistant-for-disconnected-environments

相关推荐
陈嘿萌几秒前
CVPR 2026|TherA:让可见光照片“懂冷热”,用文字和参考图控制红外生成
图像处理·人工智能·深度学习·计算机视觉·学术研究与理论基础
shxjnpl3 分钟前
MOSS-Transcribe-Diarize 0.9B 私有化部署实战:一个模型完成会议转写、说话人识别与时间戳
人工智能·语音识别·实时音视频
武汉唯众智创3 分钟前
心理健康中心 / 咨询室 / 宣泄室怎么建?从空间规划到 AI 系统的一体化方案
人工智能·ai心理健康·ai心理健康测评·心理健康中心建设·心理健康咨询室解决方案
SL_staff4 分钟前
APS落地失败的5个隐形坑:离散制造排产为何总在Excel里打转?
java·人工智能·开源
Yolanda_20227 分钟前
神经网络基础原理-使用梯度下降训练二次函数模型简单示例
人工智能·深度学习·神经网络
倔强的石头10615 分钟前
持续预训练实战_让基础模型适配垂直领域
人工智能·深度学习
段一凡-华北理工大学19 分钟前
高炉炼铁机器视觉与智能识别十八讲~系列文章15:可靠性篇:防误报、容错与识别系统的鲁棒性设计
人工智能·算法·机器学习·高炉大模型·高炉机器视觉·高炉炼铁模型开发
posstos22 分钟前
用 MiniMax-H3 做 AI 短剧:一个 SKILL 把剧本自动拆成六段式提示词
人工智能·aigc·ai视频·提示词工程·minimax·ai短剧·分镜脚本
昇腾CANN23 分钟前
CANNBot PyPTO 算子编程智能体的使用,从一段 Prompt 开始
人工智能·开源·昇腾·cann·cann开源