Skip to content

Support "Auto" model mode (Smart Model Selection) similar to VS Code #1517

@pxwg

Description

@pxwg

The latest Copilot Chat in VS Code extension has an update for the auto model selection feature. Its behavior can be simply summarized as:

  • First, the user selects the "Auto" model from the model list
  • The Copilot extension sends a POST request to the /models/session endpoint, which returns fields such as available_models, selected_model, etc. Among these, the selected_model field is an output based on intelligent model selection using current discount information, traffic, etc. (As of Commit 7c4e32b, the architecture based on context and routing APIs is still experimental and subject to change.)
  • Next, the extension constructs the completion request based on the output of the intelligent model selection to complete the upload of the chat history.

You can refer to the following image for understanding (note: the screenshot was taken using Visual Studio Code Insider edition along with the Copilot extension built from the latest version, which may differ from the interface of the stable release)
Image

To update this plugin by adding auto model selection functionality, I envision that we could achieve this by:

  • Reusing the $ prefix and adding $auto to the model selection (it can also be set in the config via model = "auto")
  • When selecting the auto model, we construct a simulated request to mimic the above request and obtain the routed model's response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions