nitdaa / NITDAA_HF_DEPLOYMENT_GUIDE.md
Sam-max1's picture
Upload folder using huggingface_hub
4d376a9 verified
|
Raw
History Blame
1.73 kB

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 in your Space's Settings under Variables and Secrets:

  • HF_TOKEN: A HuggingFace access token with "Read" and "Write" permissions to the Sam-max1/he-data and Sam-max1/mat_data datasets.
  • ADMIN_MODE: Set to 0 to completely lock down the UI for public usage.

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:
    huggingface-cli upload <your_username>/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.