mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-28 04:29:42 +00:00
zen: tpm based routing
This commit is contained in:
parent
16caaa2229
commit
ae7a3518f7
1 changed files with 1 additions and 7 deletions
|
|
@ -32,13 +32,7 @@ export function createModelTpmLimiter(providers: { id: string; model: string; tp
|
|||
track: async (id: string, model: string, usageInfo: UsageInfo) => {
|
||||
const key = `${id}/${model}`
|
||||
if (!keys.includes(key)) return
|
||||
const usage =
|
||||
usageInfo.inputTokens +
|
||||
usageInfo.outputTokens +
|
||||
(usageInfo.reasoningTokens ?? 0) +
|
||||
(usageInfo.cacheReadTokens ?? 0) +
|
||||
(usageInfo.cacheWrite5mTokens ?? 0) +
|
||||
(usageInfo.cacheWrite1hTokens ?? 0)
|
||||
const usage = usageInfo.inputTokens
|
||||
if (usage <= 0) return
|
||||
await Database.use((tx) =>
|
||||
tx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue