avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

feature: Switch between models in one single provider

Open szcharlesji opened this issue 8 months ago • 16 comments

Feature request

I'm using Copilot, and I want to switch between different models like claude-3.7-sonnet and 4o. Also, is there a way to discover available models for Copilot?

Motivation

No response

Other

No response

szcharlesji avatar Mar 11 '25 16:03 szcharlesji

Don't think this is available in Avante. CopilotChat.nvim allows you to select a copilot model to chat with. Here's what's available, assuming you enabled claude and gemini:

Image

v3ceban avatar Mar 11 '25 18:03 v3ceban

@v3ceban Thanks, that's all I need

szcharlesji avatar Mar 11 '25 22:03 szcharlesji

Just do it this way:

Image

yetone avatar Mar 12 '25 08:03 yetone

Thanks @yetone 3.7 sonnet thinking and gemini is not working for me, is the model symbol wrong? Also is there any way to disable the models showing in the avante: select models? I just want to see the list of models I set.

vendors = {
            -- Available
            copilot_claude = {
                __inherited_from = "copilot",
                model = "claude-3.7-sonnet",
            },
            -- Unavailable
            copilot_claude_thinking = {
                __inherited_from = "copilot",
                model = "claude-3.7-sonnet-thought",
            },
            -- Available
            copilot_o1 = {
                __inherited_from = "copilot",
                model = "o1",
            },
            -- Available
            copilot_o3_mini = {
                __inherited_from = "copilot",
                model = "o3-mini",
            },
            -- Unavailable
            copilot_gemini = {
                __inherited_from = "copilot",
                model = "gemini-2.0-flash-100",
            },
        }
summarize failed: "API request failed with status 400. Body: '{\"error\":{\"message\":\"The requested model is not supported.\",\"p
aram\":\"model\",\"code\":\"model_not_supported\",\"type\":\"invalid_request_error\"}}'"

szcharlesji avatar Mar 12 '25 13:03 szcharlesji

@szcharlesji https://x.com/yetone/status/1894264887570051172

yetone avatar Mar 12 '25 17:03 yetone

Additionally, I noticed you have a typo:

-  model = "gemini-2.0-flash-100",
+  model = "gemini-2.0-flash-001",

This is my profile:

Image

yetone avatar Mar 12 '25 17:03 yetone

You can use hide_in_model_selector to hide certain models, for example:

openai = {
    hide_in_model_selector = true,
},
vendors = {
    copilot_claude = {
        __inherited_from = 'copilot',
        model = 'claude-3.7-sonnet',
        hide_in_model_selector = true,
    },
},

yetone avatar Mar 12 '25 17:03 yetone

Thanks @yetone those are fixed. Just updated avante but I can't figure out how to hide claude-opus and haiku, and gpt 4o mini. All the other ones are hidden properly

Image

szcharlesji avatar Mar 12 '25 18:03 szcharlesji

@szcharlesji how did you set model selector to work with telescope?

v3ceban avatar Mar 12 '25 18:03 v3ceban

@szcharlesji how did you set model selector to work with telescope?

It was the default keymap <leader>a?, and I think you can use it with the optional dependency here:

Image

szcharlesji avatar Mar 12 '25 18:03 szcharlesji

@szcharlesji how did you set model selector to work with telescope?

It was the default keymap <leader>a?, and I think you can use it with the optional dependency here: Image

It turns to be stevearc/dressing.nvim dep that I removed because I din't like its input behavior and was too lazy to check the docs on how to disable it. Installing it replaces default vim ui select with something that uses telescope by default and input with a floating box that I now disabled. Thanks for pointing me to some direction :)

And thanks @yetone and all the contributors, this plugin is great and I'm super grateful for all your hard work. Sry for off-topic :) Cheers!

v3ceban avatar Mar 12 '25 19:03 v3ceban

Thanks @yetone those are fixed. Just updated avante but I can't figure out how to hide claude-opus and haiku, and gpt 4o mini. All the other ones are hidden properly Image

This seem to do the trick

