@@ -14,6 +14,7 @@ import { getTextPart } from '../../../platform/chat/common/globalStringUtils';
1414import { EmbeddingType , getWellKnownEmbeddingTypeInfo , IEmbeddingsComputer } from '../../../platform/embeddings/common/embeddingsComputer' ;
1515import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider' ;
1616import { CustomDataPartMimeTypes } from '../../../platform/endpoint/common/endpointTypes' ;
17+ import { ModelAliasRegistry } from '../../../platform/endpoint/common/modelAliasRegistry' ;
1718import { encodeStatefulMarker } from '../../../platform/endpoint/common/statefulMarkerContainer' ;
1819import { AutoChatEndpoint } from '../../../platform/endpoint/node/autoChatEndpoint' ;
1920import { IAutomodeService } from '../../../platform/endpoint/node/automodeService' ;
@@ -201,6 +202,17 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
201202 } ;
202203
203204 models . push ( model ) ;
205+
206+ // Register aliases for this model
207+ const aliases = ModelAliasRegistry . getAliases ( model . id ) ;
208+ for ( const alias of aliases ) {
209+ models . push ( {
210+ ...model ,
211+ id : alias ,
212+ family : alias ,
213+ isUserSelectable : false ,
214+ } ) ;
215+ }
204216 }
205217
206218 this . _currentModels = models ;
@@ -215,7 +227,7 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
215227 progress : vscode . Progress < vscode . LanguageModelResponsePart2 > ,
216228 token : vscode . CancellationToken
217229 ) : Promise < any > {
218- const endpoint = this . _chatEndpoints . find ( e => e . model === model . id ) ;
230+ const endpoint = this . _chatEndpoints . find ( e => e . model === ModelAliasRegistry . resolveAlias ( model . id ) ) ;
219231 if ( ! endpoint ) {
220232 throw new Error ( `Endpoint not found for model ${ model . id } ` ) ;
221233 }
@@ -231,7 +243,7 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
231243 text : string | vscode . LanguageModelChatMessage | vscode . LanguageModelChatMessage2 ,
232244 token : vscode . CancellationToken
233245 ) : Promise < number > {
234- const endpoint = this . _chatEndpoints . find ( e => e . model === model . id ) ;
246+ const endpoint = this . _chatEndpoints . find ( e => e . model === ModelAliasRegistry . resolveAlias ( model . id ) ) ;
235247 if ( ! endpoint ) {
236248 throw new Error ( `Endpoint not found for model ${ model . id } ` ) ;
237249 }
0 commit comments