add files
This commit is contained in:
1 parent
ab8adbfa12
commit
fbb31409da
8 files changed
+775
No files matched your search
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Enable Hermes API Server on the local gateway (one-time helper).
|
||||
# Docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/api-server
|
||||
set -euo pipefail
|
||||
|
||||
HERMES_ENV="${HERMES_HOME:-$HOME/.hermes}/.env"
|
||||
KEY="${1:-change-me-local-dev}"
|
||||
|
||||
mkdir -p "$(dirname "$HERMES_ENV")"
|
||||
touch "$HERMES_ENV"
|
||||
|
||||
set_kv() {
|
||||
local k="$1" v="$2"
|
||||
if grep -q "^${k}=" "$HERMES_ENV" 2>/dev/null; then
|
||||
sed -i "s|^${k}=.*|${k}=${v}|" "$HERMES_ENV"
|
||||
else
|
||||
printf '%s=%s\n' "$k" "$v" >>"$HERMES_ENV"
|
||||
fi
|
||||
}
|
||||
|
||||
set_kv API_SERVER_ENABLED true
|
||||
set_kv API_SERVER_KEY "$KEY"
|
||||
|
||||
echo "Updated $HERMES_ENV"
|
||||
echo " API_SERVER_ENABLED=true"
|
||||
echo " API_SERVER_KEY=${KEY}"
|
||||
echo
|
||||
echo "Restart gateway:"
|
||||
echo " systemctl --user restart hermes-gateway"
|
||||
echo "Smoke:"
|
||||
echo " curl -sS http://127.0.0.1:8642/v1/models -H \"Authorization: Bearer ${KEY}\""
|
||||
echo
|
||||
echo "Put the same key in zalo-hermes-bot/.env as HERMES_API_KEY"
|
||||
Reference in new issue
Block a user