bug: Rate limit reached on every request
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
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",
},
},
},
I'm getting this as well on a M1 mac with Ghostty and nvim customized lazyvim.
neovim v0.11.1
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)
@bgunnarsson
Same here, M4 Mac
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.
The same issue, with 0.11 nvim and M4 Max
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
The same issue with gemini cli provider
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.
I have the same issue on M1 mac. Using chatgpt APIs
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.
This issue was closed because it has been stalled for 5 days with no activity.