add AvanteSwitchProvider local model switching
This commit is contained in:
		@@ -1,18 +1,18 @@
 | 
			
		||||
{
 | 
			
		||||
  "LazyVim": { "branch": "main", "commit": "12818a6cb499456f4903c5d8e68af43753ebc869" },
 | 
			
		||||
  "avante.nvim": { "branch": "main", "commit": "b09ff856b7239380cf4a92e304460e99dc88282a" },
 | 
			
		||||
  "avante.nvim": { "branch": "main", "commit": "d520f0933323ba982c9665d8e4fe91000ff14e99" },
 | 
			
		||||
  "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" },
 | 
			
		||||
  "catppuccin": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" },
 | 
			
		||||
  "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
 | 
			
		||||
  "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
 | 
			
		||||
  "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
 | 
			
		||||
  "conform.nvim": { "branch": "master", "commit": "62eba813b7501b39612146cbf29cd07f1d4ac29c" },
 | 
			
		||||
  "conform.nvim": { "branch": "master", "commit": "0ebe875d9c306f5fc829db38492ffff2a70d8e9d" },
 | 
			
		||||
  "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
 | 
			
		||||
  "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
 | 
			
		||||
  "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
 | 
			
		||||
  "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
 | 
			
		||||
  "gitsigns.nvim": { "branch": "main", "commit": "899e993850084ea33d001ec229d237bc020c19ae" },
 | 
			
		||||
  "grug-far.nvim": { "branch": "main", "commit": "986fca5ffc354f48f2c329c8dff8a41632832600" },
 | 
			
		||||
  "grug-far.nvim": { "branch": "main", "commit": "8058c2366f21af6f446d8e0f9333ae7c22f7679a" },
 | 
			
		||||
  "img-clip.nvim": { "branch": "main", "commit": "28a32d811d69042f4fa5c3d5fa35571df2bc1623" },
 | 
			
		||||
  "indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
 | 
			
		||||
  "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
 | 
			
		||||
