What problem does it solve?
Golem agents calling external APIs, LLMs, or shared resources need enforced limits on consumption. This Skill shows how to define rate, capacity, and concurrency quotas in golem.yaml and enforce them in MoonBit agent code using the @quota module.
Core Features & Use Cases
- Quota Definition: Declare Rate, Capacity, and Concurrency limits per environment in golem.yaml with reject, throttle, or terminate enforcement actions.
- Token-Based Enforcement: Acquire a QuotaToken once and use with_reservation, reserve/commit, or split/merge to control consumption, including variable-cost reservations like LLM token usage.
- Agent-to-Agent Quota Sharing: Split quota tokens to pass budget to child agents over RPC and merge returned tokens back.
- Use Case: An agent calling an LLM reserves 4000 tokens, commits only the actual tokens used, and splits part of its quota to a child summarizer agent, all enforced across the distributed deployment.
Quick Start
Add resource quota definitions to my golem.yaml and show me how to rate limit API calls in my MoonBit Golem agent using @quota.with_reservation.