Fetching metadata from the HF Docker repository... Lega.AI / HUGGINGFACE_DEPLOYMENT.md CoderNoah
Initial commit
8b7e8f0
Hugging Face Spaces Deployment Guide for Lega.AI
🚀 Quick Deployment to Hugging Face Spaces
Step 1: Create a New Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose:
- Space name:
lega-ai (or your preferred name)
- License:
MIT
- SDK:
Docker
- Hardware:
CPU basic (sufficient for this app)
Step 2: Upload the Code
- Clone or download this repository
- Upload all files to your Hugging Face Space repository
Ensure the README.md has the correct frontmatter:
```yaml
title: Lega.AI
emoji: ⚖️
colorFrom: pink
colorTo: indigo
sdk: docker
pinned: false
Step 3: Configure Environment Variables
- In your Space, go to Settings → Variables
- Add the required environment variable:
Step 4: Deploy
- Commit and push your changes to the Space repository
- Hugging Face will automatically build and deploy your Docker container
- Wait for the build to complete (usually 5-10 minutes)
- Your app will be available at
https://huggingface.co/spaces/[username]/[space-name]
🔧 Customization Options
Environment Variables You Can Set:
GOOGLE_API_KEY (required)
MAX_FILE_SIZE_MB (default: 5)
TEMPERATURE (default: 0.2)
LOG_LEVEL (default: INFO)
Hardware Requirements:
- CPU Basic: Sufficient for most use cases
- CPU Upgrade: Recommended for heavy usage
- GPU: Not required for this application
📋 Troubleshooting
Common Issues:
- Build fails: Check that all files are uploaded correctly
- API errors: Ensure
GOOGLE_API_KEY is set correctly
- Timeout: Consider upgrading to CPU Upgrade hardware
Logs:
- Check the Space logs in the Hugging Face interface
- Look for startup messages and error information
🔒 Security Considerations
- Never commit your API key to the repository
- Use Hugging Face Spaces environment variables for sensitive data
- The application runs in a sandboxed environment on Hugging Face
📊 Usage Limits
- Hugging Face Spaces has usage limits for free tiers
- Consider upgrading for production use
- Monitor usage in your Hugging Face account dashboard