mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(volcengine-ark): clamp GLM-5 max_tokens to model output ceiling (#2428)
Ark rejects max_tokens above 128000 for GLM-5.2. Add a config-driven STRIP_RULES entry that clamps max_tokens, max_completion_tokens and max_output_tokens down to the model maxOutput before the upstream call. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
8c068a1f5c
commit
bbae990b92
@@ -28,4 +28,28 @@ describe("stripUnsupportedParams", () => {
|
||||
|
||||
expect(body).toEqual({ top_p: 1 });
|
||||
});
|
||||
|
||||
it("clamps VolcEngine Ark GLM max token fields to the model output ceiling", () => {
|
||||
const body = {
|
||||
max_tokens: 131072,
|
||||
max_completion_tokens: 131072,
|
||||
max_output_tokens: 131072,
|
||||
};
|
||||
|
||||
stripUnsupportedParams("volcengine-ark", "GLM-5.2", body);
|
||||
|
||||
expect(body).toEqual({
|
||||
max_tokens: 128000,
|
||||
max_completion_tokens: 128000,
|
||||
max_output_tokens: 128000,
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps VolcEngine Ark GLM max tokens when already under the ceiling", () => {
|
||||
const body = { max_tokens: 64000 };
|
||||
|
||||
stripUnsupportedParams("volcengine-ark", "GLM-5.2", body);
|
||||
|
||||
expect(body.max_tokens).toBe(64000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user