llm-token
Multi-resource rate limiting for LLM APIs. Reserve tokens before you call, refund what you don't use, stay under the limit across workers.
A powerful package for estimating token prices in large language models.