Call and queue admission

The idea

PostgreSQL slots cap concurrent provider calls per fleet, org and account. Queue claims interleave organizations. A call with unknown usage keeps its full reservation held.

The problem
Replicas could flood a provider, one org could starve the others, and unknown charges were booked as zero.
Why it matters
Limits and fairness hold across replicas, and budgets never treat an unknown cost as free.
Where it stands
In production as of

A step-by-step replay of this idea is not published yet. The library adds one when a recorded run shows it.

Where it lives in the product

  • Own accounts, execution profiles and payers

    Hosted work uses API keys. A subscription runs only through the vendor's product or the person's own runner. Executor, model, host and payer inherit from the platform through org, role and worker.

  • Model failure handling and outage recovery

    An unusable answer moves one tier up in the same call. Quota or auth failures put an arm on cooldown. A timeout retries at lower effort. A transient outage parks the item on a backoff timer and resumes the same run.

  • Plans, entitlements and credits

    An org's plan sets its limits and credits. Credits pay for calls on platform keys, calls on the org's own accounts use no credits, and trial calls also need the pooled allowance.

Turn the numbers into shipped work.

Crewshal runs these choices for you: a persistent AI worker with memory and rules, on your Claude and Codex subscriptions.