File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ export abstract class BaseLLM implements ILLM {
213213 this . providerName === "continue-proxy"
214214 ? this . model ?. split ( "/" ) . pop ( ) || this . model
215215 : this . model ;
216- const llmInfo = findLlmInfo ( modelSearchString ) ;
216+ const llmInfo = findLlmInfo ( modelSearchString , this . underlyingProviderName ) ;
217217
218218 const templateType =
219219 options . template ?? autodetectTemplateType ( options . model ) ;
Original file line number Diff line number Diff line change @@ -31,7 +31,19 @@ export const allLlms: LlmInfo[] = allModelProviders.flatMap((provider) =>
3131 provider . models . map ( ( model ) => ( { ...model , provider : provider . id } ) ) ,
3232) ;
3333
34- export function findLlmInfo ( model : string ) : LlmInfo | undefined {
34+ export function findLlmInfo (
35+ model : string ,
36+ preferProviderId ?: string ,
37+ ) : LlmInfo | undefined {
38+ if ( preferProviderId ) {
39+ const provider = allModelProviders . find ( ( p ) => p . id === preferProviderId ) ;
40+ const info = provider ?. models . find ( ( llm ) =>
41+ llm . regex ? llm . regex . test ( model ) : llm . model === model ,
42+ ) ;
43+ if ( info ) {
44+ return info ;
45+ }
46+ }
3547 return allLlms . find ( ( llm ) =>
3648 llm . regex ? llm . regex . test ( model ) : llm . model === model ,
3749 ) ;
You can’t perform that action at this time.
0 commit comments