Skip to content

Token Budget Allocator

Allocates token budgets across agents based on topology and task complexity.

Types

typescript
interface TokenBudget {
  totalBudget: number;
  perAgentBudget: number;
  reservedForTools: number;
  reservedForVerification: number;
}

interface AllocationResult {
  lead: number;
  specialists: number;
  evaluation: number;
  overhead: number;
}

API

typescript
const allocator = new TokenBudgetAllocator({ baseBudget: 100000 });

// Allocate based on topology
const budget = allocator.allocate(
  topology: Topology,
  complexity: number,
  agentCount: number
): TokenBudget;

// Get allocation breakdown
const allocation = allocator.getAllocation(
  topology: OrchestrationTopology,
  totalBudget: number
): AllocationResult;

Allocation by Topology

TopologyLeadSpecialistsEvaluationOverhead
SINGLE95%0%5%0%
CHAIN30%50%15%5%
DISPATCH15%65%15%5%
ORCHESTRATOR35%45%15%5%
REVIEW25%30%40%5%

MIT Licensed — Built for multi-agent orchestration.