Skip to content

Commit 05b32ea

Browse files
authored
fix(core): accept null context length from LM Studio models (anomalyco#63198)
1 parent c4bf172 commit 05b32ea

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/core/src/plugin/provider/lmstudio.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const RemoteModel = Schema.Struct({
1111
config: Schema.Struct({ context_length: Schema.Int }),
1212
}),
1313
),
14-
max_context_length: Schema.Int,
14+
// Null for decision models whose context is unknown.
15+
max_context_length: Schema.NullOr(Schema.Int),
1516
capabilities: Schema.Struct({
1617
vision: Schema.Boolean,
1718
trained_for_tool_use: Schema.Boolean,

‎packages/core/test/plugin/provider-lmstudio.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe("LMStudioPlugin", () => {
7474
key: "clef-flash",
7575
display_name: "Clef Flash",
7676
loaded_instances: [],
77-
max_context_length: 262_144,
77+
max_context_length: null,
7878
},
7979
],
8080
}),

0 commit comments

Comments
 (0)