-- other providers
["claude-opus"] = {
  hide_in_model_selector = true,
},
["openai-gpt-4o-mini"] = {
  hide_in_model_selector = true,
},

v3ceban avatar Mar 12 '25 19:03 v3ceban

Thanks @yetone those are fixed. Just updated avante but I can't figure out how to hide claude-opus and haiku, and gpt 4o mini. All the other ones are hidden properly Image

This seem to do the trick

-- other providers ["claude-opus"] = { hide_in_model_selector = true, }, ["openai-gpt-4o-mini"] = { hide_in_model_selector = true, },

Thanks, that's working for me

szcharlesji avatar Mar 12 '25 19:03 szcharlesji

Is there an updated list of endpoint names?

szcharlesji avatar Apr 21 '25 02:04 szcharlesji

Hey, how do I know the model references you using? Can't find it on GitHub page

BitInByte avatar Apr 27 '25 14:04 BitInByte

This is the list of the latest copilot models. @BitInByte

https://github.com/szcharlesji/nvim-config/blob/main/lua/cheng/plugins/avante.lua#L47-L47

szcharlesji avatar Apr 27 '25 19:04 szcharlesji

@szcharlesji I think this is fixed by https://github.com/yetone/avante.nvim/pull/2106

80avin avatar Jun 03 '25 18:06 80avin

I think this is fixed by #2106

If I understand the implementation correctly, it makes all models from a provider share the same configuration?

I think it should allow config per model, not provider-wide.

cometkim avatar Jun 04 '25 05:06 cometkim

@80avin thanks, all the models are shown right now. really appreciate it.

szcharlesji avatar Jun 04 '25 19:06 szcharlesji

I have a minimal setup like this: avante.lua and I only want to use Copilot

@yetone Somehow I'm still seeing providers I did not setup. There used to be the hide_in_model_selector option for providers and I think it has been removed. Also the extra models I'm getting right now are not a complete list either. I'm not sure if this is a bug (as in there is no way there is this ollama gpt-4o model) or due to my setup.

Image

szcharlesji avatar Jun 04 '25 19:06 szcharlesji

@szcharlesji yeah, that's the default behavior now. Here's how I fixed it:

opts = {
  -- your avante config
  providers = {
    ["copilot/claude-4"] = {
      __inherited_from = "copilot",
      model = "claude-sonnet-4",
      display_name = "copilot/claude-4",
     -- more opts
    },
    -- more providers
  },
  -- rest of the config
}

-- add/remove models you want to hide
local hidden_models = {
  "copilot",
  "gemini",
  "openai",
  "openai-gpt-4o-mini",
  "vertex",
  "vertex_claude",
  "ollama",
}

-- hiding "copilot" model below will now hide
-- EVERY "copilot" model, not just default provider
-- as it used to do before #2106
-- this sets all manually configured providers to be "unhiden"
for _, provider in pairs(opts.providers) do
  provider.hide_in_model_selector = false
end

-- hides everything in hidden_models
for _, model in ipairs(hidden_models) do
  opts.providers[model] = { hide_in_model_selector = true }
end

return opts

@cometkim I think this also allows configuring params for each individual model

Kinda defeats the purpose of #2106, though.

v3ceban avatar Jun 04 '25 21:06 v3ceban

in the screenshot of https://github.com/yetone/avante.nvim/pull/2106 by @80avin , there's also ollama/gpt-4o which is definitely a bug. Also, we shouldn't see the providers we didn't setup in the first place.

szcharlesji avatar Jun 05 '25 15:06 szcharlesji

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 06 '25 02:07 github-actions[bot]

in the screenshot of #2106 by @80avin , there's also ollama/gpt-4o which is definitely a bug. Also, we shouldn't see the providers we didn't setup in the first place.

@szcharlesji I doubt if that was some misconfiguration from my side or a bug. In any case, it is not present now.

80avin avatar Jul 06 '25 08:07 80avin

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 25 '25 02:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 02 '25 02:09 github-actions[bot]