Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 104 additions & 4 deletions packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,30 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = `
],
},
},
"alibaba/qwen3.8": {
"qwen3.8-max:scx": {
"context": 1000000,
"crossRegion": false,
"maxTokens": 131072,
"modelId": "Qwen3.8-Max",
"parameters": [
"frequency_penalty",
"max_tokens",
"presence_penalty",
"reasoning",
"response_format",
"stop",
"temperature",
"tools",
"top_p",
],
"provider": "scx",
"ptbEnabled": true,
"regions": [
"*",
],
},
},
"anthropic/claude-3-haiku-20240307": {
"claude-3-haiku-20240307:anthropic": {
"context": 200000,
Expand Down Expand Up @@ -7292,6 +7316,34 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = `
],
},
},
"zai/glm-5": {
"glm-5.2:scx": {
"context": 1000000,
"crossRegion": false,
"maxTokens": 131072,
"modelId": "GLM-5.2",
"parameters": [
"frequency_penalty",
"functions",
"max_tokens",
"presence_penalty",
"reasoning",
"response_format",
"seed",
"stop",
"structured_outputs",
"temperature",
"tool_choice",
"tools",
"top_p",
],
"provider": "scx",
"ptbEnabled": true,
"regions": [
"*",
],
},
},
}
`;

Expand All @@ -7312,6 +7364,9 @@ exports[`Registry Snapshots model coverage snapshot 1`] = `
"novita",
"openrouter",
],
"alibaba/qwen3.8": [
"scx",
],
"anthropic/claude-3-haiku-20240307": [
"anthropic",
"helicone",
Expand Down Expand Up @@ -7732,6 +7787,9 @@ exports[`Registry Snapshots model coverage snapshot 1`] = `
"novita",
"novita",
],
"zai/glm-5": [
"scx",
],
}
`;

Expand Down Expand Up @@ -7790,6 +7848,18 @@ exports[`Registry Snapshots pricing snapshot 1`] = `
},
],
},
"alibaba/qwen3.8": {
"scx": [
{
"cacheMultipliers": {
"cachedInput": 0.1157,
},
"input": 0.000001815,
"output": 0.0000054461,
"threshold": 0,
},
],
},
"anthropic/claude-3-haiku-20240307": {
"anthropic": [
{
Expand Down Expand Up @@ -9953,6 +10023,18 @@ exports[`Registry Snapshots pricing snapshot 1`] = `
},
],
},
"zai/glm-5": {
"scx": [
{
"cacheMultipliers": {
"cachedInput": 0.25,
},
"input": 6.6e-7,
"output": 0.0000023106,
"threshold": 0,
},
],
},
}
`;

Expand Down Expand Up @@ -10278,6 +10360,12 @@ exports[`Registry Snapshots verify registry state 1`] = `
"novita",
],
},
{
"model": "glm-5.2",
"providers": [
"scx",
],
},
{
"model": "gpt-4.1",
"providers": [
Expand Down Expand Up @@ -10813,6 +10901,12 @@ exports[`Registry Snapshots verify registry state 1`] = `
"novita",
],
},
{
"model": "qwen3.8-max",
"providers": [
"scx",
],
},
{
"model": "sonar",
"providers": [
Expand Down Expand Up @@ -10921,6 +11015,10 @@ exports[`Registry Snapshots verify registry state 1`] = `
"modelCount": 5,
"provider": "perplexity",
},
{
"modelCount": 2,
"provider": "scx",
},
{
"modelCount": 23,
"provider": "vertex",
Expand Down Expand Up @@ -10967,6 +11065,7 @@ exports[`Registry Snapshots verify registry state 1`] = `
"gemma2-9b-it",
"glm-4.6",
"glm-4.7",
"glm-5.2",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
Expand Down Expand Up @@ -11034,6 +11133,7 @@ exports[`Registry Snapshots verify registry state 1`] = `
"qwen3-coder-30b-a3b-instruct",
"qwen3-next-80b-a3b-instruct",
"qwen3-vl-235b-a22b-instruct",
"qwen3.8-max",
"sonar",
"sonar-deep-research",
"sonar-pro",
Expand All @@ -11049,9 +11149,9 @@ exports[`Registry Snapshots verify registry state 1`] = `
"claude-3.5-haiku:anthropic:*",
],
"totalArchivedConfigs": 0,
"totalEndpoints": 329,
"totalModelProviderConfigs": 329,
"totalModelsWithPtb": 108,
"totalProviders": 21,
"totalEndpoints": 331,
"totalModelProviderConfigs": 331,
"totalModelsWithPtb": 110,
"totalProviders": 22,
}
`;
4 changes: 4 additions & 0 deletions packages/cost/models/authors/alibaba/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ import type { ModelConfig, ModelProviderConfig } from "../../types";
// Import models
import { models as qwen25Models } from "./qwen2.5/models";
import { models as qwen3Models } from "./qwen3/models";
import { models as qwen38Models } from "./qwen3.8/models";

// Import endpoints
import { endpoints as qwen25Endpoints } from "./qwen2.5/endpoints";
import { endpoints as qwen3Endpoints } from "./qwen3/endpoints";
import { endpoints as qwen38Endpoints } from "./qwen3.8/endpoints";

// Aggregate models
export const alibabaModels = {
...qwen25Models,
...qwen3Models,
...qwen38Models,
} satisfies Record<string, ModelConfig>;

// Aggregate endpoints
export const alibabaEndpointConfig = {
...qwen25Endpoints,
...qwen3Endpoints,
...qwen38Endpoints,
} satisfies Record<string, ModelProviderConfig>;
45 changes: 45 additions & 0 deletions packages/cost/models/authors/alibaba/qwen3.8/endpoints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ModelProviderName } from "../../../providers";
import type { ModelProviderConfig } from "../../../types";
import { Qwen38ModelName } from "./models";

export const endpoints = {
"qwen3.8-max:scx": {
providerModelId: "Qwen3.8-Max",
provider: "scx",
author: "alibaba",
pricing: [
{
threshold: 0,
input: 0.000001815,
output: 0.0000054461,
cacheMultipliers: {
cachedInput: 0.1157, // $0.21/M cache read vs $1.815/M input
},
},
],
contextLength: 1_000_000,
maxCompletionTokens: 131_072,
// Qwen thinking models reject tool_choice "required" or an object, so
// tool_choice is intentionally left out.
supportedParameters: [
"max_tokens",
"temperature",
"top_p",
"stop",
"frequency_penalty",
"presence_penalty",
"reasoning",
"tools",
"response_format",
],
ptbEnabled: true,
endpointConfigs: {
"*": {},
},
},
} satisfies Partial<
Record<
`${Qwen38ModelName}:${ModelProviderName}` | Qwen38ModelName,
ModelProviderConfig
>
>;
17 changes: 17 additions & 0 deletions packages/cost/models/authors/alibaba/qwen3.8/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ModelConfig } from "../../../types";

