Gollama is a client for Ollama for managing models. It provides a TUI for listing, filtering, sorting, selecting, inspecting (coming soon!) and deleting models and can link Ollama models to LM-Studio.

The project started off as a rewrite of my llamalink project, but I decided to expand it to include more features and make it more user-friendly.

Table of Contents

Features

  • Interactive TUI with sorting and filtering capabilities.
  • List available models and display basic metadata such as size, quantization level, model family, and modified date.
  • Sort models by name, size, modification date, quantization level, and family.
  • Select and delete models.
  • Inspect model for additional details.
  • Link models to LM Studio.
  • Copy models.
  • Push models to a registry.
  • Show running models.
  • Plenty more comings soon if I continue to find the tool useful.

From go:

go install github.com/sammcj/gollama@HEAD

From Github:

Download the most recent release from the releases page and extract the binary to a directory in your PATH.

e.g. zip -d gollama-v1.8.1.zip -d gollama && mv gollama /usr/local/bin

Usage

To run the gollama application, use the following command:

gollama

Tip: I like to alias gollama to g for quick access:

echo "alias g=gollama" >> ~/.zshrc

Inspect

Top

Simple model listing

Gollama can also be called with -l to list models without the TUI.

./gollama -l

Key Bindings

  • Space: Select
  • Enter: Run model (Ollama run)
  • i: Inspect model
  • t: Top (show running models)
  • D: Delete model
  • c: Copy model
  • u: Update model (edit Modelfile) Work in progress
  • P: Push model
  • n: Sort by name
  • s: Sort by size
  • m: Sort by modified
  • k: Sort by quantization
  • f: Sort by family
  • l: Link model to LM Studio
  • L: Link all models to LM Studio
  • q: Quit

Command-line Options

  • -l: List all available Ollama models and exit
  • -ollama-dir: Custom Ollama models directory
  • -lm-dir: Custom LM Studio models directory
  • -no-cleanup: Don’t cleanup broken symlinks
  • -cleanup: Remove all symlinked models and empty directories and exit
  • -v: Print the version and exit

Configuration

Gollama uses a JSON configuration file located at ~/.config/gollama/config.json. The configuration file includes options for sorting, columns, API keys, log levels etc…

Example configuration:

{
  "default_sort": "modified",
  "columns": [
    "Name",
    "Size",
    "Quant",
    "Family",
    "Modified",
    "ID"
  ],
  "ollama_api_key": "",
  "ollama_api_url": "http://localhost:14434",
  "lm_studio_file_paths": "",
  "log_level": "info",
  "log_file_path": "gollama.log",
  "sort_order": "Size",
  "strip_string": "my-private-registry.internal/"
}

The strip string option can be used to remove a prefix from model names as they are displayed in the TUI. This can be useful if you have a common prefix such as a private registry that you want to remove for display purposes.

Installation and build from source

  1. Clone the repository:

    git clone --depth=1 https://github.com/sammcj/gollama.git
    cd gollama
    
  2. Build:

    go get
    make build
    
  3. Run:

    ./gollama
    

Logging

Logs can be found in the gollama.log which is stored in $HOME/.config/gollama/gollama.log by default. The log level can be set in the configuration file.

License

Copyright Β© 2024 Sam McLeod

This project is licensed under the MIT License.