Routing & parallelization

activeidledissent
InputFan-outSafetyCode reviewDocsAggregator
  1. Routing: classify, then dispatch to a specialised prompt.
  2. Sectioning: fan out independent subtasks.
  3. Fan-in: latency = max(tᵢ), not Σtᵢ.
  4. Voting: N samples, majority aggregation.
Notes & references

Use when

Separable input classes, independent subtasks, or high-variance decisions.

Avoid

Subtasks with sequential dependencies; voting scales cost linearly in N.

# Route
kind = llm.classify(request)          # "billing"
return experts[kind](request)

# Split
parts = await gather(check_safety(x), review(x), write_docs(x))
return combine(parts)

# Vote
votes = await gather(*[judge(x) for _ in range(3)])
return majority(votes)