Ollama: use port forwarding

This commit is contained in:
Filippo Berto 2025-01-26 21:51:39 +01:00
parent 598cbb4750
commit b66bbda19e
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
2 changed files with 13 additions and 14 deletions

View file

@ -403,21 +403,13 @@ in
plugin = vp.ollama-nvim; plugin = vp.ollama-nvim;
type = "lua"; type = "lua";
config = '' config = ''
function readAll(file) local token = readAll("${nixosConfig.age.secrets.ollama.path}")
local f = assert(io.open(file, "rb")) local conf = {
local content = f:read("*all") -- url = string.format("https://bertof:%s@ollama.ricerca.sesar.di.unimi.it/", token),
f:close()
return content
end
local url = readAll("${nixosConfig.age.secrets.ollama.path}")
print(vim.inspect(url))
local ollama = require("ollama")
ollama:setup({
url = url,
model = "codegemma:7b" model = "codegemma:7b"
}) }
local ollama = require("ollama")
ollama.setup(conf)
''; '';
} }
]; ];
@ -428,6 +420,13 @@ in
# let g:airline_powerline_fonts = 1 # let g:airline_powerline_fonts = 1
# ''; # '';
extraLuaConfig = '' extraLuaConfig = ''
function readAll(file)
local f = assert(io.open(file, "rb"))
local content = f:read("*all")
f:close()
return string.gsub(content, "%s+", "")
end
-- Setup -- Setup
local o = vim.o local o = vim.o
local g = vim.g local g = vim.g

Binary file not shown.