# Nitdaa Sibling Project - HF Deployment Guide **Version 1.0 Public Release** ## Overview This document outlines the specific steps and constraints required to deploy the Nitdaa mobile sibling to HuggingFace Spaces free tier. ## 1. Prerequisites - A HuggingFace account. - A HuggingFace Space configured with the **Docker** SDK. - Hardware allocation: Free Tier (2 vCPU, 16GB Disk, 12GB RAM). ## 2. HuggingFace Secrets Configuration To enable dynamic Dataset Synchronization, you must configure the following variable: - `HF_TOKEN`: A HuggingFace access token with "Read" and "Write" permissions to the `Sam-max1/he-data` and `Sam-max1/mat_data` datasets. This token is available via the system keyring or environment variables. - `ADMIN_MODE`: Set to `0` to completely lock down the UI for public usage. ## 2.1 Minimalist Deployment Rule Nitdaa must always contain **only the bare minimum files required** to run the application in HF and the bare minimum files to be pushed to HF. Exclude all extraneous assets, development scripts, or unnecessary documentation from the Hugging Face repository. ## 3. Deployment Steps 1. Clone the `nitdaa` folder locally. 2. Initialize a git repository pointing to your HF Space remote. 3. Use the HuggingFace CLI to upload large directories without timing out: ```bash huggingface-cli upload /nitdaa . . --repo-type space ``` 4. HuggingFace will automatically detect the `Dockerfile` in the root and begin building. ## 4. Cold Boot Times Due to the CPU-bound nature of the free tier: - **Docker Build**: ~5-8 minutes (first boot only). - **Dataset Sync**: Variable depending on the size of `he_data`. - **Model Load**: The `Qwen3.5-2B` GGUF model and PyTorch embeddings take ~1-2 minutes to spin up into memory on boot. ## 5. Security Safeguards Nitdaa implements headless API blocking. Any direct programmatic access to the REST endpoints (without proper CORS headers or session tokens) will automatically return `403 Forbidden` to prevent bot-net abuse on the public URL.