Skip to content

Releases: arieradle/shekel

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

04 Jun 09:58

Choose a tag to compare

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.

v1.1.0

19 Mar 21:17

Choose a tag to compare

What's Changed

  • feat: v1.1.0 — Loop Guard, Spend Velocity, OpenAI Agents SDK adapter by @arieradle in #25

Full Changelog: v1.0.2...v1.1.0

v1.0.2

18 Mar 20:51

Choose a tag to compare

Full Changelog: v1.0.1...v1.0.2

v1.0.1

18 Mar 20:46

Choose a tag to compare

Full Changelog: v1.0.0...v1.0.1

v0.2.9

15 Mar 15:07

Choose a tag to compare

What's Changed

  • feat: shekel run — non-invasive CLI budget enforcement (v0.2.9) by @arieradle in #23

Full Changelog: v0.2.8...v0.2.9

v0.2.8

15 Mar 10:46
971adbe

Choose a tag to compare

What's Changed

  • feat: temporal budgets with rolling-window spend enforcement (v0.2.8) by @arieradle in #21
  • feat: Tool Budget API (v0.2.8) — max_tool_calls, tool_prices, auto-interception by @arieradle in #22

Full Changelog: v0.2.7...v0.2.8

v0.2.7

14 Mar 22:32
b0e56e2

Choose a tag to compare

What's Changed

  • feat: full async support for Gemini, HuggingFace, and nested budgets by @arieradle in #19
  • feat: OpenTelemetry metrics integration (ShekelMeter) by @arieradle in #20

Full Changelog: v0.2.6...v0.2.7

v0.2.6

12 Mar 21:11

Choose a tag to compare

What's Changed

  • feat: v0.2.6 — call limits, dict fallback API, breaking-change cleanup by @arieradle in #12
  • feat: add LiteLLM provider adapter (v0.2.6) by @arieradle in #14
  • feat: add LangGraph integration helper (v0.2.6) by @arieradle in #13
  • feat: LangGraph integration docs + mypy CI fix by @arieradle in #15
  • test: LangGraph integration tests (Groq, Gemini, mock) by @arieradle in #16
  • feat: add Google Gemini and HuggingFace provider adapters by @arieradle in #17
  • feat: release hardening for v0.2.6 by @arieradle in #18

Full Changelog: v0.2.5...v0.2.6

v0.2.5

11 Mar 20:55

Choose a tag to compare

What's Changed

  • feat: implement ProviderAdapter pattern for pluggable LLM provider integration (v0.2.5) by @arieradle in #8
  • test & ci: add comprehensive performance testing suite with CI/CD integration by @arieradle in #9
  • feat: comprehensive Ollama/Groq/Gemini integration tests by @arieradle in #10

Full Changelog: v0.2.4...v0.2.5

v0.2.4 — Langfuse Integration

11 Mar 08:43

Choose a tag to compare

What's New

🔭 Langfuse Integration — Full LLM Observability

Track costs, visualize budget hierarchies, and debug overruns in Langfuse — automatically.

from langfuse import Langfuse
from shekel import budget
from shekel.integrations import AdapterRegistry
from shekel.integrations.langfuse import LangfuseAdapter

lf = Langfuse(public_key="pk-lf-...", secret_key="sk-lf-...")
AdapterRegistry.register(LangfuseAdapter(client=lf, trace_name="my-app"))

with budget(max_usd=10.00, fallback="gpt-4o-mini", name="agent") as b:
    run_agent()  # costs flow to Langfuse automatically

Four features out of the box:

  • 💰 Real-time cost streamingshekel_spent, shekel_limit, shekel_utilization on every LLM call
  • 🌳 Nested budget hierarchy — child budgets become child spans (perfect waterfall view)
  • ⚠️ Circuit break events — WARNING events when budgets are exceeded, with overage metadata
  • 🔄 Fallback annotations — INFO events when fallback models activate, with savings data

Install

pip install shekel[langfuse]   # Langfuse only
pip install shekel[all]        # OpenAI + Anthropic + Langfuse

Also in this release

  • AdapterRegistry.unregister() — remove individual adapters
  • name parameter on @with_budget decorator — enables named parent budgets for nesting
  • effective_limit enforcement fix — auto-capped nested budgets now raise at their capped limit (not max_usd)
  • 267 tests, 95%+ coverage

Links