Skip to content

Commit 338ba83

Browse files
authored
Merge pull request #4497 from NghiVo21/fix-vllm-setup
Fix vllm setup, json.data is an array and is accessed as such. Also a…
2 parents 6aab2c8 + 0290822 commit 338ba83

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/llm/llms/Vllm.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ class Vllm extends OpenAI {
66
static providerName = "vllm";
77
constructor(options: LLMOptions) {
88
super(options);
9-
this._setupCompletionOptions();
9+
10+
if (options.model === "AUTODETECT") {
11+
this._setupCompletionOptions();
12+
}
1013
}
1114

1215
private _setupCompletionOptions() {
@@ -22,7 +25,7 @@ class Vllm extends OpenAI {
2225
return;
2326
}
2427
const json = await response.json();
25-
const data = json.data;
28+
const data = json.data[0];
2629
this.model = data.id;
2730
this.contextLength = Number.parseInt(data.max_model_len);
2831
});

0 commit comments

Comments
 (0)