@@ -151,11 +151,12 @@ async function dispatch(opts: AdapterProps, body: any) {
151151 case 'llamacpp' :
152152 case 'vllm' : {
153153 body . messages = opts . imageData ? opts . messages : undefined
154- const url = opts . gen . thirdPartyUrlNoSuffix
155- ? baseURL
156- : body . messages
157- ? `${ baseURL } /v1/chat/completions`
158- : `${ baseURL } /v1/completions`
154+ const url =
155+ ! opts . gen . providerId && opts . gen . thirdPartyUrlNoSuffix
156+ ? baseURL
157+ : body . messages
158+ ? `${ baseURL } /v1/chat/completions`
159+ : `${ baseURL } /v1/completions`
159160 return opts . gen . streamResponse
160161 ? streamGenerator ( { ...base , url, format : opts . gen . thirdPartyFormat } )
161162 : fullCompletion ( { ...base , url, service : opts . gen . thirdPartyFormat } )
@@ -229,12 +230,13 @@ async function dispatch(opts: AdapterProps, body: any) {
229230 body . messages = opts . messages
230231 }
231232 const url = getOaiCompatibleUrl ( opts . gen , true )
232- const fullUrl = opts . gen . thirdPartyUrlNoSuffix
233- ? url . url
234- : joinUrl (
235- url . url ,
236- opts . gen . thirdPartyFormat === 'openai' ? 'completions' : 'chat/completions'
237- )
233+ const fullUrl =
234+ ! opts . gen . providerId && opts . gen . thirdPartyUrlNoSuffix
235+ ? url . url
236+ : joinUrl (
237+ url . url ,
238+ opts . gen . thirdPartyFormat === 'openai' ? 'completions' : 'chat/completions'
239+ )
238240
239241 return opts . gen . streamResponse
240242 ? streamGenerator ( { ...base , url : fullUrl , format : opts . gen . thirdPartyFormat } )
0 commit comments