Compare commits

..

5 Commits

Author SHA1 Message Date
2ff99b1f57 Merge master into fix/matrix-bridge-dependencies to resolve conflicts
Some checks failed
Build Hermes agent / build (pull_request) Has been cancelled
Build ollama (gfx906) / build (pull_request) Has been cancelled
2026-05-20 14:42:02 -04:00
dea1429a5d Merge pull request #2: fix: Matrix bridge ModuleNotFoundError - install deps to venv with persistence
# Conflicts:
#	ai/compose.yml
2026-05-20 14:41:06 -04:00
Thierry Pouplier
2aab06cc1a fix: use mautrix[encryption] instead of matrix-nio for Matrix bridge
The Hermes Matrix gateway uses the mautrix SDK, not matrix-nio.
This fixes E2EE support by installing the correct library.

Refs: PR #2
2026-04-29 03:34:15 +00:00
Thierry Pouplier
a404f5e2c4 fix: Correct OPENROUTER_API_KEY variable name 2026-04-29 02:43:35 +00:00
Thierry Pouplier
f9afd79f3e fix: Add openai and matrix-nio dependencies for Hermes Matrix bridge 2026-04-29 02:19:24 +00:00
2 changed files with 59 additions and 67 deletions

96
ai/compose.yml Normal file → Executable file
View File

@@ -32,11 +32,9 @@ services:
- default - default
container_name: hermes container_name: hermes
entrypoint: ["/bin/bash", "-c", entrypoint: ["/bin/bash", "-c",
"bash /opt/data/hermes-tools/install.sh && exec /usr/bin/tini -g -- /opt/hermes/docker/entrypoint.sh \"$@\"", "bash /opt/data/hermes-tools/install.sh && . /opt/hermes/.venv/bin/activate && uv pip install openai 'mautrix[encryption]' -q && exec /usr/bin/tini -g -- /opt/hermes/docker/entrypoint.sh \"$@\"",
"hermes-entrypoint"] "hermes-entrypoint"]
restart: always restart: always
# Gateway run enables the internal API server on port 8642
command: gateway run
environment: environment:
- OLLAMA_HOST=http://ollama:11434 - OLLAMA_HOST=http://ollama:11434
- API_SERVER_ENABLED=true - API_SERVER_ENABLED=true
@@ -58,6 +56,8 @@ services:
- /mnt/HoardingCow_docker_data/Syncthing/telos-ro:/opt/data/telos-ro:ro - /mnt/HoardingCow_docker_data/Syncthing/telos-ro:/opt/data/telos-ro:ro
# Syncthing-shared inbox — write tasks here, they sync to user's laptop # Syncthing-shared inbox — write tasks here, they sync to user's laptop
- /mnt/HoardingCow_docker_data/Syncthing/telos-rw:/opt/data/telos-rw:rw - /mnt/HoardingCow_docker_data/Syncthing/telos-rw:/opt/data/telos-rw:rw
# Persist Python venv across container recreation (Matrix bridge deps, etc.)
- /mnt/HoardingCow_docker_data/Hermes/venv:/opt/hermes/.venv
devices: devices:
- /dev/kfd:/dev/kfd - /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri - /dev/dri:/dev/dri
@@ -112,7 +112,22 @@ services:
- /mnt/HoardingCow_docker_data/Ollama/ollama:/root/.ollama - /mnt/HoardingCow_docker_data/Ollama/ollama:/root/.ollama
environment: environment:
- OLLAMA_VULKAN=0 - OLLAMA_VULKAN=0
- HSA_OVERRIDE_GFX_VERSION=9.0.6
- HCC_AMDGPU_TARGET=gfx906
- HIP_VISIBLE_DEVICES=0,1
- ROCR_VISIBLE_DEVICES=0,1
- HSA_ENABLE_SDMA=0
- OLLAMA_HOST=0.0.0.0 - OLLAMA_HOST=0.0.0.0
- OLLAMA_DEBUG=1
- OLLAMA_FLASH_ATTENTION=1
- OLLAMA_NUM_PARALLEL=2
devices:
# Map the render nodes and KFD for ROCm to work inside the container
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/dri
group_add:
- "303"
- "26"
networks: networks:
ai_net: ai_net:
@@ -122,40 +137,47 @@ networks:
driver: bridge driver: bridge
name: ai_backend name: ai_backend
llama-cpp-hermes: # llama_cpp_devstral:
image: llama-cpp:rocm-gfx906 # image: ghcr.io/ggml-org/llama.cpp:server-rocm
container_name: llama-cpp-hermes # container_name: llama_cpp_devstral
restart: unless-stopped # restart: unless-stopped
networks: # networks:
- ai_backend # - ai_backend
ports: # ports:
- "127.0.0.1:8300:8080" # - "8300:8080"
ipc: host # ipc: host
devices: # devices:
- /dev/kfd:/dev/kfd # - "/dev/kfd:/dev/kfd"
- /dev/dri:/dev/dri # - "/dev/dri:/dev/dri"
group_add: # group_add:
- "303" # - "303" # video
- "26" # - "26" # render
environment: # environment:
- HSA_OVERRIDE_GFX_VERSION=9.0.6 # HSA_OVERRIDE_GFX_VERSION: 9.0.6
- HSA_ENABLE_SDMA=0 # HIP_VISIBLE_DEVICES: 0,1
- HIP_VISIBLE_DEVICES=0,1 # LLAMA_CACHE: /models
- LLAMA_CACHE=/models # volumes:
volumes: # - /mnt/HoardingCow_docker_data/Llama_cpp/models:/models
- /mnt/HoardingCow_docker_data/Llama_cpp/models:/models # - /mnt/HoardingCow_docker_data/Llama_cpp/devstral-agent.jinja:/template.jinja
- /mnt/HoardingCow_docker_data/Ollama/ollama/models/blobs/sha256-17823599694fa3503ef54bf748d5078c6ce881f4d01616cafa255dc05d215a08:/model.gguf:ro # command: >
command: > # -hf unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF:Devstral-Small-2-24B-Instruct-2512-Q8_0.gguf
-m /model.gguf # -a devstral-2-small-llama_cpp
--host 0.0.0.0 # --chat-template-file /template.jinja
--port 8080 # --host 0.0.0.0
--gpu-layers 99 # --port 8080
--ctx-size 163840 # --n-gpu-layers 99
-ctk f16 -ctv f16 # --ctx-size 163840
--flash-attn on # --batch-size 4096
--split-mode layer # --ubatch-size 4096
--no-mmap # --cache-type-k f16
--n-predict -1 # --cache-type-v f16
# --cache-reuse 256
# --flash-attn on
# --context-shift
# --split-mode layer
# --no-mmap
# --n-predict -1
# --parallel 2
# vllm: # vllm:
# image: nalanzeyu/vllm-gfx906:v0.9.0-rocm6.3 # image: nalanzeyu/vllm-gfx906:v0.9.0-rocm6.3

