π¦ ClawHub
Nm Leyline Quota Management
by @athola
Quota tracking, threshold monitoring, and graceful degradation for rate-limited API services. quota, rate limiting, usage limits, thresholds.
β‘ When to Use
π‘ Examples
Check Quota Status
from leyline.quota_tracker import QuotaTrackertracker = QuotaTracker(service="my-service")
status, warnings = tracker.get_quota_status()
if status == "CRITICAL":
# Defer or use secondary service
pass
Record Usage
tracker.record_request(
tokens=estimated_tokens,
success=True,
duration=elapsed_seconds
)
Estimate Before Execution
can_proceed, issues = tracker.can_handle_task(estimated_tokens)
if not can_proceed:
print(f"Quota issues: {issues}")
π Tips & Best Practices
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
TERMINAL
clawhub install nm-leyline-quota-management