Skip to content

v1.2.0 — AutoGen Adapter and Per-Tenant Budget Enforcement

Latest

Choose a tag to compare

@arieradle arieradle released this 04 Jun 09:58
· 14 commits to main since this release

What's new in 1.2.0

AutoGen adapter

  • Patches ConversableAgent.initiate_chat and generate_reply transparently — no code changes needed
  • Per-agent caps via b.agent("name", max_usd=X) with AgentBudgetExceededError
  • Spend visible in budget.tree(); auto-skipped when pyautogen is not installed

Per-tenant budget enforcement

  • budget(max_usd=X, tenant_id=user.id, name="api", backend=RedisBackend()) — isolated cap per user, one shared backend
  • Redis key namespaced as shekel:tb:{name}:{tenant_id}; 30-day rolling window by default
  • BudgetConfigMismatchError on limit mismatch; Budget.tenant_id property; summary() surfaces tenant

Quota management API (RedisBackend / AsyncRedisBackend)

  • get_tenant_spend · get_tenant_limit · set_tenant_limit · reset_tenant · list_tenants
  • Full async equivalents on AsyncRedisBackend

shekel tenants CLI

  • shekel tenants list --name api — table with spend, limit, utilization
  • --json flag; set-limit and reset subcommands

Install

pip install shekel==1.2.0
pip install shekel[redis]==1.2.0   # for per-tenant enforcement

Full changelog

See docs/changelog.md for the complete entry.