David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
992 stars 64 forks source link

hard to add this plugin using lazy.nvim with the container option setting. #29

Closed meicale closed 7 months ago

meicale commented 8 months ago

I need to use the docker container to serve my custom model and it works when using ollama docker images. BUT, when come to using it in this plugin, it is difficult to set up the container value in lazy.nvim package manager. Can you provide more code snips to using different config setting ups? Thanks for your time and effort on time good project.

meicale commented 8 months ago

It should be just as simple as this and it helps the beginner to start:

{ 
    "David-Kunz/gen.nvim",
    config = function()
      require('gen').container = 'ollama_gpu'
      -- require('gen').model = 'zephyr'
    end,
  },
David-Kunz commented 8 months ago

Hi @wishuuu ,

Could you help this user? Shouldn't it be enough to set the container property? I must admit, I haven't tested it yet.

wishuuu commented 8 months ago

Hi @meicale !

Here is code snippet from my lazy config:

https://github.com/wishuuu/nvim-pure/blob/main/lua/wishu/plugins/gen.lua

Honestly it's hard to tell what may be wrong with your config. Can you check if docker exec ollama_gpu ollama run zephyr TEST returns any error in your case? Also are you using Linux or Windows?

kjjuno commented 8 months ago

There is now a traditional setup function. Does that resolve this issue?

David-Kunz commented 7 months ago

Hi @meicale ,

The docker option was removed since we switched to HTTP-based communication. You should be able to specify the init function to start your docker container and use port forwarding to communicate with it.

Best regards, David