Fix vLLM vector embeddings URL construction to preserve custom API path prefixes (#5350) * Initial plan * fix: use trimV1 and url-join for vLLM vector embeddings URL construction Fixes URL path construction in vllm-vectors.js to preserve custom API path prefixes (e.g. /compatible-mode/v1). Previously url.pathname assignment would overwrite the entire path, stripping any prefix. Now uses the same trimV1 + urlJoin pattern as llamacpp-vectors.js. Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/f708dd66-8961-4c23-8b8b-3ab868bf676a * Revert package-lock --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

319c647e13debb0012d5eb4b0bc2add79d4c6468

Copilot <198982749+Copilot@users.noreply.github.com>

Signed
1 files changed, +3 -2Showing whitespace changes
src/vectors/vllm-vectors.js+3 -2
@@ -1,6 +1,8 @@
11import fetch from 'node-fetch';
2+import urlJoin from 'url-join';
23import { setAdditionalHeadersByType } from '../additional-headers.js';
34import { TEXTGEN_TYPES } from '../constants.js';
5+import { trimV1 } from '../util.js';
46
57/**
68 * Gets the vector for the given text from VLLM
@@ -11,8 +13,7 @@ import { TEXTGEN_TYPES } from '../constants.js';
1113 * @returns {Promise<number[][]>} - The array of vectors for the texts
1214 */
1315export async function getVllmBatchVector(texts, apiUrl, model, directories) {
1416 const url = new URL(urlJoin(trimV1(apiUrl), '/v1/embeddings'));
15- url.pathname = '/v1/embeddings';
1617
1718 const headers = {};
1819 setAdditionalHeadersByType(headers, TEXTGEN_TYPES.VLLM, apiUrl, directories);