bug: attempt to call method 'parse_curl_args' (a nil value)
Describe the bug
I configured avante through nixvim in this way
avante = {
enable = true;
settings = {
provider = "ollama";
vendors = {
ollama = {
model = "qwen14b:latest";
};
};
};
};
I have the qwen14b:latest model that I created using a modelfile.
I get this error when I try to ask avente "how u doin" using aa
E5108: Error executing lua: ...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:230: attempt to call method 'parse_curl_args' (a nil value)
stack traceback:
...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:230: in function '_stream'
...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:594: in function 'stream'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2634: in function 'cb'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2415: in function 'get_generate_prompts_options'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2624: in function 'handle_submit'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2688: in function <...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2671>
Then I press ENTER and my PC starts blowing, but no output comes out after it stops:
- Datetime: 2025-04-05 12:42:31
- Model: ollama/qwen14b:latest
- Selected files:
- triangles.rs
> how u doin
**Generating response ...**
To reproduce
https://github.com/ivandimitrov8080/wvl/blob/avante_ollama/default.nix#L50
if you clone the repo and change to that branch you can type nix develop and you'll have the nvim that doesn't work.
Expected behavior
for ollama to work with that config
Installation method
I used nixvim https://nix-community.github.io/nixvim/plugins/avante/index.html
Environment
wvl on avante_ollama is 📦 v0.1.0 via 🦀 v1.85.0 via ❄️ impure (nix-shell-env)
❯ nvim -v
NVIM v0.12.0-nightly+71e133e
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info
wvl on avante_ollama is 📦 v0.1.0 via 🦀 v1.85.0 via ❄️ impure (nix-shell-env)
❯ uname -a
Linux nixos 6.14.0 #1-NixOS SMP PREEMPT_DYNAMIC Mon Mar 24 14:02:41 UTC 2025 x86_64 GNU/Linux
Repro
-- Ignore the user lua configuration
vim.opt.runtimepath:remove(vim.fn.stdpath("config")) -- ~/.config/nvim
vim.opt.runtimepath:remove(vim.fn.stdpath("config") .. "/after") -- ~/.config/nvim/after
-- Nixvim's internal module table
-- Can be used to share code throughout init.lua
local _M = {}
-- Set up globals {{{
do
local nixvim_globals = {
mapleader = " ",
maplocalleader = " ",
rustaceanvim = { server = {
on_attach = function(client, bufnr)
return _M.lspOnAttach(client, bufnr)
end,
} },
}
for k, v in pairs(nixvim_globals) do
vim.g[k] = v
end
end
-- }}}
-- Set up options {{{
do
local nixvim_options = {
autoread = true,
expandtab = true,
hlsearch = false,
number = true,
scrolloff = 15,
shiftwidth = 2,
tabstop = 4,
termguicolors = true,
textwidth = 120,
updatetime = 20,
}
for k, v in pairs(nixvim_options) do
vim.opt[k] = v
end
end
-- }}}
require("catppuccin").setup({
flavour = "mocha",
integrations = { cmp = true, gitsigns = true, markdown = true, telescope = { enabled = true }, treesitter = true },
transparent_background = true,
})
vim.cmd([[let $BAT_THEME = 'catppuccin'
colorscheme catppuccin
]])
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<C-k>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }),
["<C-j>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }),
}),
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
sources = { { name = "nvim_lsp" }, { name = "luasnip" }, { name = "path" }, { name = "buffer" } },
})
require("which-key").setup({})
require("nvim-web-devicons").setup({})
require("nvim-ts-autotag").setup({})
vim.opt.runtimepath:prepend(vim.fs.joinpath(vim.fn.stdpath("data"), "site"))
require("nvim-treesitter.configs").setup({
highlight = { disable = { "text" }, enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-a>",
node_decremental = "<C-d>",
node_incremental = "<C-a>",
scope_incremental = "<C-s>",
},
},
parser_install_dir = vim.fs.joinpath(vim.fn.stdpath("data"), "site"),
})
require("toggleterm").setup({})
require("todo-comments").setup({})
require("telescope").setup({})
local __telescopeExtensions = {}
for i, extension in ipairs(__telescopeExtensions) do
require("telescope").load_extension(extension)
end
require("nvim-autopairs").setup({})
require("lualine").setup({ options = { theme = "catppuccin" } })
require("hop").setup({})
require("gitsigns").setup({})
require("Comment").setup({})
require("barbar").setup({})
require("avante_lib").load()
require("avante").setup({ provider = "ollama", vendors = { ollama = { model = "qwen:14b" } } })
require("auto-session").setup({})
-- LSP {{{
do
local __lspServers = {
{
extraOptions = {
settings = {
["nil"] = {
formatting = {
command = {
"/nix/store/7x2ra4a98rdjy1si70nkn2qinffvfyd5-nixfmt-unstable-2025-03-03/bin/nixfmt",
},
},
},
},
},
name = "nil_ls",
},
{ name = "bashls" },
}
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
_M.lspOnAttach = function(client, bufnr)
if client.server_capabilities.documentHighlightProvider then
vim.api.nvim_create_autocmd("CursorHold", {
buffer = bufnr,
callback = function()
vim.lsp.buf.document_highlight()
end,
})
vim.api.nvim_create_autocmd("CursorMoved", {
buffer = bufnr,
callback = function()
vim.lsp.buf.clear_references()
end,
})
end
end
local __lspCapabilities = function()
capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
require("cmp_nvim_lsp").default_capabilities()
return capabilities
end
local __setup = {
on_attach = _M.lspOnAttach,
capabilities = __lspCapabilities(),
}
for i, server in ipairs(__lspServers) do
if type(server) == "string" then
require("lspconfig")[server].setup(__setup)
else
local options = server.extraOptions
if options == nil then
options = __setup
else
options = vim.tbl_extend("keep", options, __setup)
end
require("lspconfig")[server.name].setup(options)
end
end
end
-- }}}
require("luasnip").config.setup({})
require("diffview").setup({ use_icons = true })
-- Set up keybinds {{{
do
local __nixvim_binds = {
{
action = "<Nop>",
key = "<Space>",
mode = { "n", "v" },
options = { desc = "Don't map the leader key", silent = true },
},
{
action = "<cmd>BufferNext<cr>",
key = "<Tab>",
mode = "n",
options = { desc = "Switch tabs forwards", silent = true },
},
{
action = "<cmd>BufferPrevious<cr>",
key = "<S-Tab>",
mode = "n",
options = { desc = "Switch tabs backwards", silent = true },
},
{
action = "<cmd>move +1<cr>",
key = "<C-j>",
mode = "n",
options = { desc = "Move current line down by 1", silent = true },
},
{
action = "<cmd>move -2<cr>",
key = "<C-k>",
mode = "n",
options = { desc = "Move current line up by 1", silent = true },
},
{ action = "<cmd>t.<cr>", key = "<C-s>", mode = "n", options = { desc = "Duplicate line", silent = true } },
{
action = "<cmd>BufferClose<cr>",
key = "<leader>x",
mode = "n",
options = { desc = "Close current buffer", silent = true },
},
{
action = require("Comment.api").toggle.linewise.current,
key = "<leader>/",
mode = "n",
options = { desc = "Comment out the current line", silent = true },
},
{
action = "<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
key = "<leader>/",
mode = "v",
options = { desc = "Comment out the selection", silent = true },
},
{
action = "<cmd>ToggleTerm<cr>",
key = "<leader>t",
mode = { "n", "t" },
options = { desc = "Open a terminal", silent = true },
},
{
action = require("telescope.builtin").find_files,
key = "<leader>ff",
mode = "n",
options = { desc = "Find files" },
},
{
action = require("telescope.builtin").live_grep,
key = "<leader>fw",
mode = "n",
options = { desc = "Find words" },
},
{
action = require("telescope.builtin").lsp_references,
key = "gr",
mode = "n",
options = { desc = "Go to references" },
},
{
action = require("telescope.builtin").lsp_implementations,
key = "gi",
mode = "n",
options = { desc = "Go to implementations" },
},
{
action = require("telescope.builtin").lsp_definitions,
key = "gd",
mode = "n",
options = { desc = "Go to definitions" },
},
{
action = require("telescope.builtin").lsp_type_definitions,
key = "gt",
mode = "n",
options = { desc = "Go to type definitions" },
},
{ action = vim.diagnostic.open_float, key = "<leader>e", mode = "n", options = { desc = "Open diagnostics" } },
{
action = vim.lsp.buf.code_action,
key = "<leader>la",
mode = "n",
options = { desc = "LSP Code action", silent = true },
},
{
action = vim.lsp.buf.rename,
key = "<leader>lr",
mode = "n",
options = { desc = "LSP Rename", silent = true },
},
{
action = vim.lsp.buf.format,
key = "<leader>lf",
mode = "n",
options = { desc = "Format buffer", silent = true },
},
{
action = "<cmd>TodoTelescope<cr>",
key = "<leader>tt",
mode = "n",
options = { desc = "Show Todo Telescope", silent = true },
},
{
action = "<cmd>HopChar1<cr>",
key = "<leader>h",
mode = "n",
options = { desc = "Hop to character in buffer", silent = true },
},
}
for i, map in ipairs(__nixvim_binds) do
vim.keymap.set(map.mode, map.key, map.action, map.options)
end
end
-- }}}
-- Set up autogroups {{
do
local __nixvim_autogroups = { nixvim_binds_LspAttach = { clear = true } }
for group_name, options in pairs(__nixvim_autogroups) do
vim.api.nvim_create_augroup(group_name, options)
end
end
-- }}
-- Set up autocommands {{
do
local __nixvim_autocommands = {
{
callback = function()
do
local __nixvim_binds =
{ { action = vim.lsp.buf.hover, key = "K", mode = "n", options = { silent = false } } }
for i, map in ipairs(__nixvim_binds) do
vim.keymap.set(map.mode, map.key, map.action, map.options)
end
end
end,
desc = "Load keymaps for LspAttach",
event = "LspAttach",
group = "nixvim_binds_LspAttach",
},
}
for _, autocmd in ipairs(__nixvim_autocommands) do
vim.api.nvim_create_autocmd(autocmd.event, {
group = autocmd.group,
pattern = autocmd.pattern,
buffer = autocmd.buffer,
desc = autocmd.desc,
callback = autocmd.callback,
command = autocmd.command,
once = autocmd.once,
nested = autocmd.nested,
})
end
end
-- }}
+1 also encounter this problem
+1
+1
Note: using the a? keybind to select a model resolves this error, but only for the chat window & needs to be performed whenever quitting and re-entering nvim
Note: using the a? keybind to select a model resolves this error, but only for the chat window & needs to be performed whenever quitting and re-entering nvim
I tried it and it didn't solve it even for the chat window.
+1
+1
Disabling summarize_chat_thread_title func "fixes" it for me :/
Probably breaking something else at the same time that I don't use/see.
{
"yetone/avante.nvim",
event = "VeryLazy",
build = "make",
version = false,
dependencies = {
"MunifTanjim/nui.nvim",
},
opts = require "configs.avante",
config = function(_, opts)
require("avante").setup(opts)
-- temp fix for #1815
local llm = require "avante.llm"
if llm then
llm.summarize_chat_thread_title = function() end
end
end,
},
@ivandimitrov8080 As you are using nixvim, your avante.nvim version could be outdated. You can:
- import avante.nvim via
fetchFromGitHub - Use this older config from the wiki:
provider = "ollama";
vendors = {
ollama = {
__inherited_from = "openai";
api_key_name = "";
endpoint = "http://127.0.0.1:11434/v1";
model = "ivans-post-singularity-agi-model";
disable_tools = true; # Open-source models often do not support tools.
};
};
For Lua users: https://github.com/yetone/avante.nvim/wiki/Custom-providers#ollama
@ivandimitrov8080 As you are using nixvim, your avante.nvim version could be outdated. You can:
* import avante.nvim via `fetchFromGitHub` * Use this older config from the wiki:provider = "ollama";
vendors = { ollama = { __inherited_from = "openai";
api_key_name = ""; endpoint = "http://127.0.0.1:11434/v1"; model = "ivans-post-singularity-agi-model"; disable_tools = true; # Open-source models often do not support tools.}; };
For Lua users: https://github.com/yetone/avante.nvim/wiki/Custom-providers#ollama
For this config:
settings = {
provider = "ollama";
vendors = {
ollama = {
__inherited_from = "openai";
api_key_name = "";
model = "qwen14b";
endpoint = "http://127.0.0.1:11434/v1";
disable_tools = true;
};
};
};
I get these responses:
how u doin
I'm doing well, thank you for asking! How can I assist you today?
-
Datetime: 2025-05-08 09:18:56
-
Model: ollama/qwen14b
-
Selected files:
- triangles.rs
what do you think the weather is currently like
As an AI, I don't have direct access to real-time weather data. However, if you provide your location or share a weather source, I can help interpret the information for you.
-
Datetime: 2025-05-08 09:26:52
-
Model: ollama/qwen14b
-
Selected files:
- triangles.rs
so what does this file do
The question is asking for a description or explanation of the purpose and functionality of a specific file that was mentioned or assumed to be in context. Without the actual file content, it's impossible to provide an exact answer. However, if you have knowledge about similar files, you can make an educated guess.
And when I ask it to refactor a bunch of lines, it just deletes them (which in reality might improve the situation, but that's not what I asked).
I think it's getting there.
@ivandimitrov8080 As you are using nixvim, your avante.nvim version could be outdated. You can:
* import avante.nvim via `fetchFromGitHub` * Use this older config from the wiki:provider = "ollama"; vendors = { ollama = { __inherited_from = "openai";
api_key_name = ""; endpoint = "http://127.0.0.1:11434/v1"; model = "ivans-post-singularity-agi-model"; disable_tools = true; # Open-source models often do not support tools.}; }; For Lua users: Wiki: Custom providers (ollama)
For this config:
settings = { provider = "ollama"; vendors = { ollama = { __inherited_from = "openai"; api_key_name = ""; model = "qwen14b"; endpoint = "http://127.0.0.1:11434/v1"; disable_tools = true; }; }; };I get these responses:
how u doin
I'm doing well, thank you for asking! How can I assist you today?
Datetime: 2025-05-08 09:18:56
Model: ollama/qwen14b
Selected files:
- triangles.rs
what do you think the weather is currently like
As an AI, I don't have direct access to real-time weather data. However, if you provide your location or share a weather source, I can help interpret the information for you.
Datetime: 2025-05-08 09:26:52
Model: ollama/qwen14b
Selected files:
- triangles.rs
so what does this file do
The question is asking for a description or explanation of the purpose and functionality of a specific file that was mentioned or assumed to be in context. Without the actual file content, it's impossible to provide an exact answer. However, if you have knowledge about similar files, you can make an educated guess.
And when I ask it to refactor a bunch of lines, it just deletes them (which in reality might improve the situation, but that's not what I asked).
I think it's getting there.
As shown in the document, please take ollama out of vendors and place it at the outermost level. However, I have also made this incorrect usage compatible in the latest version, so I think this issue can be closed.
@ivandimitrov8080 As you are using nixvim, your avante.nvim version could be outdated. You can:
- import avante.nvim via
fetchFromGitHub- Use this older config from the wiki:
provider = "ollama"; vendors = { ollama = { __inherited_from = "openai"; api_key_name = ""; endpoint = "http://127.0.0.1:11434/v1"; model = "ivans-post-singularity-agi-model"; disable_tools = true; # Open-source models often do not support tools. }; };For Lua users: https://github.com/yetone/avante.nvim/wiki/Custom-providers#ollama
I don't think the outdated version is the problem here.
NixVim currently uses nixpkgs at revision b3582c75c7f21ce0b429898980eddbbf05c68e55.
This is the revision from two days ago. Here is the definition for avante.nvim plugin in nixpkgs at this revision.
It uses version 0.0.23. From what I can see, this is the latest official release of avante.nvim (released on Mar 9, 2025). There are newer commits, but not released yet.
Also, I don't think that ollama vendor config is the root cause of this error. I have configured other vendors (groq, openrouter) and still have the same issue.
As shown in the document, please take
ollamaout ofvendorsand place it at the outermost level. However, I have also made this incorrect usage compatible in the latest version, so I think this issue can be closed.
Again, I don't think this issue is specific to the ollama vendor. For reference, here is my config (in Nix/NixVim):
{
auto_suggestions_provider = "openrouter_gpt41_mini";
behaviour = {
# auto_suggestions = true;
enable_cursor_planning_mode = true;
};
cursor_applying_provider = "openrouter";
hints.enabled = false;
provider = "openrouter";
vendors = {
groq = {
__inherit_from = "openai";
api_key_name = "GROQ_API_KEY";
endpoint = "https://api.groq.com/openai/v1/";
max_tokens = 32768;
model = "deepseek-r1-distill-qwen-32b";
temperature = 0.6;
};
groq_llama33 = {
__inherit_from = "groq";
model = "llama-3.3-70b-versatile";
};
openrouter = {
__inherit_from = "openai";
api_key_name = "OPENROUTER_API_KEY";
endpoint = "https://openrouter.ai/api/v1/";
max_tokens = 32768;
model = "openai/gpt-4.1";
};
openrouter_gpt41_mini = {
__inherit_from = "openrouter";
model = "openai/gpt-4.1-mini";
};
};
}
I have just updated NixVim and have tried again, but with the same result:
Error 16:47:26 msg_show.emsg E5108: Lua: ...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:230: attempt to call method 'parse_curl_args' (a nil value)
stack traceback:
...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:230: in function '_stream'
...ck/myNeovimPackages/start/avante.nvim/lua/avante/llm.lua:594: in function 'stream'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2634: in function 'cb'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2415: in function 'get_generate_prompts_options'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2624: in function 'handle_submit'
...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2688: in function <...yNeovimPackages/start/avante.nvim/lua/avante/sidebar.lua:2671>
For me this issue is definitely not resolved.
@dpomykala
From what I can see, this is the latest official release of avante.nvim (released on Mar 9, 2025)
For ollama, this error is expected, as the ollama vendor was added after the latest release. We can see that here.
For your own issue, parse_curl_args is undefined somewhere.
What do you expect to happen if the suggestions provider is set to openrouter_gpt41_mini,
and the openrouter_gpt41_mini vendor is inheriting from the openrouter provider, which does not exist?
What avante could do better is check whether that provider actually exists, instead of loading null values for parse_curl_args etc.
It uses version 0.0.23. From what I can see, this is the latest official release of avante.nvim (released on Mar 9, 2025). There are newer commits, but not released yet.
Ok, I reviewed my config again and found two issues.
The main problem was a silly mistake/typo: ~~__inherit_from~~ instead of __inherited_from 🙈.
The second problem was that I was trying to inherit from my custom vendor/provider definition.
What do you expect to happen if the suggestions provider is set to
openrouter_gpt41_mini, and theopenrouter_gpt41_minivendor is inheriting from theopenrouterprovider, which does not exist?
The openrouter provider was already defined in my config as a custom vendor:
provider = "openrouter";
vendors = {
openrouter = {
__inherited_from = "openai";
api_key_name = "OPENROUTER_API_KEY";
endpoint = "https://openrouter.ai/api/v1/";
max_tokens = 32768;
model = "openai/gpt-4.1";
};
};
I thought I could inherit from it like this:
openrouter_gpt41_mini = {
__inherited_from = "openrouter";
model = "openai/gpt-4.1-mini";
};
Apparently that is not the case. I fixed it and now it's working as expected. Thanks!
What avante could do better is check whether that provider actually exists, instead of loading null values for
parse_curl_argsetc.
I agree that error handling could be improved to provide more user friendly messages.
@v3ceban thank you for information! To be honest, this versioning is quite confusing. I think most people expect GH releases and/or Git version tags to represent the version of the main project itself. Probably that's why nixpkgs pins to the specific Git tag (v0.0.23 at this moment). This is unfortunate for people using Nix/NixVim, as that version is two months old.
For people using NixVim: my PR to nixpkgs has been merged, which should result in a relatively up-to-date version of avante.nvim (when it reaches nixpkgs-unstable). It can still lag a couple of days behind the main branch. Depending on your configuration, some changes might be needed for the newer version.