# Hugging Face Dataset Setup and Deployment Guide This document describes how to publish the Anvil Index RAG Packs sample to Hugging Face Datasets Hub. ## Prerequisites - Hugging Face account (create at https://huggingface.co) - Hugging Face CLI installed (`pip install huggingface-hub`) - Write access to anvilindex organization on Hugging Face - Git LFS installed (for large files, if applicable) ## Directory Structure ``` huggingface-sample/ ├── README.md # Dataset card with YAML frontmatter ├── CHUNKS.md # Quick reference index ├── SETUP.md # This file └── sample_chunks/ ├── governance/ # 8 files (4 chunks) ├── security/ # 8 files (4 chunks) ├── privacy/ # 8 files (4 chunks) ├── finserv/ # 8 files (4 chunks) └── healthcare/ # 8 files (4 chunks) ``` Total: 42 files (40 chunk files + 2 documentation files) ## Step 1: Prepare Hugging Face Repository ### Option A: Using Hugging Face Web Interface 1. Go to https://huggingface.co/datasets 2. Click "Create new dataset" 3. Fill in: - Owner: anvilindex (or your organization) - Dataset name: anvil-index-rag-packs-sample - Description: "20-chunk sample showcasing Anvil Index RAG Packs quality and schema" - License: Creative Commons Attribution 4.0 International - Make dataset public 4. Click "Create dataset" ### Option B: Using Hugging Face CLI ```bash huggingface-cli login huggingface-cli repo create \ --repo-type dataset \ --repo-name anvil-index-rag-packs-sample \ --organization anvilindex \ --public ``` ## Step 2: Clone and Configure Repository ```bash # Clone the repository cd /tmp git clone https://huggingface.co/datasets/anvilindex/anvil-index-rag-packs-sample cd anvil-index-rag-packs-sample # Configure Git git config user.name "Anvil Index" git config user.email "support@anvilindex.com" ``` ## Step 3: Add Dataset Files ```bash # Copy all files from local directory cp -r /sessions/pensive-epic-babbage/mnt/Domain-Specific\ Agentic\ Knowledge\ Bases\ \(RAG\ Packs\)/huggingface-sample/* . # Verify structure ls -la tree sample_chunks/ ``` ## Step 4: Create .gitattributes for Large Files (if needed) If any .json files exceed 100MB (they won't in this sample), configure Git LFS: ```bash # Create .gitattributes echo "*.json filter=lfs diff=lfs merge=lfs -text" >> .gitattributes echo "*.md filter=lfs diff=lfs merge=lfs -text" >> .gitattributes # Add to git git add .gitattributes git commit -m "Configure Git LFS for large files" ``` ## Step 5: Commit and Push to Hugging Face ```bash # Stage all files git add -A # Commit git commit -m "Add 20-chunk Anvil Index RAG Packs sample dataset This sample includes 4 representative chunks from each of 5 regulatory domains: - AI Governance (4 chunks) - AI Security (4 chunks) - AI Privacy (4 chunks) - Financial Services (4 chunks) - Healthcare (4 chunks) Each chunk includes both markdown content and rich JSON metadata with: - Semantic titles and controlled vocabularies - Cross-references to related chunks across domains - Compliance metadata (obligations, enforcement dates, risk tiers) - AI lifecycle and actor role classifications This is a free lead magnet showcasing Anvil Index quality and schema. License: CC BY 4.0" # Push to Hugging Face git push origin main ``` ## Step 6: Verify on Hugging Face 1. Navigate to https://huggingface.co/datasets/anvilindex/anvil-index-rag-packs-sample 2. Verify: - README.md displays correctly with dataset card information - CHUNKS.md appears in the file browser - sample_chunks/ folder structure is visible - All 40 chunk files are present ## Step 7: Update Dataset Card Settings Go to the dataset repo settings (https://huggingface.co/datasets/anvilindex/anvil-index-rag-packs-sample/settings): ### Basic Information - **Dataset name**: anvil-index-rag-packs-sample - **Description**: Free 20-chunk sample of Anvil Index RAG Packs showcasing regulatory compliance data quality and schema - **License**: CC-BY-4.0 - **Tags**: rag, regulatory-compliance, ai-governance, ai-security, legal-tech, vector-database ### Visibility - Make dataset public (already set via web interface) ### Citation Add this to the README YAML if not already included: ```yaml citation_info: url: "https://huggingface.co/datasets/anvilindex/anvil-index-rag-packs-sample" ``` ## Step 8: Create Dataset Card on Hugging Face (Alternative) If you prefer to edit directly on Hugging Face: 1. Go to dataset page 2. Click "Edit dataset card" 3. Paste the contents of README.md 4. Ensure YAML frontmatter is at the top 5. Save ## Post-Launch: Monitoring and Updates ### Track Downloads - Hugging Face provides download statistics in the dataset repo - Monitor for spikes indicating lead magnet effectiveness ### Handle Issues - Set up discussions for questions about the sample - Monitor for feature requests (e.g., "Can you add X regulatory domain?") - Track conversion from sample to paid product ### Future Updates - Version 1.1: Add CHUNKS.md searchable index - Version 1.2: Add optional Parquet exports for vector DB bulk loading - Version 2.0: Refresh to include updates from Pack version 1.3.0 ## Integration with Product Sales ### Lead Magnet Workflow 1. User downloads sample from Hugging Face 2. User evaluates in their vector DB 3. User visits https://anvilindex.com/products 4. User selects and purchases full pack ### Marketing Copy Suggestions - "Download free 20-chunk Anvil Index sample on Hugging Face" - "Evaluate RAG Pack quality before purchasing" - "See how regulatory cross-references work" - "Test in your vector database at no cost" ### Cross-Promotion - Add Hugging Face dataset link to website footer - Include in product announcement emails - Share in AI/ML communities (Reddit, Twitter, LinkedIn) - Submit to regulatory tech and legal tech newsletters ## Troubleshooting ### Large File Push Fails Install Git LFS: ```bash git lfs install git lfs track "*.json" "*.md" git add .gitattributes git commit -m "Add LFS tracking" git push origin main ``` ### Permission Denied on Push Ensure you are authenticated: ```bash huggingface-cli login git push origin main ``` ### YAML Frontmatter Not Rendering - Verify README.md begins with `---` - Ensure YAML is valid (correct spacing, no tabs) - Test at https://www.yamllint.com/ ## References - Hugging Face Datasets Documentation: https://huggingface.co/docs/datasets - Dataset Card Guide: https://github.com/huggingface/datasets/blob/main/src/datasets/commands/upload_dataset.py - Markdown Guide: https://huggingface.co/docs/hub/datasets-markdown ## Questions? Contact: support@anvilindex.com --- **Setup guide version**: 1.0.0 **Last updated**: March 29, 2026 **Tested with**: Hugging Face Hub v0.19+, Git 2.30+