This commit is contained in:
jmarkin 2025-11-23 17:53:04 +03:00
parent 1d7da56886
commit 9038858d7a
4 changed files with 84 additions and 120 deletions

View file

@ -98,11 +98,11 @@
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1762980239,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=",
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github"
},
"original": {
@ -305,11 +305,11 @@
"namu-nvim": {
"flake": false,
"locked": {
"lastModified": 1763177223,
"narHash": "sha256-TFBee8j2b4WxGS/XthIFKsyaGDS82m/0t/vEoEDXVfA=",
"lastModified": 1763488841,
"narHash": "sha256-YTUPpFgKo5q5QexcmEv0IcSiMG2hVfYk9cKepB9tNVo=",
"owner": "bassamsdata",
"repo": "namu.nvim",
"rev": "fdebb84a9a57329a1247b725740f267d85cd59a3",
"rev": "51d2c1de7dcdab8c0b712cd9463e392039efa5e2",
"type": "github"
},
"original": {
@ -329,11 +329,11 @@
]
},
"locked": {
"lastModified": 1763337828,
"narHash": "sha256-gBf/sNC/u0EztJybm7yP0OfbEKyN3WVi7J7FLbpswX0=",
"lastModified": 1763856300,
"narHash": "sha256-OXe/ZZqYoDmjqy19fuJzE9oR6XQH8IEGYjkDGGdQB5M=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "227971b938a6d83e3b839e5f11991511374020b7",
"rev": "3e067256eaa258df675cafaed2bcef55b41ecb60",
"type": "github"
},
"original": {
@ -345,11 +345,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1763328107,
"narHash": "sha256-N+Al++BfSq1/JZE3LY1DrefnO+kXm3y1OcqOnKrBGJQ=",
"lastModified": 1763846764,
"narHash": "sha256-MTdbS6zBlxLJCMtPU394xUHk+wnK8aqVj4egblAiGGo=",
"owner": "neovim",
"repo": "neovim",
"rev": "f0294418d65d005d885eabf80eecc7255358b95e",
"rev": "4bbdffe8298e8bf6e0590684092a25f5effc0f14",
"type": "github"
},
"original": {
@ -422,11 +422,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1763283776,
"narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=",
"lastModified": 1763678758,
"narHash": "sha256-+hBiJ+kG5IoffUOdlANKFflTT5nO3FrrR2CA3178Y5s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a",
"rev": "117cc7f94e8072499b0a7aa4c52084fa4e11cc9b",
"type": "github"
},
"original": {
@ -471,11 +471,11 @@
"oil-nvim": {
"flake": false,
"locked": {
"lastModified": 1760913566,
"narHash": "sha256-ebRao8UU8UI1S6Lumkd5vUiYYSj9UAazcEzThKyl8Uk=",
"lastModified": 1763775913,
"narHash": "sha256-OSfnL7H/haV4BeuS5r3GdBtD4si3vymtQO3q2437Kio=",
"owner": "stevearc",
"repo": "oil.nvim",
"rev": "7e1cd7703ff2924d7038476dcbc04b950203b902",
"rev": "01cb3a8ad7d5e8707041edc775af83dbf33838f4",
"type": "github"
},
"original": {
@ -528,11 +528,11 @@
"smart-splits-nvim": {
"flake": false,
"locked": {
"lastModified": 1763408602,
"narHash": "sha256-NxTRkQlnX8QSGBlumvqkNwH2jl/FDPzeIyCoG2DPIPk=",
"lastModified": 1763742162,
"narHash": "sha256-iC1rT15/qaiO+Yc+LKKCmAh5vJz8b7MS2AXsk6UgwS4=",
"owner": "mrjones2014",
"repo": "smart-splits.nvim",
"rev": "a0907c99e0bfc99880a27496a4168a7e707f2aaa",
"rev": "ca996f2844a4c77d74912a2414af939dc76a73cc",
"type": "github"
},
"original": {
@ -560,11 +560,11 @@
"whatthejump-nvim": {
"flake": false,
"locked": {
"lastModified": 1754642285,
"narHash": "sha256-ZIkm99cE7cxQYyR0E0oMwgPSgPgEOOLt7TkbCmxLaJY=",
"lastModified": 1763481259,
"narHash": "sha256-PlYZFTwsImoM4xL850yWOW1z6SeYfi4kjzjv7anpMfU=",
"owner": "lewis6991",
"repo": "whatthejump.nvim",
"rev": "a00d4db481fe5b14362c9a5688d5575fb7e48ee1",
"rev": "52291c2ec6c806790781e269344bb640f161d471",
"type": "github"
},
"original": {

View file

@ -19,7 +19,7 @@ in
require("blink.pairs").setup{
mappings = {
-- you can call require("blink.pairs.mappings").enable() and require("blink.pairs.mappings").disable() to enable/disable mappings at runtime
enabled = true,
enabled = false,
-- see the defaults: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L10
pairs = {},
},

View file

@ -221,3 +221,11 @@ g.ollama_generate_endpoint = string.format("%s/api/generate", g.ollama_url)
g.ollama_chat_endpoint = string.format("%s/api/chat", g.ollama_url)
g.ollama_chat_completions_endpoint = string.format("%s/v1/chat/completions", g.ollama_url)
g.ollama_completions_endpoint = string.format("%s/api/generate", g.ollama_url)
-- airun setup
g.airun_url = vim.env.AI_RUN_URL
g.airun_endpoint = string.format("%s/v1", g.airun_url)
g.airun_chat_endpoint = string.format("%s/v1/chat", g.airun_url)
g.airun_model = vim.env.AI_RUN_MODEL
g.airun_autocomplete_model = vim.env.AI_RUN_AUOTOCOMPLETE_MODEL
g.airun_embedded_model = vim.env.AI_RUN_EMBEDDED_MODEL

View file

@ -12,7 +12,6 @@ local opts = {
global_dir = "~/.config/avante/rules", -- absolute path
},
-- debug = true,
providers = {},
web_search_engine = {},
behaviour = {
auto_set_keymaps = true,
@ -38,12 +37,57 @@ local opts = {
enabled = false,
hint_display = "delayed",
},
provider = "ollama",
providers = {
ollama = {
endpoint = g.ollama_url,
model = "danielsheep/gpt-oss-20b-Unsloth:latest",
extra = {
num_ctx = 131072,
},
},
airun = {
__inherited_from = "openai",
endpoint = g.airun_endpoint,
api_key_name = "AI_RUN_TOKEN",
model = g.airun_model,
allow_insecure = true,
extra = {
temperature = 0.7,
max_tokens = 512,
},
},
airun_autocomplete = {
__inherited_from = "openai",
endpoint = g.airun_endpoint,
allow_insecure = true,
api_key_name = "AI_RUN_TOKEN",
model = g.airun_autocomplete_model,
},
},
rag_service = { -- RAG Service configuration
enabled = false,
host_mount = os.getenv("HOME"),
runner = "nix", -- Runner for the RAG service (can use docker or nix)
docker_extra_args = "",
llm = {
provider = "ollama",
endpoint = g.ollama_url,
api_key = "",
model = "orieg/gemma3-tools:4b",
extra = {
num_ctx = 131072,
},
},
embed = {
provider = "ollama",
endpoint = g.ollama_url,
api_key = "",
model = "embeddinggemma:latest",
extra = {
embed_batch_size = 10,
},
},
},
mappings = {
@ -161,100 +205,12 @@ local opts = {
provider = "fzf_lua",
},
}
-- ollama setup
g.ollama_model = "orieg/gemma3-tools:4b"
local ollama_modify_config = function(cfg)
cfg.provider = "ollama"
cfg.providers.ollama = {
endpoint = g.ollama_url,
model = g.ollama_model,
extra_request_body = {
-- num_ctx = 1024 * 20,
temperature = 0.5,
},
}
cfg.rag_service.llm = {
provider = "ollama",
endpoint = g.ollama_url,
api_key = "",
model = g.ollama_model,
extra = nil,
}
cfg.rag_service.embed = {
provider = "ollama",
endpoint = g.ollama_url,
api_key = "",
model = "nomic-embed-text:latest",
extra = {
embed_batch_size = 10,
},
}
require("avante").setup(cfg)
end
vim.api.nvim_create_user_command("AvanteOllama", function(_)
ollama_modify_config(opts)
end, {})
-- airun setup
g.airun_url = vim.env.AI_RUN_URL
g.airun_endpoint = string.format("%s/v1", g.airun_url)
g.airun_chat_endpoint = string.format("%s/v1/chat", g.airun_url)
g.airun_model = vim.env.AI_RUN_MODEL
g.airun_autocomplete_model = vim.env.AI_RUN_AUOTOCOMPLETE_MODEL
g.airun_embedded_model = vim.env.AI_RUN_EMBEDDED_MODEL
local airun_modify_config = function(cfg)
cfg.provider = "airun"
-- cfg.mode = "legacy"
cfg.auto_suggestions_provider = "airun_autocomplete"
cfg.providers.airun = {
__inherited_from = "openai",
endpoint = g.airun_endpoint,
api_key_name = "AI_RUN_TOKEN",
model = g.airun_model,
allow_insecure = true,
extra = {
temperature = 0.7,
max_tokens = 512,
},
}
cfg.providers.airun_autocomplete = {
__inherited_from = "openai",
endpoint = g.airun_endpoint,
allow_insecure = true,
api_key_name = "AI_RUN_TOKEN",
model = g.airun_autocomplete_model,
}
cfg.rag_service.enabled = false
cfg.rag_service.llm = {
provider = "airun",
endpoint = g.airun_endpoint,
allow_insecure = true,
api_key = "AI_RUN_TOKEN",
model = g.airun_model,
extra = {
temperature = 0.7,
max_tokens = 512,
},
}
cfg.rag_service.embed = {
provider = "airun",
endpoint = g.airun_endpoint,
allow_insecure = true,
api_key = "AI_RUN_TOKEN",
model = g.ai_run_embedded_model,
extra = {
embed_batch_size = 16,
},
}
require("avante").setup(cfg)
end
vim.api.nvim_create_user_command("AvanteAIRun", function(_)
airun_modify_config(opts)
opts.provider = "airun"
opts.auto_suggestions_provider = "airun_autocomplete"
require("avante").setup(opts)
end, {})
lze.load({
@ -263,6 +219,6 @@ lze.load({
on_require = { "avante", "avante_lib", "avante.api" },
after = function()
require("avante_lib").load()
airun_modify_config(opts)
require("avante").setup(opts)
end,
})