Skip to content

Commit f51be21

Browse files
Kevin Whitedaniel-lxs
authored andcommitted
Use URL constructor for joining baseUrl and path in litellm.ts
1 parent 8aaf020 commit f51be21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/providers/fetchers/litellm.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ export async function getLiteLLMModels(apiKey: string, baseUrl: string): Promise
2121
if (apiKey) {
2222
headers["Authorization"] = `Bearer ${apiKey}`
2323
}
24+
// Use URL constructor to properly join base URL and path
25+
const url = new URL("/v1/model/info", baseUrl).href
2426
// Added timeout to prevent indefinite hanging
25-
const response = await axios.get(`${baseUrl}/v1/model/info`, { headers, timeout: 5000 })
27+
const response = await axios.get(url, { headers, timeout: 5000 })
2628
const models: ModelRecord = {}
2729

2830
const computerModels = Array.from(LITELLM_COMPUTER_USE_MODELS)

0 commit comments

Comments
 (0)