--- id: upstash-ratelimit version: "1.1.0" license: unclear license_treatment: permissive maintenance: dormant --- # upstash-ratelimit — Serverless ratelimiting package from Upstash License: permissive · Maintenance: dormant · Downloads: 83.3K/mo ## What it is and what it does upstash-ratelimit is a Python SDK for rate limiting designed specifically for serverless environments like AWS Lambda, Vercel, and Google Cloud Functions. It uses HTTP to communicate with Upstash's managed Redis service rather than TCP connections, making it suitable for ephemeral compute contexts where persistent connections are impractical. The package provides three rate-limiting algorithms—Fixed Window, Sliding Window, and Token Bucket—each with different trade-offs between computational cost and burst-handling behavior. You instantiate a Ratelimit object with a Redis client and your chosen algorithm, then call the limit() method with an identifier (user ID, API key, IP address, etc.) to check whether a request should be allowed. The method returns a Response object containing whether the request passed, the configured limit, remaining requests in the window, and when the limit resets. The package also supports async/await patterns via an asyncio module and allows you to block until a request is ready to proceed. Use it for: - Protect Lambda functions or serverless APIs from being overwhelmed by enforcing per-user or per-IP request quotas - Implement tiered rate limits (e.g., 10 req/10s for free users, 60 req/10s for paid) using multiple Ratelimit instances with different prefixes - Smooth out traffic bursts in serverless workloads using Token Bucket to process requests at a constant rate - Prevent request stampedes at window boundaries by using Sliding Window instead of Fixed Window - Share a single Redis instance across multiple applications by setting custom key prefixes to avoid collisions ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides connectionless rate limiting for Python applications in serverless environments, using Redis as the backing store and supporting multiple rate-limiting algorithms. Yes, if you are building serverless applications and need rate limiting backed by a managed Redis service. The package is production-stable, has no known vulnerabilities, and low install friction. However, maintenance is dormant—no updates since mid-2024—so you should be comfortable with a package that will not receive active development or rapid bug fixes. It is a good fit for established serverless workloads where the core functionality is stable and you do not expect frequent feature requests. ## Install pip install upstash-ratelimit uv add upstash-ratelimit poetry add upstash-ratelimit ## Installing upstash-ratelimit Before you install: Low friction install with a single runtime dependency (upstash-redis). Maintenance status is dormant—last commit was 2024-06-24 and no releases since 2024-05-16—so expect no active bug fixes or feature development, though the package is marked Production/Stable. License in practice: Licensed under MIT (permissive), so you can use it freely in commercial and private projects without restriction. Quickstart: pip install upstash-ratelimit from upstash_ratelimit import Ratelimit, FixedWindow from upstash_redis import Redis ratelimit = Ratelimit( redis=Redis.from_env(), limiter=FixedWindow(max_requests=10, window=10), ) response = ratelimit.limit("identifier") if response.allowed: print("Request allowed") Requires an Upstash Redis database to be created and UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN environment variables to be set. Verify before relying: - Whether the package works with async/await patterns beyond what the description excerpt shows - Performance characteristics and latency overhead of each rate-limiting algorithm in production - Support status and response time from Upstash for issues or questions ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 83.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags serverless rate limiting, redis rate limit python, api rate limiting, request throttling, token bucket rate limit, sliding window rate limit, lambda rate limiting, serverless, rate-limiting, redis [View on SkillFed](https://skillfed.io/packages/upstash-ratelimit) · [View on PyPI](https://pypi.org/project/upstash-ratelimit/)