Deploy SearchAudio (online, archive.org audio) to Hugging Face Spaces
This deploys the slim, text-only search service. Audio streams from archive.org, so the Space hosts no audio and runs no ASR β only bge-m3 (CPU) for query embedding.
Prerequisites
- The offline index is built (you've run
bulk_ingest.pyfor the files you want searchable). - A free Hugging Face account.
One-time setup
Export the index (locally):
python scripts/export_index.py # -> deploy/index/lancedbCreate a Space β https://huggingface.co/new-space β SDK: Docker β Hardware: CPU basic (free).
The Space repo's root
README.mdmust begin with this front matter (tells Spaces the port and SDK): ```yamltitle: SearchAudio sdk: docker app_port: 7860
Add these to the Space repo (at the repo root):
app/(the application code)config.yamlrequirements-online.txtDockerfileβ copydeploy/Dockerfileto the repo root asDockerfiledata/index/lancedb/β the exported index, tracked with Git LFS:git lfs install git lfs track "data/index/lancedb/**" git add .gitattributes data/index/lancedb
Push. The Space builds the Docker image and serves at
https://<user>-<space>.hf.space. First build downloads/bakes bge-m3 (a few minutes).
Verifying after deploy
- Open the Space URL, run an English query, click a result β it should play from the
timestamp, streaming from
archive.org. GET /api/configshould return{"mode":"archive","audio_query":false}(mic/upload hidden).
Updating the searchable content later
Re-run ingestion locally β python scripts/export_index.py β commit the new
data/index/lancedb (LFS) β push. The Space rebuilds automatically.
Notes & upgrade path
- Cold starts: free Spaces sleep when idle (~30β60 s to wake). For always-on with a
custom domain, use a ~$5β7/mo instance (Render/Fly/Railway); on low-RAM tiers switch to an
int8 bge-m3-ONNX (see the design spec
docs/superpowers/specs/2026-07-01-online-deployment-design.md). - Keep the archive.org item public β playback depends on it.
- The audio-query (mic/upload) feature is intentionally disabled online; it remains available in the local build.