Spaces:
Sleeping
Publish SIEGE to Hugging Face Spaces
The container definition lives at the repo root as Dockerfile (for HF’s default “build from root” flow).
Option A — One Space = this full GitHub repo (recommended)
- On Hugging Face new Space, create a Docker Space and link the same remote as this project (or push a mirror to
https://huggingface.co/spaces/<user>/<name>and add the GitHub remote). - Settings → Configuration: SDK Docker, use default
Dockerfileat repository root. Build context = repo root. - Secrets (optional): set
HUGGING_FACE_HUB_TOKENif the configuredMODEL_NAMEis gated. - Wait for the build; open the Space URL. First boot may take a while while the model is downloaded.
Option B — OpenEnv CLI (openenv push)
The repo is an OpenEnv environment (see openenv.yaml at the repo root). With the Hugging Face Hub CLI logged in (huggingface-cli login or HF_TOKEN in the environment):
cd /path/to/siege
uv run openenv validate # static checks
uv run openenv validate --url http://127.0.0.1:8000 # runtime: start server first
# Push a Docker Space (defaults to <your_hf_user>/interp-arena from openenv.yaml name, or set --repo-id)
uv run openenv push --repo-id YOUR_HF_USER/interp-arena
openenv push stages the repo, prefers the root Dockerfile when present, and can inject ENABLE_WEB_INTERFACE=true for the Gradio web UI. Ensure /metadata is fast: this project loads the target model only on reset/step, not on every metadata probe (required for openenv validate --url).
Scripted client demo (attack/defence transcript): see demos/demo_arena_transcript.py and demos/sample_transcript.md — point --url at your Space, e.g. https://bart-ender-siege.hf.space, and use a long SIEGE_OPENENV_MESSAGE_TIMEOUT on first boot.
Local check before pushing
cd /path/to/siege
docker build -t siege-hf .
docker run --rm -p 7860:7860 \
-e HUGGING_FACE_HUB_TOKEN=optional_if_gated \
siege-hf
# Visit http://localhost:7860
Port
Hugging Face Spaces expect the app to listen on PORT (typically 7860). The provided Dockerfile uses uvicorn with host 0.0.0.0 and that port. Do not bind to 8000 on the Space.
If the build runs out of RAM
Use a smaller MODEL_NAME or a larger Space (CPU + RAM) tier. The 0.5B model is already the default small target.