applyCarbonTable
Auto-generated API reference for applyCarbonTable.
Function: applyCarbonTable()
applyCarbonTable(
candidates,options?):RouterCandidate[]
Defined in: adapters/src/carbon.ts:99
Decorate a list of router candidates with gCO2PerKtok from a
carbon table. Returns a new list β does not mutate the input.
const candidates = applyCarbonTable([
{ id: 'openai-eu', adapter: openai({...}), region: 'swedencentral', cost: 0.6 },
{ id: 'anthropic-us', adapter: anthropic({...}), region: 'us-east-1', cost: 0.5 },
])
const router = createRouter({ candidates, policy: 'green-cost' })#Parameters
#candidates
#options?
ApplyCarbonOptions = \{\}