@@ -29,20 +29,21 @@
 | 
			
		||||
  "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
 | 
			
		||||
  "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
 | 
			
		||||
  "nvim-lint": { "branch": "master", "commit": "debabca63c0905b59ce596a55a8e33eafdf66342" },
 | 
			
		||||
  "nvim-lspconfig": { "branch": "master", "commit": "6bfd9210e312af6cfedba05d272e85618c93ab0d" },
 | 
			
		||||
  "nvim-lspconfig": { "branch": "master", "commit": "3ad562700d0615818bf358268ac8914f6ce2b079" },
 | 
			
		||||
  "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
 | 
			
		||||
  "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
 | 
			
		||||
  "nvim-treesitter": { "branch": "master", "commit": "fd9663acca289598086b7c5a366be8b2fa5d7960" },
 | 
			
		||||
  "nvim-treesitter": { "branch": "master", "commit": "2d8f0f37c4056022b6643cbe8671319881f8b369" },
 | 
			
		||||
  "nvim-treesitter-textobjects": { "branch": "master", "commit": "3a3c6244553f13fdd92d312c82722b57ce6c4bec" },
 | 
			
		||||
  "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
 | 
			
		||||
  "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
 | 
			
		||||
  "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
 | 
			
		||||
  "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
 | 
			
		||||
  "render-markdown.nvim": { "branch": "main", "commit": "bc8213ddcd91d2045cc3813df861adb93fbf2d2d" },
 | 
			
		||||
  "render-markdown.nvim": { "branch": "main", "commit": "2f9d4f0be8784ed4fef5960eb7b80bf60c5fdf56" },
 | 
			
		||||
  "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
 | 
			
		||||
  "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
 | 
			
		||||
  "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" },
 | 
			
		||||
  "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" },
 | 
			
		||||
  "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" },
 | 
			
		||||
  "tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" },
 | 
			
		||||
  "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
 | 
			
		||||
  "ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" },
 | 
			
		||||
  "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }
 | 
			
		||||
  "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,14 +8,61 @@ return {
 | 
			
		||||
      claude = {
 | 
			
		||||
        ["local"] = true,
 | 
			
		||||
      },
 | 
			
		||||
      provider = "ollama",
 | 
			
		||||
      provider = "ol_llama",
 | 
			
		||||
      vendors = {
 | 
			
		||||
        provider = "ollama",
 | 
			
		||||
        ---@type AvanteProvider
 | 
			
		||||
        ollama = {
 | 
			
		||||
        ol_llama = {
 | 
			
		||||
          ["local"] = true,
 | 
			
		||||
          endpoint = "127.0.0.1:11434/v1",
 | 
			
		||||
          model = "llama3.1",
 | 
			
		||||
          model = "llama3.1:latest",
 | 
			
		||||
          parse_curl_args = function(opts, code_opts)
 | 
			
		||||
            return {
 | 
			
		||||
              url = opts.endpoint .. "/chat/completions",
 | 
			
		||||
              headers = {
 | 
			
		||||
                ["Accept"] = "application/json",
 | 
			
		||||
                ["Content-Type"] = "application/json",
 | 
			
		||||
              },
 | 
			
		||||
              body = {
 | 
			
		||||
                model = opts.model,
 | 
			
		||||
                messages = require("avante.providers").copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced
 | 
			
		||||
                max_tokens = 2048,
 | 
			
		||||
                stream = true,
 | 
			
		||||
              },
 | 
			
		||||
            }
 | 
			
		||||
          end,
 | 
			
		||||
          parse_response_data = function(data_stream, event_state, opts)
 | 
			
		||||
            require("avante.providers").openai.parse_response(data_stream, event_state, opts)
 | 
			
		||||
          end,
 | 
			
		||||
        },
 | 
			
		||||
        ---@type AvanteProvider
 | 
			
		||||
        ol_llama70b = {
 | 
			
		||||
          ["local"] = true,
 | 
			
		||||
          endpoint = "127.0.0.1:11434/v1",
 | 
			
		||||
          model = "llama3.1:70b",
 | 
			
		||||
          parse_curl_args = function(opts, code_opts)
 | 
			
		||||
            return {
 | 
			
		||||
              url = opts.endpoint .. "/chat/completions",
 | 
			
		||||
              headers = {
 | 
			
		||||
                ["Accept"] = "application/json",
 | 
			
		||||
                ["Content-Type"] = "application/json",
 | 
			
		||||
              },
 | 
			
		||||
              body = {
 | 
			
		||||
                model = opts.model,
 | 
			
		||||
                messages = require("avante.providers").copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced
 | 
			
		||||
                max_tokens = 2048,
 | 
			
		||||
                stream = true,
 | 
			
		||||
              },
 | 
			
		||||
            }
 | 
			
		||||
          end,
 | 
			
		||||
          parse_response_data = function(data_stream, event_state, opts)
 | 
			
		||||
            require("avante.providers").openai.parse_response(data_stream, event_state, opts)
 | 
			
		||||
          end,
 | 
			
		||||
        },
 | 
			
		||||
        ---@type AvanteProvider
 | 
			
		||||
        ol_gemma = {
 | 
			
		||||
          ["local"] = true,
 | 
			
		||||
          endpoint = "127.0.0.1:11434/v1",
 | 
			
		||||
          model = "codegemma",
 | 
			
		||||
          parse_curl_args = function(opts, code_opts)
 | 
			
		||||
            return {
 | 
			
		||||
              url = opts.endpoint .. "/chat/completions",
 | 
			
		||||
@@ -68,8 +115,8 @@ return {
 | 
			
		||||
      "nvim-lua/plenary.nvim",
 | 
			
		||||
      "MunifTanjim/nui.nvim",
 | 
			
		||||
      --- The below dependencies are optional,
 | 
			
		||||
      --"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
 | 
			
		||||
      "echasnovski/mini.icons",
 | 
			
		||||
      "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
 | 
			
		||||
      -- "echasnovski/mini.icons",
 | 
			
		||||
      {
 | 
			
		||||
        -- support for image pasting
 | 
			
		||||
        "HakonHarnes/img-clip.nvim",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user