huggingface / llm.nvim

LLM powered development for Neovim
Apache License 2.0
724 stars 45 forks source link

Unreachable LLM server blocks UI #71

Open RemcoSchrijver opened 7 months ago

RemcoSchrijver commented 7 months ago

When the configured LLM server is unreachable the UI is blocked by the error messages, making typing extremely slow. This can of course be negated by disabling generation, but maybe hiding the error message after 'n' times would be a better experience for the user?

Amzd commented 4 months ago

temporary solution

local isRunning = require("plenary.curl").get("http://localhost:11434", {
  timeout = 50,
  on_error = function(e) return { status = e.exit } end,
}).status == 200

require("llm").setup({
  enable_suggestions_on_startup = isRunning,
  ...