fix(stats): merge deepseek flash variants (#46446)

This commit is contained in:
Adam 2026-08-31 12:32:22 -05:00 committed by GitHub
parent 26ff3ed3d3
commit b639de07ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -50,6 +50,10 @@ describe("inference stat normalization", () => {
})
test("merges renamed models under their current name", () => {
expect(statModel("deepseek-v4-flash-0731", "")).toBe("deepseek-v4-flash")
expect(statModel("deepseek-v4-flash-0731-free", "")).toBe("deepseek-v4-flash")
expect(statModel("deepseek-v4-flash-dsv4-flash-final-rnaovd", "")).toBe("deepseek-v4-flash")
expect(statModel("deepseek-v4-flash-vision-exp", "")).toBe("deepseek-v4-flash-vision-exp")
expect(statModel("x-preview-f", "")).toBe("glm-5.3-flash")
expect(statModel("ox-alpha", "")).toBe("glm-5.3-flash")
expect(statModel("ox-alpha-free", "")).toBe("glm-5.3-flash")
@ -130,6 +134,11 @@ describe("inference stat normalization", () => {
expect(queries[0]).toContain("COALESCE(NULLIF(lower(model_tier), ''), '') AS raw_tier")
expect(queries[0]).toContain("WHEN lower(COALESCE(raw_tier, '')) = 'free'")
expect(queries[0]).toContain("regexp_replace(NULLIF(route_model, ''), '^.*/', '')")
expect(queries[0]).toContain("= 'deepseek-v4-flash-0731' THEN 'deepseek-v4-flash'")
expect(queries[0]).toContain(
"= 'deepseek-v4-flash-dsv4-flash-final-rnaovd' THEN 'deepseek-v4-flash'",
)
expect(queries[0]).not.toContain("= 'deepseek-v4-flash-vision-exp' THEN 'deepseek-v4-flash'")
expect(queries[0]).toContain("= 'ox-alpha' THEN 'glm-5.3-flash'")
expect(queries[0]).toContain("= 'x-preview-f' THEN 'glm-5.3-flash'")
expect(queries[0]).toContain("OR lower(raw_model) IN ('gpt-5-nano', 'grok-code', 'big-pickle')")

View file

@ -16,6 +16,8 @@ export const MODEL_AUTHOR_RULES = [
export const EXCLUDED_MODELS = new Set(["alpha-gpt-next"])
export const FREE_MODELS = new Set(["gpt-5-nano", "grok-code", "big-pickle"])
export const MODEL_NAME_ALIASES: Record<string, string> = {
"deepseek-v4-flash-0731": "deepseek-v4-flash",
"deepseek-v4-flash-dsv4-flash-final-rnaovd": "deepseek-v4-flash",
"ox-alpha": "glm-5.3-flash",
"x-preview-f": "glm-5.3-flash",
"xiaomi/mimo-v2.5": "mimo-v2.5",