minimaxir / gpt-2-cloud-run

Text-generation API via GPT-2 for Cloud Run
MIT License
315 stars 86 forks source link

Add rate limiting #1

Closed minimaxir closed 5 years ago

minimaxir commented 5 years ago

Since Cloud Run does unauthenticated HTTP requests, it would be good to add a simple rate limit by IP.

Unfortunately there's no simple implementation, and the simple implementations that exist are for Flask only.

minimaxir commented 5 years ago

Actually rate limiting might be dumb because the limits cannot be shared across containers.

minimaxir commented 5 years ago

This isn't possible anyways because the user IP is not exposed to the container.