Skip to content

Conversation

@doums
Copy link

@doums doums commented Jan 26, 2026

Hi, currently it's not possible to get what is the current model in-use (which is quite opaque). This PR add new commands to get/set/select the model at runtime and view the available model(s).
For now, there is only one model available which is GPT-4.1 Copilot.

Catches up with what has been done in copilot.vim side github/copilot.vim#139 (comment)

Summary

Add a new :Copilot model command that allows users to view and switch between available Copilot completion models at runtime.

Changes

  • New model subcommand with the following actions:
    • select - Interactive model picker using vim.ui.select*
    • list - Display all available completion models
    • get - Show the currently active model
    • set <model-id> - Set a specific model by ID
  • Runtime model override - Selected model is applied immediately without requiring a restart, by notifying the LSP server of configuration changes
  • Model validation on startup - If a copilot_model is configured, it's validated against available models and a warning is shown if invalid
  • API addition - New copilot/models request to fetch available models from the Copilot server

For select if there is only one available model (mostly the case) and the current in-use does not match, it is automatically selected.

Files Changed

File Description
lua/copilot/model.lua New module handling model selection, listing, and validation
lua/copilot/api/init.lua Added get_models API function
lua/copilot/client/config.lua Validate configured model on client startup
lua/copilot/client/utils.lua Use model module for getting current model (supports runtime override)
plugin/copilot.lua Register model command with completions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant