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

bug: Rate limit reached on every request

Open akiooo45 opened this issue 5 months ago • 10 comments

Describe the bug

When I request to use openrouter as my providers, I always get the message "[Rate limit reached. Retrying in 0 seconds ...]" I searched for other issues, and the solution was to delete the cached configuration of avante.nvim, that is, rm -rf ~/.local/state/nvim/avante, but this did not work

Image

To reproduce

No response

Expected behavior

Expected it to not rate limit immediately.

Installation method

Use lazy.nvim:

{
    "yetone/avante.nvim",
    -- 如果您想从源代码构建,请执行 `make BUILD_FROM_SOURCE=true`
    build = "make", -- ⚠️ 一定要加上这一行配置!!!!!
    -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- 对于 Windows
    event = "VeryLazy",
    version = false, -- 永远不要将此值设置为 "*"!永远不要!
    ---@module 'avante'
    ---@type avante.Config
    opts = {
      provider = "openrouter",
      providers = {
        openrouter = {
          __inherited_from = "openai",
          endpoint = "https://openrouter.ai/api/v1",
          api_key_name = "OPENROUTER_API_KEY",
          model = "google/gemini-2.0-flash-exp:free",
        },
      },
    },
    dependencies = {
      "nvim-lua/plenary.nvim",
      "MunifTanjim/nui.nvim",
      --- 以下依赖项是可选的,
      "echasnovski/mini.pick", -- 用于文件选择器提供者 mini.pick
      "nvim-telescope/telescope.nvim", -- 用于文件选择器提供者 telescope
      "hrsh7th/nvim-cmp", -- avante 命令和提及的自动完成
      "ibhagwan/fzf-lua", -- 用于文件选择器提供者 fzf
      "nvim-tree/nvim-web-devicons", -- 或 echasnovski/mini.icons
      "zbirenbaum/copilot.lua", -- 用于 providers='copilot'
      {
        -- 支持图像粘贴
        "HakonHarnes/img-clip.nvim",
        event = "VeryLazy",
        opts = {
          -- 推荐设置
          default = {
            embed_image_as_base64 = false,
            prompt_for_file_name = false,
            drag_and_drop = {
              insert_mode = true,
            },
            -- Windows 用户必需
            use_absolute_path = true,
          },
        },
      },
      {
        -- 如果您有 lazy=true,请确保正确设置
        "MeanderingProgrammer/render-markdown.nvim",
        opts = {
          file_types = { "markdown", "Avante" },
        },
        ft = { "markdown", "Avante" },
      },
    },
  }

Environment

neovim version: v0.11.3 platform:M4 mac mini terminial: tabby

Repro

{
    "yetone/avante.nvim",
    -- 如果您想从源代码构建,请执行 `make BUILD_FROM_SOURCE=true`
    build = "make", -- ⚠️ 一定要加上这一行配置!!!!!
    -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- 对于 Windows
    event = "VeryLazy",
    version = false, -- 永远不要将此值设置为 "*"!永远不要!
    ---@module 'avante'
    ---@type avante.Config
    opts = {
      provider = "openrouter",
      providers = {
        openrouter = {
          __inherited_from = "openai",
          endpoint = "https://openrouter.ai/api/v1",
          api_key_name = "OPENROUTER_API_KEY",
          model = "google/gemini-2.0-flash-exp:free",
        },
      },
    },

akiooo45 avatar Jul 19 '25 13:07 akiooo45

I'm getting this as well on a M1 mac with Ghostty and nvim customized lazyvim.

neovim v0.11.1

bgunnarsson avatar Jul 24 '25 13:07 bgunnarsson

I noticed that upon issuing simple prompts - Avante keeps busy for longer than it took to complete a task (like - seconds to minutes longer). My console has shown that generating a handful of lines of code (about a dozen) in a project that's quite literally "vim configuration" consumed 750k tokens in just a few simple requests. I could see that number growing while Avante was still thinking, despite the task being completed.

I'm not 100% sure what may be causing this, but in my case requests were throttled by a minute at a time, despite prompts asking for, say, fix the source startup/*.vim - which produced 3LOC, yet consumed about 200k tokens)

tomasz-wiszkowski avatar Aug 02 '25 23:08 tomasz-wiszkowski

@bgunnarsson

Same here, M4 Mac

HekpoMaH avatar Aug 11 '25 12:08 HekpoMaH

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 Sep 11 '25 02:09 github-actions[bot]

The same issue, with 0.11 nvim and M4 Max

Blackmorse avatar Sep 14 '25 09:09 Blackmorse

I have found that if I use providers of openrouter such as OpenInference, it gives this issue, while I had just used grok 4 fast which has xAI as its provide and it doesn't give this error.

I am Windows 11 (Revi OS) NVIM v0.11.4

plantindesk avatar Sep 21 '25 05:09 plantindesk

The same issue with gemini cli provider

tossmilestone avatar Sep 28 '25 10:09 tossmilestone

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 Oct 29 '25 02:10 github-actions[bot]

I have the same issue on M1 mac. Using chatgpt APIs

fabOnReact avatar Oct 30 '25 18:10 fabOnReact

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 Nov 30 '25 02:11 github-actions[bot]

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

github-actions[bot] avatar Dec 06 '25 02:12 github-actions[bot]