aj-mini-api / FREE_HOSTING_SETUP.md
tomo14151
Deploy AJ Mini API to Hugging Face Spaces - Created by AJ STUDIOZ
9d79680

πŸ†“ AJ Model - Free Unlimited Hosting Guide

Best Free Hosting Options for Unlimited Requests


⭐ Option 1: Render.com (RECOMMENDED)

Features:

  • βœ… Free tier with 750 hours/month
  • βœ… Unlimited requests
  • βœ… Auto-deploy from GitHub
  • βœ… Custom domain support
  • βœ… HTTPS included
  • ⚠️ Sleeps after 15 min inactivity (wakes on request)

Quick Setup:

Step 1: Push to GitHub

cd "d:\New folder (11)"
git init
git add .
git commit -m "Initial commit for Render deployment"
git branch -M main
git remote add origin https://github.com/tomoacademycare-beep/AJ.git
git push -u origin main

Step 2: Create render.yaml (Already included in your repo)

Your render.yaml is ready! Just deploy.

Step 3: Deploy on Render

  1. Go to https://render.com
  2. Sign up with GitHub
  3. Click "New +" β†’ "Blueprint"
  4. Connect your AJ repository
  5. Click "Apply" - Render will auto-deploy!

Step 4: Get Your URL

After deployment (5-10 minutes), you'll get a URL like:

https://aj-api-xxxx.onrender.com

Step 5: Test Your API

curl -X POST "https://aj-api-xxxx.onrender.com/api/chat" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello AJ"}'

πŸš€ Option 2: Railway.app

Features:

  • βœ… $5 free credit monthly
  • βœ… Unlimited requests
  • βœ… No sleep mode
  • βœ… Fast deployment
  • βœ… Great for Docker

Quick Setup:

Step 1: Create railway.json

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "DOCKERFILE",
    "dockerfilePath": "Dockerfile"
  },
  "deploy": {
    "startCommand": "/app/start.sh",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}

Step 2: Deploy

  1. Go to https://railway.app
  2. Sign up with GitHub
  3. Click "New Project" β†’ "Deploy from GitHub repo"
  4. Select your AJ repository
  5. Railway will auto-detect Dockerfile and deploy

Step 3: Get Your URL

Railway provides a URL like:

https://aj-production.up.railway.app

🌐 Option 3: Fly.io

Features:

  • βœ… Free tier: 3 shared-cpu VMs
  • βœ… 160GB bandwidth/month
  • βœ… No sleep mode
  • βœ… Edge locations worldwide

Quick Setup:

Step 1: Install Fly CLI

iwr https://fly.io/install.ps1 -useb | iex

Step 2: Login and Launch

cd "d:\New folder (11)"
fly auth login
fly launch --no-deploy

Step 3: Configure fly.toml (Already created below)

Step 4: Deploy

fly deploy

Step 5: Get Your URL

https://aj-api.fly.dev

πŸ™ Option 4: Hugging Face Spaces (Free Forever)

Features:

  • βœ… Completely free
  • βœ… No credit card required
  • βœ… Unlimited public usage
  • βœ… Community support

Setup:

Step 1: Create Space

  1. Go to https://huggingface.co/spaces
  2. Click "Create new Space"
  3. Name: aj-mini-api
  4. License: MIT
  5. SDK: Docker

Step 2: Push Your Code

git remote add hf https://huggingface.co/spaces/YOUR-USERNAME/aj-mini-api
git push hf main

Your API will be live at:

https://YOUR-USERNAME-aj-mini-api.hf.space

πŸ’Ž Option 5: Glitch.com

Features:

  • βœ… Free unlimited projects
  • βœ… No credit card required
  • βœ… Auto-restarts on activity
  • βœ… Online IDE

Quick Setup:

  1. Go to https://glitch.com
  2. Click "New Project" β†’ "Import from GitHub"
  3. Enter: https://github.com/tomoacademycare-beep/AJ
  4. Wait for import and deploy

Your URL:

https://aj-api.glitch.me

πŸ† RECOMMENDED: Keep-Alive Service (Prevent Sleep)

For services that sleep (Render, Glitch), use a keep-alive service:

UptimeRobot (Free)

  1. Go to https://uptimerobot.com
  2. Add New Monitor
  3. Monitor Type: HTTP(s)
  4. URL: Your deployed API URL
  5. Monitoring Interval: 5 minutes

This pings your API every 5 minutes to keep it awake!


πŸ“Š Comparison Table

Platform Free Tier Requests Sleep Mode Docker Best For
Render 750hrs/mo Unlimited Yes (15min) βœ… Easy setup
Railway $5 credit Unlimited No βœ… Performance
Fly.io 3 VMs High No βœ… Global CDN
HuggingFace Forever Unlimited Yes βœ… AI/ML
Glitch Forever Good Yes ❌ Simplicity

🎯 My Recommendation for You:

Deploy to Railway.app + Render.com

  1. Primary: Railway.app (No sleep, best performance)
  2. Backup: Render.com (Always free)
  3. Keep-Alive: UptimeRobot (Keep both awake)

This gives you:

  • βœ… 100% uptime
  • βœ… Unlimited requests
  • βœ… Automatic failover
  • βœ… Zero cost

πŸ”₯ Quick Deploy Commands

Run this script to deploy everywhere:

# Already in your repo - just run:
.\DEPLOY_EVERYWHERE.ps1

This will:

  1. Push to GitHub
  2. Deploy to Render
  3. Deploy to Railway
  4. Deploy to Fly.io
  5. Show all your URLs

πŸ“ž Support

Created by AJ STUDIOZ


πŸŽ‰ What's Next?

After deployment, you'll have:

  • βœ… Public API URL
  • βœ… Unlimited requests
  • βœ… HTTPS enabled
  • βœ… No sleep mode (with keep-alive)
  • βœ… Auto-scaling

Your API will be accessible 24/7 for FREE! πŸš€