Spaces:
Running
Running
Commit ·
dea8214
0
Parent(s):
Initial Hermes Space
Browse files- .dockerignore +6 -0
- .gitattributes +35 -0
- .gitignore +5 -0
- Dockerfile +43 -0
- LOCAL_BUILD.md +30 -0
- README.md +57 -0
- space-entrypoint.sh +40 -0
.dockerignore
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.DS_Store
|
| 3 |
+
.env
|
| 4 |
+
.venv
|
| 5 |
+
__pycache__
|
| 6 |
+
*.pyc
|
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.DS_Store
|
| 2 |
+
.env
|
| 3 |
+
.venv/
|
| 4 |
+
__pycache__/
|
| 5 |
+
*.pyc
|
Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/nesquena/hermes-webui:latest
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
ARG HTTP_PROXY
|
| 8 |
+
ARG HTTPS_PROXY
|
| 9 |
+
ARG NO_PROXY
|
| 10 |
+
ARG http_proxy
|
| 11 |
+
ARG https_proxy
|
| 12 |
+
ARG no_proxy
|
| 13 |
+
|
| 14 |
+
RUN apt-get update \
|
| 15 |
+
&& apt-get install -y --no-install-recommends \
|
| 16 |
+
ca-certificates \
|
| 17 |
+
git \
|
| 18 |
+
ripgrep \
|
| 19 |
+
sudo \
|
| 20 |
+
&& git clone --depth=1 https://github.com/NousResearch/hermes-agent.git /opt/hermes \
|
| 21 |
+
&& mkdir -p /data/.hermes /data/.hermes/webui-mvp /workspace \
|
| 22 |
+
&& rm -rf /home/hermeswebui/.hermes \
|
| 23 |
+
&& ln -s /data/.hermes /home/hermeswebui/.hermes \
|
| 24 |
+
&& chown -R hermeswebui:hermeswebui /data /workspace /opt/hermes \
|
| 25 |
+
&& chown -h hermeswebui:hermeswebui /home/hermeswebui/.hermes \
|
| 26 |
+
&& apt-get clean \
|
| 27 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
+
COPY --chmod=755 space-entrypoint.sh /space-entrypoint.sh
|
| 30 |
+
|
| 31 |
+
ENV HERMES_HOME=/home/hermeswebui/.hermes \
|
| 32 |
+
HERMES_CONFIG_PATH=/home/hermeswebui/.hermes/config.yaml \
|
| 33 |
+
HERMES_WEBUI_STATE_DIR=/home/hermeswebui/.hermes/webui-mvp \
|
| 34 |
+
HERMES_WEBUI_DEFAULT_WORKSPACE=/workspace \
|
| 35 |
+
HERMES_WEBUI_HOST=0.0.0.0 \
|
| 36 |
+
HERMES_WEBUI_PORT=8787 \
|
| 37 |
+
HERMES_EXEC_ASK=1 \
|
| 38 |
+
WANTED_UID=1024 \
|
| 39 |
+
WANTED_GID=1024
|
| 40 |
+
|
| 41 |
+
EXPOSE 8787
|
| 42 |
+
|
| 43 |
+
CMD ["/space-entrypoint.sh"]
|
LOCAL_BUILD.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Local build
|
| 2 |
+
|
| 3 |
+
Normal build:
|
| 4 |
+
|
| 5 |
+
```bash
|
| 6 |
+
docker build -t hfspace-hermes .
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
Build through a proxy:
|
| 10 |
+
|
| 11 |
+
```bash
|
| 12 |
+
docker build \
|
| 13 |
+
--build-arg HTTP_PROXY=http://127.0.0.1:7890 \
|
| 14 |
+
--build-arg HTTPS_PROXY=http://127.0.0.1:7890 \
|
| 15 |
+
--build-arg http_proxy=http://127.0.0.1:7890 \
|
| 16 |
+
--build-arg https_proxy=http://127.0.0.1:7890 \
|
| 17 |
+
-t hfspace-hermes .
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
Run locally:
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
docker run --rm -p 8787:8787 \
|
| 24 |
+
-e HERMES_WEBUI_PASSWORD=change-me \
|
| 25 |
+
-e DEEPSEEK_API_KEY="$DEEPSEEK_API_KEY" \
|
| 26 |
+
-e HERMES_WEBUI_USER_PASSWORD=change-me-too \
|
| 27 |
+
hfspace-hermes
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
Then open `http://localhost:8787`.
|
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Hermes Agent WebUI
|
| 3 |
+
emoji: 👁
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: gray
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 8787
|
| 8 |
+
pinned: false
|
| 9 |
+
license: mit
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Hermes Agent WebUI Space
|
| 13 |
+
|
| 14 |
+
This Space runs the community Hermes WebUI with Hermes Agent source available in
|
| 15 |
+
the container.
|
| 16 |
+
|
| 17 |
+
## Required Space secrets
|
| 18 |
+
|
| 19 |
+
Set these in Hugging Face Space settings before exposing the app:
|
| 20 |
+
|
| 21 |
+
- `HERMES_WEBUI_PASSWORD`: password for the browser UI.
|
| 22 |
+
|
| 23 |
+
Optional provider secrets:
|
| 24 |
+
|
| 25 |
+
- `DEEPSEEK_API_KEY`
|
| 26 |
+
- `OPENAI_API_KEY`
|
| 27 |
+
- `OPENROUTER_API_KEY`
|
| 28 |
+
- `ANTHROPIC_API_KEY`
|
| 29 |
+
- `GOOGLE_API_KEY`
|
| 30 |
+
- `HF_TOKEN`
|
| 31 |
+
|
| 32 |
+
Optional runtime secret:
|
| 33 |
+
|
| 34 |
+
- `HERMES_WEBUI_USER_PASSWORD`: sets the `hermeswebui` Linux user password and
|
| 35 |
+
enables password-based `sudo` inside the container. Use only when you need it.
|
| 36 |
+
|
| 37 |
+
## Workspace and state
|
| 38 |
+
|
| 39 |
+
The default workspace is `/workspace`.
|
| 40 |
+
|
| 41 |
+
Hermes reads and writes its state at `/home/hermeswebui/.hermes`. In this Space
|
| 42 |
+
that path is a symlink to `/data/.hermes`, so Hermes Agent and Hermes WebUI use
|
| 43 |
+
one shared home directory. On a free Space this is ephemeral and can be lost
|
| 44 |
+
after rebuilds. Enable Hugging Face persistent storage if you want Hermes memory,
|
| 45 |
+
sessions, and profile configuration to survive rebuilds.
|
| 46 |
+
|
| 47 |
+
## Security notes
|
| 48 |
+
|
| 49 |
+
Use a private or protected Space. This app can inspect files and run agent tools,
|
| 50 |
+
so do not publish it without `HERMES_WEBUI_PASSWORD`.
|
| 51 |
+
|
| 52 |
+
If you set `HERMES_WEBUI_USER_PASSWORD`, anyone who can control the WebUI may be
|
| 53 |
+
able to run privileged commands inside the container. Prefer baking system
|
| 54 |
+
packages into the Dockerfile instead of using sudo at runtime.
|
| 55 |
+
|
| 56 |
+
This repo intentionally does not include keep-alive automation. Free Spaces can
|
| 57 |
+
sleep; for always-on usage, use paid hardware or accept cold starts.
|
space-entrypoint.sh
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
if [[ -z "${HERMES_WEBUI_PASSWORD:-}" ]]; then
|
| 5 |
+
echo "WARNING: HERMES_WEBUI_PASSWORD is not set. Set it as a Space secret before public use."
|
| 6 |
+
fi
|
| 7 |
+
|
| 8 |
+
if [[ -n "${HERMES_WEBUI_USER_PASSWORD:-}" ]]; then
|
| 9 |
+
echo "Configuring password-based sudo for hermeswebui."
|
| 10 |
+
printf 'hermeswebui:%s\n' "${HERMES_WEBUI_USER_PASSWORD}" | chpasswd
|
| 11 |
+
printf 'hermeswebui ALL=(ALL) ALL\n' > /etc/sudoers.d/hermeswebui
|
| 12 |
+
chmod 0440 /etc/sudoers.d/hermeswebui
|
| 13 |
+
unset HERMES_WEBUI_USER_PASSWORD
|
| 14 |
+
fi
|
| 15 |
+
|
| 16 |
+
mkdir -p /data/.hermes
|
| 17 |
+
|
| 18 |
+
if [[ -e /home/hermeswebui/.hermes && ! -L /home/hermeswebui/.hermes ]]; then
|
| 19 |
+
cp -a /home/hermeswebui/.hermes/. /data/.hermes/ 2>/dev/null || true
|
| 20 |
+
rm -rf /home/hermeswebui/.hermes
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
if [[ ! -L /home/hermeswebui/.hermes ]]; then
|
| 24 |
+
ln -s /data/.hermes /home/hermeswebui/.hermes
|
| 25 |
+
fi
|
| 26 |
+
|
| 27 |
+
mkdir -p "${HERMES_HOME:-/home/hermeswebui/.hermes}" \
|
| 28 |
+
"${HERMES_WEBUI_STATE_DIR:-/home/hermeswebui/.hermes/webui-mvp}" \
|
| 29 |
+
"${HERMES_WEBUI_DEFAULT_WORKSPACE:-/workspace}"
|
| 30 |
+
|
| 31 |
+
chown -R hermeswebui:hermeswebui \
|
| 32 |
+
/data/.hermes \
|
| 33 |
+
"${HERMES_HOME:-/home/hermeswebui/.hermes}" \
|
| 34 |
+
"${HERMES_WEBUI_STATE_DIR:-/home/hermeswebui/.hermes/webui-mvp}" \
|
| 35 |
+
"${HERMES_WEBUI_DEFAULT_WORKSPACE:-/workspace}" \
|
| 36 |
+
/opt/hermes || true
|
| 37 |
+
|
| 38 |
+
chown -h hermeswebui:hermeswebui /home/hermeswebui/.hermes || true
|
| 39 |
+
|
| 40 |
+
exec /hermeswebui_init.bash
|