Spaces:
Running
Download docs/deploy-huggingface.md from ignatius/curatorbot: direct link, hf CLI and curl.
- Browser
- Download file 5.03 kB
-
https://huggingface.co/spaces/ignatius/curatorbot/resolve/main/docs/deploy-huggingface.md
- Command line
-
hf download hf://spaces/ignatius/curatorbot/docs/deploy-huggingface.md
-
curl -L -o deploy-huggingface.md https://huggingface.co/spaces/ignatius/curatorbot/resolve/main/docs/deploy-huggingface.md
Deploying the demo to a Hugging Face Space
The repository is a ready Docker Space: the Dockerfile starts the server on port 7860. A Space reads its configuration from a YAML block at the top of its README.md; that block lives in space/README.md (the Space card), and the deploy step puts it in place of the GitHub README, which stays a normal project README.
Plan needed. Since mid-2026, Hugging Face requires a paid plan to create Docker (and Gradio) Spaces: PRO ($9 a month) for a personal account, Team ($20 per user a month) for an organisation. Static Spaces stay free. The hardware itself (CPU basic, 2 vCPU, 16 GB) has no hourly cost. Check huggingface.co/pricing for current prices.
This project hosts the Space on the lead's personal Hugging Face account (ignatius/curatorbot; the GitHub account is IgnatiusEzeani) with PRO, while the code stays in the SpaceTimeNarratives GitHub organisation. To move it to an organisation later, take a Team plan, create the Space there and change the HF_SPACE variable.
One-time setup
- Subscribe to PRO on the personal Hugging Face account (Settings > Billing, or huggingface.co/pro).
- Create the Space. New Space: owner
ignatius, namecuratorbot, SDK Docker, blank template, hardware CPU basic, visibility Private. - Add secrets (Space > Settings > Variables and secrets):
OPENROUTER_API_KEY(secret). By default the demo uses Claude Sonnet through OpenRouter, falling back to an OpenAI model if Claude fails. To use another provider, seedocs/model-providers.mdCURATORBOT_DEMO_PASSCODE(secret): protects your API credit on a public or shared SpaceCURATORBOT_SITE_PASSCODE(secret): locks the whole demo behind a sign-in page (see Privacy settings)- for real interviews: secret
HF_TOKEN(read access to the private dataset) and variableCURATORBOT_DATA_REPO=ignatius/curatorbot-data(seedocs/real-data-runbook.md) - optional variables:
CURATORBOT_LLM_MODEL,CURATORBOT_ENABLE_ASR=1for short audio clips (slow on CPU basic),CURATORBOT_MAX_CHARS
- Connect GitHub. Create a Hugging Face access token with write permission. In the GitHub repo (Settings > Secrets and variables > Actions) add secret
HF_TOKEN(that token) and variableHF_SPACE=ignatius/curatorbot. Thedeploy to Hugging Face Spaceworkflow then pushesmainto the Space after tests pass. Run it once by hand from the Actions tab.
To deploy without GitHub Actions:
git remote add space https://huggingface.co/spaces/ignatius/curatorbot
git switch -c space-deploy && cp space/README.md README.md && git commit -qam "Space card"
git push --force space space-deploy:main
git switch main && git branch -D space-deploy
Privacy settings
- A private Space on a personal account is visible only to you. Individual people cannot be added to it.
- To share with a team before going public: add the secret
CURATORBOT_SITE_PASSCODE, wait for the restart, check thathttps://ignatius-curatorbot.hf.spaceasks for the passcode, then set the Space to Public (Settings > Change Space visibility). Send the team the direct linkhttps://ignatius-curatorbot.hf.spaceand the passcode separately. Every page and API call then needs the passcode, including the interviews loaded from the private dataset; the dataset itself stays private, and the Space's Files tab shows only code. - Sign-ins last 14 days. Changing
CURATORBOT_SITE_PASSCODEsigns everyone out, so change it after each round of demos. Scripts can send the headerX-Site-Passcodeinstead of signing in. - Share the direct
hf.spacelink rather than the huggingface.co Space page: some browsers block the sign-in cookie inside that page's frame. - For named access instead of a shared passcode, move the Space to an organisation the reviewers belong to (Team plan), or add Hugging Face sign-in with a list of allowed users.
- Never deploy briefs for interviews whose release terms you have not confirmed.
- Live analysis sends pasted text to the model provider under your API account. The page says so to demo users.
Checking a deployment
https://<space-url>/api/healthshould report"live": trueand the model name.- The interview picker should list
DEMO-0001and any released interviews you added. - Run one live analysis with the synthetic transcript ("Load the synthetic transcript", then Analyse).
Costs
PRO is the fixed cost. CPU basic hardware is free and sleeps when unused. Each live analysis of a 25-turn transcript makes one model call; check your provider's current prices. GPU hardware is only needed for whole-interview transcription, which is better done offline (notebooks/prepare_on_colab.ipynb).
Free fallback
If PRO is not available, a free static Space can show the precomputed briefs without live analysis (needs a small static-export change), or the same Docker image can run on Google Cloud Run within its free monthly allowance.