π§ͺ DocStrange API Deployment Guide
π¦ Files in This Folder
app.py- FastAPI application for DocStrange extractionrequirements.txt- Python dependenciesDockerfile- Container configuration
π Deploy to Hugging Face
Method 1: Via Web UI (Easiest)
- Go to https://huggingface.co/spaces
- Click Create new Space
- Name:
docstrange-api - SDK: `Docker**
- Visibility:
Public(free) orPrivate(needs token) - Click Create Space
- Upload
app.pyandrequirements.txt - Wait 3-5 minutes for deployment
Method 2: Via Git
git clone https://huggingface.co/spaces/YOUR_USERNAME/docstrange-api
cd docstrange-api
cp app.py requirements.txt Dockerfile .
git add .
git commit -m "Deploy DocStrange API"
git push
π§ͺ Test Your Deployment
cd test-scripts
python test_docstrange.py https://YOUR_USERNAME-docstrange-api.hf.space
π‘ API Documentation
Once deployed, visit: https://YOUR_USERNAME-docstrange-api.hf.space/docs
π§ Endpoints
GET /- Health checkPOST /extract- Full document extractionPOST /extract/markdown- Markdown/text onlyPOST /extract/tables- Tables only
π‘ Tips
- DocStrange supports GPU mode if available
- Automatic GPU detection in the API
- Works with any document format (PDF, DOCX, Images, etc.)