hermes搭建配置使用

安装

# 安装依赖
sudo apt update
sudo apt install -y build-essential python3-dev libssl-dev libffi-dev rustc cargo pkg-config

报错的话,继续安装下面的软件包:
apt install -y \
build-essential \
python3-dev \
libjpeg-dev \
zlib1g-dev \
libfreetype6-dev \
liblcms2-dev \
libopenjp2-7-dev \
libtiff-dev \
tk-dev \
libwebp-dev

# 安装脚本
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
或
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

建议 Linux 源码环境先自己构建新版 libheif;发行版自带版本通常太旧。

先安装编译依赖:

apt update
apt install -y \
  git \
  cmake \
  nasm \
  build-essential \
  pkg-config \
  curl \
  libde265-dev \
  libx265-dev \
  libaom-dev

然后下载 libheif 1.23.4:

cd /usr/local/src
git clone --depth 1 --branch v1.23.4 https://github.com/strukturag/libheif.git
cd libheif

编译安装到 /usr/local:

mkdir build
cd build

cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=/usr/local \
  -DWITH_LIBDE265=ON \
  -DWITH_X265=ON

make -j"$(nproc)"
make install

然后让系统找到新版库:

ldconfig

确认:

pkg-config --modversion libheif

应该得到:

1.23.4

再确认头文件:

ls -l /usr/local/include/libheif/heif_tiling.h

应该能看到文件。

很重要:确认编译器实际使用新版

执行:

pkg-config --cflags --libs libheif

正常应该出现类似:

-I/usr/local/include
-L/usr/local/lib
-lheif

然后:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

再确认:

pkg-config --modversion libheif
最后重新安装 Hermes
# 安装脚本
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

使用

# 修改相关配置
cat ~/.hermes/.env

# 重启服务
hermes gateway run --replace
或后台执行:
hermes gateway restart

← 返回首页 进入后台