function M.setup()

in lua/llm/config.lua [81:105]


function M.setup(opts)
  if M.config then
    vim.notify("[LLM] config is already set", vim.log.levels.WARN)
    return M.config
  end

  local config = vim.tbl_deep_extend("force", default_config, opts or {})

  if config.backend ~= "huggingface" and config.backend ~= "tgi" then
    local def_req_body = default_request_bodies[config.backend] or {}
    if opts and opts.request_body ~= nil then
      config.request_body = vim.tbl_deep_extend("force", def_req_body, opts.request_body)
    else
      config.request_body = def_req_body
    end
  end

  if config.api_token == nil then
    config.api_token = M.get_token()
  end

  M.config = config

  return M.config
end