--- title: PlasmidGPT API emoji: 🧬 colorFrom: blue colorTo: green sdk: docker sdk_version: 4.0.0 app_file: Dockerfile pinned: false license: cc-by-nc-4.0 --- # PlasmidGPT API Service This HuggingFace Space deploys the PlasmidGPT model as a FastAPI service for DNA sequence generation. ## Features - 🧬 DNA sequence generation using PlasmidGPT - 🚀 FastAPI REST API - 💻 GPU acceleration (free on HuggingFace) - 🔒 CORS enabled for external API calls ## API Endpoints ### Health Check ``` GET /health ``` ### Generate Sequences ``` POST /generate Content-Type: application/json { "prompt": "ATGAAA", "max_length": 100, "temperature": 0.7, "num_return_sequences": 1, "do_sample": true, "repetition_penalty": 1.1 } ``` ## Usage from Render Backend Once deployed, your Render backend can call this Space: ```python import httpx space_url = "https://your-username-plasmidgpt-api.hf.space" response = await httpx.post( f"{space_url}/generate", json={ "prompt": "ATGAAA", "max_length": 100, "temperature": 0.7 } ) ``` ## Setup Instructions 1. **Create Space:** - Go to https://huggingface.co/spaces - Click "Create new Space" - Name: `your-username/plasmidgpt-api` - SDK: Docker - Visibility: Public 2. **Upload Files:** - Upload `app.py` - Upload `requirements.txt` - Upload `Dockerfile` (if using Docker SDK) 3. **Deploy:** - Space will automatically build and deploy - Wait for model to load (first time takes ~5-10 minutes) - Check `/health` endpoint to verify 4. **Get Space URL:** - Your Space URL: `https://your-username-plasmidgpt-api.hf.space` - Use this in your Render backend configuration ## Notes - First deployment takes longer (model download) - Model uses GPU if available (free on HuggingFace) - Space sleeps after inactivity (wake up on first request) - CORS is enabled for external API calls