nlp-analysis-api / README_DEPLOYMENT.md
karim323's picture
Add NLP Analysis API backend with FastAPI and transformers
e4eb82b

Deployment Options

🎯 Recommended: Hugging Face Spaces (FREE)

Perfect for ML apps! No size limits, designed for transformers.

Steps:

  1. Create Account: https://huggingface.co/join

  2. Create New Space:

  3. Upload Files:

    • Clone the HF Space repo locally
    • Copy all files from backend/nlp-backend/ to the Space
    • Add Dockerfile (already created)
    • Push to HF Space
  4. Get Live URL: https://huggingface.co/spaces/YourUsername/nlp-analysis-api

Benefits:

  • βœ… FREE forever
  • βœ… No size limits
  • βœ… ML-optimized infrastructure
  • βœ… Great for portfolio

Option 2: Render.com (FREE with limitations)

Pros:

  • βœ… Free tier available
  • βœ… Auto-deploys from GitHub
  • βœ… No image size limit

Cons:

  • ⚠️ 512 MB RAM (may need to optimize)
  • ⚠️ Sleeps after 15 min inactivity

Steps:

  1. Go to: https://render.com
  2. Create account
  3. New β†’ Web Service
  4. Connect GitHub repo
  5. Root Directory: backend/nlp-backend
  6. Build Command: pip install -r requirements.txt
  7. Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
  8. Select Free tier
  9. Deploy!

Option 3: Fly.io (FREE tier)

Pros:

  • βœ… Generous free tier
  • βœ… Good for Docker apps
  • βœ… Fast deployments

Steps:

  1. Install flyctl: https://fly.io/docs/hands-on/install-flyctl/
  2. Login: flyctl auth login
  3. In backend/nlp-backend/: flyctl launch
  4. Follow prompts
  5. Deploy: flyctl deploy

Option 4: Railway.app (PAID - $5/month)

Only if you want to pay:

  • Hobby plan: $5/month
  • Removes image size limit
  • Better for production

🎯 Recommendation

Use Hugging Face Spaces - it's free, unlimited, and perfect for ML apps!

The community loves seeing ML projects on HF Spaces, and it's great for your portfolio.