Home

Awesome

🦙 nvim-llama

Ollama interfaces for Neovim: get up and running with large language models locally in Neovim.

https://github.com/jpmcb/nvim-llama/assets/23109390/3e9e7248-dcf4-4349-8ee2-fd87ac3838ca

🏗️ 👷 Warning! Under active development!! 👷 🚧

Requirements

Docker is required to use nvim-llama.

And that's it! All models and clients run from within Docker to provide chat interfaces and functionality. This is an agnostic approach that works for MacOS, Linux, and Windows.

Installation

Use your favorite package manager to install the plugin:

Packer

use 'jpmcb/nvim-llama'

lazy.nvim

{
    'jpmcb/nvim-llama'
}

vim-plug

Plug 'jpmcb/nvim-llama'

Setup & configuration

In your init.vim, setup the plugin:

require('nvim-llama').setup {}

You can provide the following optional configuration table to the setup function:

local defaults = {
    -- See plugin debugging logs
    debug = false,

    -- The model for ollama to use. This model will be automatically downloaded.
    model = llama2,
}

Model library

Ollama supports an incredible number of open-source models available on ollama.ai/library

Check out their docs to learn more: https://github.com/jmorganca/ollama


When setting the model setting, the specified model will be automatically downloaded:

ModelParametersSizeModel setting
Neural Chat7B4.1GBmodel = neural-chat
Starling7B4.1GBmodel = starling-lm
Mistral7B4.1GBmodel = mistral
Llama 27B3.8GBmodel = llama2
Code Llama7B3.8GBmodel = codellama
Llama 2 Uncensored7B3.8GBmodel = llama2-uncensored
Llama 2 13B13B7.3GBmodel = llama2:13b
Llama 2 70B70B39GBmodel = llama2:70b
Orca Mini3B1.9GBmodel = orca-mini
Vicuna7B3.8GBmodel = vicuna

Note: You should have at least 8 GB of RAM to run the 3B models, 16 GB to run the 7B models, and 32 GB to run the 13B models. 70B parameter models require upwards of 64 GB of ram (if not more).

Usage

The :Llama autocommand opens a Terminal window where you can start chatting with your LLM.

To exit Terminal mode, which by default locks the focus to the terminal buffer, use the bindings Ctrl-\ Ctrl-n