Spaces:
Runtime error
Runtime error
Download server/limits.py from TheAbyss99/abyss-api: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/server/limits.py
- Command line
-
hf download hf://spaces/TheAbyss99/abyss-api/server/limits.py
-
curl -L -o limits.py https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/server/limits.py
721 Bytes
| """Phase S -central config for rate limiting, size caps and concurrency.""" | |
| import os | |
| # ----- SLIDING-WINDOW LIMITS: (max_requests, window_seconds) per identity ----- | |
| RATE_LIMIT_CHAT = (20, 60) | |
| RATE_LIMIT_AGENT = (10, 60) | |
| RATE_LIMIT_AUTH = (5, 300) | |
| RATE_LIMIT_READ = (120, 60) | |
| # ----- REQUEST SIZE & TOKEN CAPS ----- | |
| MAX_OUTPUT_TOKENS = 1024 | |
| MAX_MESSAGES = 50 | |
| MAX_MESSAGE_CHARS = 8000 | |
| MAX_PROMPT_CHARS = 16000 | |
| MAX_BODY_BYTES = 64 * 1024 | |
| # ----- CONCURRENCY ----- | |
| MAX_CONCURRENT_GENERATIONS = 3 | |
| GENERATION_QUE_TIMEOUT = 30 | |
| # ----- REDIS ----- | |
| REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/0") | |
| RATE_LIMIT_ENABLED = os.environ.get("RATE_LIMIT_ENABLED", "1") != "0" |