export const models = {
"qwen3.8-max": {
name: "Qwen3.8 Max",
author: "alibaba",
description:
"Flagship 2.4-trillion-parameter MoE model in the Qwen3.8 series with native visual understanding, excelling at coding, professional work, and long-horizon autonomous agent tasks.",
contextLength: 1_000_000,
maxOutputTokens: 131_072,
created: "2026-08-02T00:00:00.000Z",
modality: { inputs: ["text", "image"], outputs: ["text"] },
tokenizer: "Qwen",
},
} satisfies Record<string, ModelConfig>;

export type Qwen38ModelName = keyof typeof models;
49 changes: 49 additions & 0 deletions packages/cost/models/authors/zai/glm-5/endpoints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { ModelProviderName } from "../../../providers";
import type { ModelProviderConfig } from "../../../types";
import { Glm5ModelName } from "./models";

export const endpoints = {
"glm-5.2:scx": {
providerModelId: "GLM-5.2",
provider: "scx",
author: "zai",
pricing: [
{
threshold: 0,
input: 0.00000066,
output: 0.0000023106,
cacheMultipliers: {
cachedInput: 0.25, // $0.165/M cache read vs $0.66/M input
},
},
],
quantization: "fp8",
contextLength: 1_000_000,
// SCX rejects max_tokens above 131072 even though the model card advertises 128k
maxCompletionTokens: 131_072,
supportedParameters: [
"functions",
"structured_outputs",
"reasoning",
"tool_choice",
"tools",
"response_format",
"max_tokens",
"temperature",
"top_p",
"stop",
"frequency_penalty",
"presence_penalty",
"seed",
],
ptbEnabled: true,
endpointConfigs: {
"*": {},
},
},
} satisfies Partial<
Record<
`${Glm5ModelName}:${ModelProviderName}` | Glm5ModelName,
ModelProviderConfig
>
>;
17 changes: 17 additions & 0 deletions packages/cost/models/authors/zai/glm-5/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ModelConfig } from "../../../types";

export const models = {
"glm-5.2": {
name: "Zai GLM-5.2",
author: "zai",
description:
"GLM-5.2 is Zhipu AI's flagship model for long-horizon coding and agentic engineering tasks. It extends the GLM series to a 1M token context window and adds stronger multi-step reasoning and tool orchestration.",
contextLength: 1_000_000,
maxOutputTokens: 131_072,
created: "2026-06-13T00:00:00.000Z",
modality: { inputs: ["text"], outputs: ["text"] },
tokenizer: "Zai",
},
} satisfies Record<string, ModelConfig>;

export type Glm5ModelName = keyof typeof models;
8 changes: 6 additions & 2 deletions packages/cost/models/authors/zai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import type { ModelConfig, ModelProviderConfig } from "../../types";
// Import models and endpoints
import { models as glm4Models } from "./glm-4/models";
import { endpoints as glm4Endpoints } from "./glm-4/endpoints";
import { models as glm5Models } from "./glm-5/models";
import { endpoints as glm5Endpoints } from "./glm-5/endpoints";

// Aggregate models
export const zaiModels = {
...glm4Models
...glm4Models,
...glm5Models
} satisfies Record<string, ModelConfig>;

// Aggregate endpoints
export const zaiEndpointConfig = {
...glm4Endpoints
...glm4Endpoints,
...glm5Endpoints
} satisfies Record<string, ModelProviderConfig>;
5 changes: 5 additions & 0 deletions packages/cost/models/provider-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export function heliconeProviderToModelProviderName(
return "fireworks";
case "CANOPYWAVE":
return "canopywave";
case "SCX":
return "scx";
// new registry does not have
case "LOCAL":
case "HELICONE":
Expand Down Expand Up @@ -138,6 +140,9 @@ export const dbProviderToProvider = (
if (provider === "canopywave" || provider === "Canopy Wave") {
return "canopywave";
}
if (provider === "scx" || provider === "SCX.ai") {
return "scx";
}
if (provider === "novita" || provider === "Novita") {
return "novita";
}
Expand Down
Loading