llm.nvim
llm.nvim copied to clipboard
No Auto-Completions and weird offset_encodings warning
As you see i'm getting this weird warning and no completion when trying to write cpp, this is my llm.nvim setup using lazy
{
'huggingface/llm.nvim',
opts = {
backend = 'ollama',
model = 'deepseek-coder',
accept_keymap = '<Tab>',
dismiss_keymap = '<S-Tab>',
url = 'http://localhost:11434/api/generate',
request_body = {
options = {
temperature = 0.2,
top_p = 0.95,
},
},
enable_suggestions_on_startup = false,
lsp = {
bin_path = vim.api.nvim_call_function('stdpath', { 'data' }) .. '/mason/bin/llm-ls',
},
},
},
i'm using this configuration now
{
'huggingface/llm.nvim',
opts = {
backend = 'ollama',
model = 'gemma:2b',
url = 'http://localhost:11434/api/generate',
tokens_to_clear = { '<|endoftext|>' },
request_body = {
parameters = {
max_new_tokens = 60,
temperature = 0.2,
top_p = 0.95,
},
},
debounce_ms = 150,
accept_keymap = '<Tab>',
dismiss_keymap = '<S-Tab>',
tls_skip_verify_insecure = false,
lsp = {
bin_path = nil,
host = nil,
port = nil,
version = '0.5.2',
},
tokenizer = nil,
context_window = 8192,
enable_suggestions_on_startup = true,
enable_suggestions_on_files = '*',
},
},
and its giving me this error now
Using ollama, you shouldn't set the /api/generate suffix as it is explained in the README file
Using ollama, you shouldn't set the
/api/generatesuffix as it is explained in the README file
can you link me to the correct way?
Just remove the suffix 🙂 use only the url to the root of your server, http://xxx:yyy without any path.
@mAmineChniti do you happen to use clangd lsp? You may need to set the following:
local cmp_nvim_lsp = require "cmp_nvim_lsp"
require("lspconfig").clangd.setup {
on_attach = on_attach,
capabilities = cmp_nvim_lsp.default_capabilities(),
cmd = {
"clangd",
"--offset-encoding=utf-16",
},
}
https://www.reddit.com/r/neovim/comments/12qbcua/multiple_different_client_offset_encodings/