From 02908229ad95b4667fed421b3215dbc10ec787c3 Mon Sep 17 00:00:00 2001 From: "nghi.vo" Date: Thu, 6 Mar 2025 03:03:20 +0700 Subject: [PATCH] Fix vllm setup, json.data is an array and is accessed as such. Also add autodetect behaviour in case multiple model deployement is supported in the future --- core/llm/llms/Vllm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/llm/llms/Vllm.ts b/core/llm/llms/Vllm.ts index c9308d771..7273a67f6 100644 --- a/core/llm/llms/Vllm.ts +++ b/core/llm/llms/Vllm.ts @@ -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); });