Hugging Face Space (Static) Deployment
Relevant source files
The following files were used as context for generating this wiki page:
Hugging Face Space (Static) Deployment allows the project to run as a serverless, static portfolio. This deployment method utilizes the Hugging Face Static SDK to serve HTML, CSS, and JavaScript files directly without a build step or backend server. The system maintains interactive functionality for dynamic AI components by routing requests through external signing proxies, ensuring that no sensitive secrets or API keys reside within the client-side code.
Sources: README.md:24-28, showcase.html:80
Deployment Workflow
To deploy the portfolio to Hugging Face, you must configure a new Space with specific settings. The project is designed to be self-contained as of version 10.2, bundling all necessary assets and demo pages for immediate service.
Implementation Steps
- Create Space: Initialize a new Space on Hugging Face.
- Select SDK: Choose the Static SDK option during setup.
- Upload Assets: Upload the root directory contents or perform a
git pushto the Space repository. - Verification: Confirm
index.htmlserves at the root and verify thatshowcase/exhibits resolve correctly from the Showcase page.
Sources: README.md:25-27, CHANGELOG.md:9-10
Deployment Configuration Table
| Parameter | Value | Description |
|---|---|---|
| SDK Type | Static | Serves files as a static web server without a backend. |
| Entry Point | index.html | The default file served at the root URL. |
| Build Step | None | Files are served as-is from the repository. |
| Secrets | None | No Hugging Face Secrets are required for basic static hosting. |
| Dynamic Content | Proxy-based | Dynamic features use a signing proxy to reach the runtime. |
Sources: README.md:25-28, showcase.html:80
Architecture and Data Flow
The static deployment architecture separates the presentation layer from the intelligence runtime. While the files are hosted statically, interactive elements like "Billy — Live Chat" and the "Generative Render Engine" communicate with the GestaltView runtime via a secure proxy.
Static to Runtime Communication Flow
This diagram illustrates how a statically hosted page performs dynamic AI synthesis without local server code.
The diagram shows the request path from the static UI to the external runtime via a signing proxy to maintain security without local secrets.
Sources: showcase.html:80, showcase/render-engine.html:48-49
Resource Management
The static deployment relies on a specific file structure to ensure all internal links resolve. The showcase/registry.json file acts as the canonical index for the showcase/ directory, allowing the static showcase.html page to render interactive artifacts.
File Structure for Deployment
| File/Directory | Role | Deployment Requirement |
|---|---|---|
index.html | Root Entry | Must be at the repository root. |
showcase.html | Gallery UI | References showcase/registry.json. |
showcase/ | Exhibit Storage | Contains self-contained interactive HTML artifacts. |
styles.css | Global Styling | Shared across all static pages. |
CHANGELOG.md | Version History | Documents self-contained bundling improvements. |
Sources: README.md:6-14, showcase/registry.json:173-176
Dynamic Feature Handling
For features requiring live synthesis, the static deployment utilizes specific JS configurations to point toward the correct proxy endpoints.
// Example configuration from showcase/render-engine.html
(function () {
var cfg = window.SHOWCASE_CONFIG || {};
var PROXY = cfg.PROXY_PATH || "/api/showcase-proxy";
var TIMEOUT = cfg.TIMEOUT_MS || 20000;
// ... synthesis logic ...
})();
Sources: showcase/render-engine.html:128-132
Security Considerations
The Hugging Face Static deployment avoids "secrets" in the page to prevent API key exposure.
- Signing Proxy: Authenticates requests to the GestaltView runtime.
- Ephemeral Data: User source text is sent for synthesis but not stored by the static page.
- Sandboxed Previews: PDF-ready HTML and other artifacts render in sandboxed iframes to prevent script injection.
Sources: showcase.html:80, showcase/render-engine.html:48-49, 184
Summary
Hugging Face Space (Static) Deployment provides a low-overhead hosting solution for the portfolio. By leveraging the Static SDK and a signing proxy architecture, the project delivers complex AI-driven experiences while maintaining the simplicity and security of a serverless static site. The transition to a self-contained package in version 10.2 ensures that all exhibits and demos function immediately upon upload to the Space.
Sources: README.md:28, CHANGELOG.md:9-10