fix: update zai processing logic (#2855)
* feat: add new models and update zai processing logic * chore(ai): removed overrides, simplify provider pick --------- Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
committed by
GitHub
parent
52d16d5a31
commit
a9bd8045d6
@@ -376,8 +376,8 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process zAi models
|
// Process zAi models
|
||||||
if (data.zai?.models) {
|
if (data["zai-coding-plan"]?.models) {
|
||||||
for (const [modelId, model] of Object.entries(data.zai.models)) {
|
for (const [modelId, model] of Object.entries(data["zai-coding-plan"].models)) {
|
||||||
const m = model as ModelsDevModel;
|
const m = model as ModelsDevModel;
|
||||||
if (m.tool_call !== true) continue;
|
if (m.tool_call !== true) continue;
|
||||||
const supportsImage = m.modalities?.input?.includes("image");
|
const supportsImage = m.modalities?.input?.includes("image");
|
||||||
@@ -714,6 +714,7 @@ async function generateModels() {
|
|||||||
candidate.cost.output = 1.9;
|
candidate.cost.output = 1.9;
|
||||||
candidate.cost.cacheRead = 0.119;
|
candidate.cost.cacheRead = 0.119;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13980,9 +13980,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.6,
|
input: 0,
|
||||||
output: 2.2,
|
output: 0,
|
||||||
cacheRead: 0.11,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 131072,
|
contextWindow: 131072,
|
||||||
@@ -13998,9 +13998,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.2,
|
input: 0,
|
||||||
output: 1.1,
|
output: 0,
|
||||||
cacheRead: 0.03,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 131072,
|
contextWindow: 131072,
|
||||||
@@ -14034,8 +14034,8 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.6,
|
input: 0,
|
||||||
output: 1.8,
|
output: 0,
|
||||||
cacheRead: 0,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
@@ -14052,9 +14052,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.6,
|
input: 0,
|
||||||
output: 2.2,
|
output: 0,
|
||||||
cacheRead: 0.11,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 204800,
|
contextWindow: 204800,
|
||||||
@@ -14070,8 +14070,8 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.3,
|
input: 0,
|
||||||
output: 0.9,
|
output: 0,
|
||||||
cacheRead: 0,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
@@ -14088,9 +14088,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.6,
|
input: 0,
|
||||||
output: 2.2,
|
output: 0,
|
||||||
cacheRead: 0.11,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 204800,
|
contextWindow: 204800,
|
||||||
@@ -14142,9 +14142,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 1,
|
input: 0,
|
||||||
output: 3.2,
|
output: 0,
|
||||||
cacheRead: 0.2,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 204800,
|
contextWindow: 204800,
|
||||||
@@ -14160,9 +14160,27 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 1.2,
|
input: 0,
|
||||||
output: 4,
|
output: 0,
|
||||||
cacheRead: 0.24,
|
cacheRead: 0,
|
||||||
|
cacheWrite: 0,
|
||||||
|
},
|
||||||
|
contextWindow: 200000,
|
||||||
|
maxTokens: 131072,
|
||||||
|
} satisfies Model<"openai-completions">,
|
||||||
|
"glm-5.1": {
|
||||||
|
id: "glm-5.1",
|
||||||
|
name: "GLM-5.1",
|
||||||
|
api: "openai-completions",
|
||||||
|
provider: "zai",
|
||||||
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
||||||
|
compat: {"supportsDeveloperRole":false,"thinkingFormat":"zai"},
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text"],
|
||||||
|
cost: {
|
||||||
|
input: 0,
|
||||||
|
output: 0,
|
||||||
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 200000,
|
contextWindow: 200000,
|
||||||
|
|||||||
Reference in New Issue
Block a user