feat(model-service): encode outlets and normalize provider HTTP requests · ModelEngine-Group/nexent@0aed87f · GitHub
Skip to content

Commit 0aed87f

Browse files
committed
feat(model-service): encode outlets and normalize provider HTTP requests
1 parent a97cf9b commit 0aed87f

24 files changed

Lines changed: 4760 additions & 0 deletions

‎frontend/lib/modelProfileLimits.ts‎

Lines changed: 25 additions & 0 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. All rights reserved.
2+
3+
import { describe, expect, it } from "vitest";
4+
import { profileOutputLimit } from "../../lib/modelProfileLimits";
5+
6+
describe("profile output cap display", () => {
7+
it("uses a known cap within the effective context window", () => {
8+
expect(
9+
profileOutputLimit({ output_limit: 384000, combined_window: 1000000 })
10+
).toBe(384000);
11+
expect(
12+
profileOutputLimit(
13+
{ output_limit: 384000, combined_window: 1000000 },
14+
200000
15+
)
16+
).toBe(200000);
17+
});
18+
it("leaves unknown or invalid caps empty", () => {
19+
for (const context of [
20+
undefined,
21+
null,
22+
{},
23+
{ output_limit: 0 },
24+
{ output_limit: -1 },
25+
{ output_limit: "8192" },
26+
{ output_limit: NaN },
27+
]) {
28+
expect(profileOutputLimit(context)).toBeUndefined();
29+
}
30+
});
31+
});
Lines changed: 307 additions & 0 deletions

0 commit comments

Comments
 (0)