fix(ai): keep Baseten GLM-5.2 text-only (#8293)

This commit is contained in:
Panoplos 2026-09-03 11:10:33 +02:00 • committed by GitHub
parent 1d6dbf9e3d
commit 22940a62f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -1344,6 +1344,8 @@ function processBasetenModels(provider: ModelsDevProvider | undefined): Model<Ap
: supportsToggle
? toggleThinkingLevelMap
: getEffortThinkingLevelMap(reasoningOptions);
// Baseten's GLM-5.2 endpoints are text-only despite models.dev reporting image input.
const supportsImageInput = !isGlm52 && model.modalities?.input?.includes("image");
models.push({
id: modelId,
@ -1353,7 +1355,7 @@ function processBasetenModels(provider: ModelsDevProvider | undefined): Model<Ap
baseUrl,
reasoning,
...(thinkingLevelMap ? { thinkingLevelMap } : {}),
input: model.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
input: supportsImageInput ? ["text", "image"] : ["text"],
cost: {
input: model.cost?.input || 0,
output: model.cost?.output || 0,

View file

@ -54,6 +54,11 @@ describe("Baseten models", () => {
});
});
it("keeps both GLM 5.2 endpoints text-only", () => {
expect(getModel("baseten", "zai-org/GLM-5.2").input).toEqual(["text"]);
expect(getModel("baseten", "zai-org/GLM-5.2-Fast").input).toEqual(["text"]);
});
it("models Kimi K2.6 reasoning as an explicit off/on toggle", async () => {
const model = getModel("baseten", "moonshotai/Kimi-K2.6");
let payload: Record<string, unknown> | undefined;