rag-python-rag / QUICK_START.md
viktor-hirenko
docs: add quick start guide for 5-minute deployment
03d02f2
|
Raw
History Blame Contribute Delete
2.72 kB

A newer version of the Gradio SDK is available: 6.26.0

Upgrade

Quick Start Guide - Hugging Face Spaces Deployment

πŸš€ 5-Minute Deployment

Step 1: Get Token (2 minutes)

# 1. Visit: https://huggingface.co/settings/tokens
# 2. Click "New token"
# 3. Name: "RAG System", Permissions: "read"
# 4. Copy token (starts with hf_)

Step 2: Test Locally (Optional but Recommended)

cd /Users/v.hirenko/Desktop/DevHubVault/my-ai-projects/rag-python-rag

# Set token
export HF_TOKEN=hf_your_token_here

# Install dependencies (if not done)
pip install -r requirements.txt

# Run tests
python test_hf_integration.py

# If all pass, test app
python app.py
# Open http://localhost:7860

Step 3: Create Space (1 minute)

# 1. Go to: https://huggingface.co/new-space
# 2. Fill in:
#    - Name: rag-python-rag
#    - SDK: Gradio
#    - Hardware: CPU basic (free)
# 3. Click "Create Space"

Step 4: Add Secret (1 minute)

# 1. Go to your Space Settings
# 2. Find "Repository secrets"
# 3. Add:
#    - Name: HF_TOKEN
#    - Value: Your token from Step 1
# 4. Click "Add"

Step 5: Deploy (1 minute)

cd /Users/v.hirenko/Desktop/DevHubVault/my-ai-projects/rag-python-rag

# Add HF Space as remote (replace YOUR_USERNAME)
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/rag-python-rag

# Push code
git push hf main
# Username: YOUR_USERNAME
# Password: Your HF token

Step 6: Verify

# 1. Go to your Space URL
# 2. Wait for "Running" status
# 3. Try example questions
# 4. Done! πŸŽ‰

πŸ“ Quick Commands

# Test locally
export HF_TOKEN=hf_xxx && python test_hf_integration.py

# Run app locally
python app.py

# Deploy to HF Spaces
git push hf main

# Update after changes
git add . && git commit -m "Update" && git push hf main

πŸ”— Quick Links

πŸ“š Full Documentation

  • DEPLOYMENT_GUIDE.md - Complete deployment walkthrough
  • ENV_SETUP.md - Environment variables
  • MIGRATION_SUMMARY.md - What changed
  • README_HF.md - HF Spaces README

⚠️ Common Issues

"HF_TOKEN not found" β†’ Add token to Space Settings β†’ Repository secrets

"Model not found" β†’ Check model name in config.py is correct

"Rate limit exceeded" β†’ Free tier: ~1000 requests/hour. Wait or upgrade to Pro.

Build failed β†’ Check Space logs for errors

πŸ’‘ Tips

  • Test locally before deploying
  • Keep HF_TOKEN secure
  • Monitor Space logs
  • Free tier is enough for testing
  • Upgrade to Pro ($9/mo) for production

Need help? See DEPLOYMENT_GUIDE.md for detailed instructions.