llm-ls icon indicating copy to clipboard operation
llm-ls copied to clipboard

Proposal: Launching LLM server as a daemon

Open blmarket opened this issue 11 months ago • 2 comments

Proof-of-concept: https://github.com/blmarket/llm-ls

Hi,

I'm wondering llm-ls can incorporate dedicated LLM server provider within LSP server, preferably as a shared instance via daemonize. Idea was inspired by bazel client/server.

It works as following:

  • There's a lock file to ensure only 1 LLM server is running
  • If there's no usage of LLM (i.e. LSP exits) for 10 seconds, LLM server is terminated
    • There is a heartbeat to let LLM process know there is a client
  • Multiple LSP instances will share single LLM server

Still many things are hardcoded (such as LLM path, various file path, model path), but it's usable with existing llm.XXX editor plugins.

Want to know whether this is something llm-ls would like to support as one of its backends, or better be kept as different project.

blmarket avatar Mar 10 '24 05:03 blmarket