Merge pull request #4497 from NghiVo21/fix-vllm-setup

Fix vllm setup, json.data is an array and is accessed as such. Also a…
This commit is contained in:
Nate Sesti 2025-03-16 12:54:01 -07:00 • committed by GitHub
commit 338ba83aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,10 @@ class Vllm extends OpenAI {
static providerName = "vllm";
constructor(options: LLMOptions) {
super(options);
this._setupCompletionOptions();
if (options.model === "AUTODETECT") {
this._setupCompletionOptions();
}
}
private _setupCompletionOptions() {
@ -22,7 +25,7 @@ class Vllm extends OpenAI {
return;
}
const json = await response.json();
const data = json.data;
const data = json.data[0];
this.model = data.id;
this.contextLength = Number.parseInt(data.max_model_len);
});