diff --git a/src/libs/agent-runtime/huggingface/index.ts b/src/libs/agent-runtime/huggingface/index.ts index b31a12b1af276..dab9dafbe7f40 100644 --- a/src/libs/agent-runtime/huggingface/index.ts +++ b/src/libs/agent-runtime/huggingface/index.ts @@ -23,7 +23,9 @@ export const LobeHuggingFaceAI = LobeOpenAICompatibleFactory({ createChatCompletionStream: (client: HfInference, payload, instance) => { const { max_tokens = 4096} = payload; const hfRes = client.chatCompletionStream({ - endpointUrl: instance.baseURL, + endpointUrl: instance.baseURL + ? new URL(payload.model, instance.baseURL).toString() + : instance.baseURL, max_tokens: max_tokens, messages: payload.messages, model: payload.model,