chore: track model variant in honeycomb (#26188)

This commit is contained in:
Victor Navarro
2026-05-07 19:38:04 +02:00
committed by GitHub
parent a300a6cc7a
commit 626a488fb8
8 changed files with 10 additions and 1 deletions
@@ -71,6 +71,7 @@ export async function handler(
modelList: "lite" | "full"
parseApiKey: (headers: Headers) => string | undefined
parseModel: (url: string, body: any) => string
parseVariant: (url: string, body: any) => string | undefined
parseIsStream: (url: string, body: any) => boolean
},
) {
@@ -93,6 +94,7 @@ export async function handler(
const url = input.request.url
const body = await input.request.json()
const model = opts.parseModel(url, body)
const variant = opts.parseVariant(url, body)
const isStream = opts.parseIsStream(url, body)
const rawIp = input.request.headers.get("x-real-ip") ?? ""
const ip = rawIp.includes(":") ? rawIp.split(":").slice(0, 4).join(":") : rawIp
@@ -109,6 +111,7 @@ export async function handler(
request: requestId,
client: ocClient,
user_agent: userAgent,
"model.variant": variant,
})
const zenData = ZenData.list(opts.modelList)
const modelInfo = validateModel(zenData, model)