View File

@@ -1,30 +0,0 @@
# llama-cpp-rocm6/Dockerfile
# Custom llama.cpp server with ROCm 6.1 + gfx906 (MI50) support.
# Build: docker build -t llama-cpp:rocm-gfx906 .
FROM rocm/dev-ubuntu-22.04:6.1.2-complete AS builder
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl git build-essential pkg-config cmake make && rm -rf /var/lib/apt/lists/*
ARG LLAMACPP_VERSION=b9596
RUN git clone --depth 1 --branch ${LLAMACPP_VERSION} https://github.com/ggml-org/llama.cpp.git /build
WORKDIR /build
ENV HIP_PATH=/opt/rocm ROCM_PATH=/opt/rocm PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:${PATH} CMAKE_PREFIX_PATH=/opt/rocm
RUN mkdir build && cd build && \
cmake .. -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release \
-DAMDGPU_TARGETS="gfx906:xnack-" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DGGML_CUDA=OFF -DGGML_VULKAN=OFF -DGGML_METAL=OFF \
-DBUILD_SHARED_LIBS=OFF && \
cmake --build . --target llama-server -- -j $(nproc)
FROM ubuntu:24.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates curl libstdc++6 libgomp1 libopenblas0 \
libnuma1 libelf1 libdrm2 libdrm-amdgpu1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/rocm/lib/ /opt/rocm/lib/
COPY --from=builder /opt/rocm/share/ /opt/rocm/share/
COPY --from=builder /build/build/bin/llama-server /usr/local/bin/llama-server
RUN echo /opt/rocm/lib > /etc/ld.so.conf.d/rocm.conf && ldconfig
ENV HSA_OVERRIDE_GFX_VERSION=9.0.6 HCC_AMDGPU_TARGET=gfx906 HSA_ENABLE_SDMA=0
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/llama-server"]