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

feature: I want to use Gemini 2.5 pro

Open Amnaun opened this issue 8 months ago • 14 comments

Feature request

Can I use the Avante with Gemini? what I should change in endpoint and change in my $PATH,now I use Deepseek,but I want to try Gemini

Motivation

No response

Other

No response

Amnaun avatar Apr 10 '25 18:04 Amnaun

You just need add the model in your config and

opts = {
		provider = "gemini",
		gemini = {
			model = "gemini-2.5-pro-exp-03-25",
		},
	},

and you need to add GEMINI_API_KEY env variable in your terminal session

mikailbayram avatar Apr 11 '25 07:04 mikailbayram

OK,I will try ,and thank you for your help

Amnaun avatar Apr 11 '25 08:04 Amnaun

You just need add the model in your config and

opts = {
		provider = "gemini",
		gemini = {
			model = "gemini-2.5-pro-exp-03-25",
		},
	},

and you need to add GEMINI_API_KEY env variable in your terminal session

I want to ask an other question. What end point should I use? Is

https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-exp-03-25t:generateContent?key=MY_API_KEY

or others ?

Amnaun avatar Apr 11 '25 08:04 Amnaun

You don't need to define a custom endpoint, there's already a default in the gemini provider config:

https://github.com/yetone/avante.nvim/blob/e295fe82f0714188615a524604bdaccd266ced35/lua/avante/config.lua#L260-L267

So, with the GEMINI_API_KEY in your env and model set to a valid gemini model, you should be set.

Can close this issue.

jpmcb avatar Apr 12 '25 15:04 jpmcb

A few days ago, my Avante plugin was working fine with Gemini, but now for some reason, when I call this plugin, it automatically connects to DeepSeek instead of my Gemini, why is that?

Image

Amnaun avatar Apr 15 '25 11:04 Amnaun

Does anyone get good use of Gemini? I'm trying to use because I keep running into overload issues with Claude, but it's barely working. It doesn't know how to run commands, search for files, etc.. So it's pretty useless.

gmenih avatar Apr 16 '25 13:04 gmenih

Yes, I use Gemini and it works well for me. I use these models:

  • gemini-2.0-pro-exp-02-05 (works great but is a bit slower than the 'flash' versions)
  • gemini-2.0-flash (a bit less powefull than the pro but faster) and since this morning I use
  • gemini-2.5-flash-preview-04-17 (seems very good and fast so far...) (and all that for free)

Jufralice avatar Apr 18 '25 10:04 Jufralice

Does anyone make tools worked with gemini-2.5? in my case, when the prompt i input need the model to use tools, it will output the tool it needs to call and then stopped.

Image

isvicy avatar Apr 21 '25 08:04 isvicy

A few days ago, my Avante plugin was working fine with Gemini, but now for some reason, when I call this plugin, it automatically connects to DeepSeek instead of my Gemini, why is that?

Image

you can use Lazy reload avante.nvim to reload the plugin

Abizrh avatar Apr 21 '25 10:04 Abizrh

Does anyone make tools worked with gemini-2.5

The pro models work great. The flash ones may not always use tools: cheaper but your mileage may vary.


This issue can be closed: the Gemini models work

jpmcb avatar Apr 23 '25 02:04 jpmcb

It's not working for me at all. It doesn't seem to be aware of any tools at all, it always asks me to add more context.

gmenih avatar Apr 23 '25 10:04 gmenih

I am getting an invalid api key error when I have GEMINI_API_KEY set in my env and the following configuration. Am I doing something wrong here?

      gemini = {
        api_key_name = "GEMINI_API_KEY",
        model = "gemini-2.5-pro-preview-03-25",             -- your desired model (or use gpt-4o, etc.)
        timeout = 30000,              -- Timeout in milliseconds, increase this for reasoning models
        temperature = 0,
        max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
        --reasoning_effort = "medium", -- low|medium|high, only used for reasoning models
      },

disregard I figured out my issue.

tylerthehaas avatar Apr 27 '25 00:04 tylerthehaas

I am getting an invalid api key error when I have GEMINI_API_KEY set in my env and the following configuration. Am I doing something wrong here?

      gemini = {
        api_key_name = "GEMINI_API_KEY",
        model = "gemini-2.5-pro-preview-03-25",             -- your desired model (or use gpt-4o, etc.)
        timeout = 30000,              -- Timeout in milliseconds, increase this for reasoning models
        temperature = 0,
        max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
        --reasoning_effort = "medium", -- low|medium|high, only used for reasoning models
      },

disregard I figured out my issue.

opts = {
  -- Gemini 2.5 flash
  provider = "gemini",
  gemini = {
    endpoint = "https://generativelanguage.googleapis.com/v1beta/models",
    model = "gemini-2.5-pro-preview-03-25"
    timeout = 30000, -- Timeout in milliseconds
    temperature = 0,
    max_tokens = 8192,
  },
},

Actually you only need to send the provider. for the api key you have to enter it in each terminal session

export GEMINI_API_KEY=your-api-key

just paste in your terminal

Abizrh avatar Apr 28 '25 09:04 Abizrh

Gemini has this problem where it will try to do stuff but abruptly stop, claiming that it will do something next without actually ever doing it. Very similar case with Cursor, so I think we 100% copied Cursor in that sense.

I think we can improve a bit on it here though.

monotykamary avatar May 12 '25 11:05 monotykamary

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 Jun 12 '25 02:06 github-actions[bot]

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

github-actions[bot] avatar Jun 17 '25 02:06 github-actions[bot]

Same error here. Avante does not select provider gemini. I have to use comand AvanteSwitchProvider gemini and it works.

rafael-jurado-gh avatar Oct 20 '25 12:10 rafael-jurado-gh

Same error here. Avante does not select provider gemini. I have to use comand AvanteSwitchProvider gemini and it works.

same here! thanks for the :AvanteSwitchProvider gemini trick. only then does it work for me.

gisodal avatar Oct 23 '25 08:10 gisodal