Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,6 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
modelTooltip = getModelCapabilitiesDescription(endpoint);
}

let modelCategory: { label: string; order: number } | undefined;
if (endpoint instanceof AutoChatEndpoint) {
modelCategory = { label: '', order: Number.MIN_SAFE_INTEGER };
} else if (endpoint.isPremium === undefined || this._authenticationService.copilotToken?.isFreeUser) {
modelCategory = { label: vscode.l10n.t("Copilot Models"), order: 0 };
} else if (endpoint.isPremium) {
modelCategory = { label: vscode.l10n.t("Premium Models"), order: 1 };
} else {
modelCategory = { label: vscode.l10n.t("Standard Models"), order: 0 };
}

// Counting tokens requires instantiating the tokenizers, which makes this process use a lot of memory.
// Let's cache the results across extension activations
const baseCount = await this._promptBaseCountCache.getBaseCount(endpoint);
Expand All @@ -304,7 +293,6 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
const customModel = endpoint.customModel;
modelDetail = customModel.owner_name;
modelTooltip = vscode.l10n.t('{0} is contributed by {1} using {2}.', sanitizedModelName, customModel.owner_name, customModel.key_name);
modelCategory = { label: vscode.l10n.t("Custom Models"), order: 2 };
}

const session = this._authenticationService.anyGitHubSession;
Expand All @@ -322,7 +310,6 @@ export class LanguageModelAccess extends Disposable implements IExtensionContrib
multiplierNumeric: endpoint instanceof AutoChatEndpoint ? undefined : endpoint.multiplier,
priceCategory: endpoint instanceof AutoChatEndpoint ? undefined : endpoint.priceCategory,
detail: modelDetail,
category: modelCategory,
statusIcon: endpoint.degradationReason ? new vscode.ThemeIcon('warning') : undefined,
version: endpoint.version,
maxInputTokens: endpoint.modelMaxPromptTokens - baseCount - BaseTokensPerCompletion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function makeModel(identifier: string): ILanguageModelChatMetadataAndIdentifier
maxOutputTokens: 4096,
isDefaultForLocation: {},
isUserSelectable: true,
modelPickerCategory: undefined,
targetChatSessionType: 'agent-host-copilotcli',
},
};
Expand Down
2 changes: 0 additions & 2 deletions src/vs/workbench/api/common/extHostLanguageModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { createDecorator } from '../../../platform/instantiation/common/instanti
import { ILogService } from '../../../platform/log/common/log.js';
import { Progress } from '../../../platform/progress/common/progress.js';
import { IChatMessage, IChatResponsePart, ILanguageModelChatInfoOptions, ILanguageModelChatMetadata, ILanguageModelChatMetadataAndIdentifier, ILanguageModelChatRequestOptions } from '../../contrib/chat/common/languageModels.js';
import { DEFAULT_MODEL_PICKER_CATEGORY } from '../../contrib/chat/common/widget/input/modelPickerWidget.js';
import { INTERNAL_AUTH_PROVIDER_PREFIX } from '../../services/authentication/common/authentication.js';
import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js';
import { SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js';
Expand Down Expand Up @@ -235,7 +234,6 @@ export class ExtHostLanguageModels implements ExtHostLanguageModelsShape {
statusIcon: m.statusIcon,
targetChatSessionType: m.targetChatSessionType,
configurationSchema: m.configurationSchema as IJSONSchema | undefined,
modelPickerCategory: m.category ?? DEFAULT_MODEL_PICKER_CATEGORY,
capabilities: m.capabilities ? {
vision: m.capabilities.imageInput,
editTools: m.capabilities.editTools,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class AgentHostLanguageModelProvider extends Disposable implements ILangu
isUserSelectable: true,
pricing: multiplierNumeric !== undefined ? `${multiplierNumeric}x` : undefined,
multiplierNumeric,
modelPickerCategory: undefined,
targetChatSessionType: this._sessionType,
capabilities: {
vision: m.supportsVision ?? false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '.
import { ILogService } from '../../../../platform/log/common/log.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import { ILanguageModelChatMetadata, ILanguageModelsService } from '../common/languageModels.js';
import { DEFAULT_MODEL_PICKER_CATEGORY } from '../common/widget/input/modelPickerWidget.js';

const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);

Expand Down Expand Up @@ -100,16 +99,7 @@ export abstract class DefaultModelContribution extends Disposable {
return true;
});

supportedModels.sort((a, b) => {
const aCategory = a.metadata.modelPickerCategory ?? DEFAULT_MODEL_PICKER_CATEGORY;
const bCategory = b.metadata.modelPickerCategory ?? DEFAULT_MODEL_PICKER_CATEGORY;

if (aCategory.order !== bCategory.order) {
return aCategory.order - bCategory.order;
}

return a.metadata.name.localeCompare(b.metadata.name);
});
supportedModels.sort((a, b) => a.metadata.name.localeCompare(b.metadata.name));

for (const model of supportedModels) {
try {
Expand Down
1 change: 0 additions & 1 deletion src/vs/workbench/contrib/chat/common/languageModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export interface ILanguageModelChatMetadata {
readonly isDefaultForLocation: { [K in ChatAgentLocation]?: boolean };
readonly isUserSelectable?: boolean;
readonly statusIcon?: ThemeIcon;
readonly modelPickerCategory: { label: string; order: number } | undefined;
readonly auth?: {
readonly providerLabel: string;
readonly accountLabel?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { localize } from '../../../../../../nls.js';

export const DEFAULT_MODEL_PICKER_CATEGORY = { label: localize('chat.modelPicker.other', "Other Models"), order: Number.MAX_SAFE_INTEGER };
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'copilot',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Copilot', order: 1 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand All @@ -217,7 +216,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'copilot',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Copilot', order: 1 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand All @@ -238,7 +236,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'openai',
maxInputTokens: 4096,
maxOutputTokens: 2048,
modelPickerCategory: { label: 'OpenAI', order: 2 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand All @@ -259,7 +256,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'openai',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'OpenAI', order: 2 },
isUserSelectable: false,
capabilities: {
toolCalling: false,
Expand Down Expand Up @@ -552,7 +548,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'copilot',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Copilot', order: 1 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand All @@ -574,7 +569,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'copilot',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Copilot', order: 1 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand Down Expand Up @@ -658,7 +652,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'anthropic',
maxInputTokens: 100000,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Anthropic', order: 3 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand Down Expand Up @@ -687,7 +680,6 @@ suite('ChatModelsViewModel', () => {
vendor: 'azure',
maxInputTokens: 8192,
maxOutputTokens: 4096,
modelPickerCategory: { label: 'Azure', order: 4 },
isUserSelectable: true,
capabilities: {
toolCalling: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ suite('PromptHeaderAutocompletion', () => {
instaService.set(ILanguageModelToolsService, toolService);

const testModels: ILanguageModelChatMetadata[] = [
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'gpt-4', name: 'GPT 4', vendor: 'openai', version: '1.0', family: 'gpt', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: false, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'bg-agent-model', name: 'BG Agent Model', vendor: 'copilot', version: '1.0', family: 'bg', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true }, targetChatSessionType: 'background' } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'gpt-4', name: 'GPT 4', vendor: 'openai', version: '1.0', family: 'gpt', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: false, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'bg-agent-model', name: 'BG Agent Model', vendor: 'copilot', version: '1.0', family: 'bg', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true }, targetChatSessionType: 'background' } satisfies ILanguageModelChatMetadata,
];

instaService.stub(ILanguageModelsService, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ suite('PromptHoverProvider', () => {
instaService.set(ILanguageModelToolsService, toolService);

const testModels: ILanguageModelChatMetadata[] = [
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
// Claude model equivalents
{ id: 'claude-sonnet-4.5', name: 'Claude Sonnet 4.5', vendor: 'copilot', version: '1.0', family: 'claude', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
{ id: 'claude-opus-4.6', name: 'Claude Opus 4.6', vendor: 'copilot', version: '1.0', family: 'claude', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
{ id: 'claude-haiku-4.5', name: 'Claude Haiku 4.5', vendor: 'copilot', version: '1.0', family: 'claude', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
{ id: 'claude-sonnet-4.5', name: 'Claude Sonnet 4.5', vendor: 'copilot', version: '1.0', family: 'claude', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
{ id: 'claude-opus-4.6', name: 'Claude Opus 4.6', vendor: 'copilot', version: '1.0', family: 'claude', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
{ id: 'claude-haiku-4.5', name: 'Claude Haiku 4.5', vendor: 'copilot', version: '1.0', family: 'claude', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 200000, maxOutputTokens: 8192, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: {} } satisfies ILanguageModelChatMetadata,
];

instaService.stub(ILanguageModelsService, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ suite('PromptValidator', () => {
instaService.set(ILanguageModelToolsService, toolService);

const testModels: ILanguageModelChatMetadata[] = [
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-3.5-turbo', name: 'MAE 3.5 Turbo', vendor: 'copilot', version: '1.0', family: 'mae', modelPickerCategory: undefined, extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata
{ id: 'mae-4', name: 'MAE 4', vendor: 'olama', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-4.1', name: 'MAE 4.1', vendor: 'copilot', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, capabilities: { agentMode: true, toolCalling: true }, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata,
{ id: 'mae-3.5-turbo', name: 'MAE 3.5 Turbo', vendor: 'copilot', version: '1.0', family: 'mae', extension: new ExtensionIdentifier('a.b'), isUserSelectable: true, maxInputTokens: 8192, maxOutputTokens: 1024, isDefaultForLocation: { [ChatAgentLocation.Chat]: true } } satisfies ILanguageModelChatMetadata
];

instaService.stub(ILanguageModelsService, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function createModel(id: string, name: string, vendor = 'copilot'): ILanguageMod
maxInputTokens: 128000,
maxOutputTokens: 4096,
isDefaultForLocation: {},
modelPickerCategory: undefined,
} as ILanguageModelChatMetadata,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function createModel(
maxOutputTokens: 4096,
isDefaultForLocation: {},
isUserSelectable: true,
modelPickerCategory: undefined,
capabilities: { toolCalling: true, agentMode: true },
...overrides,
} as ILanguageModelChatMetadata,
Expand Down
Loading
Loading