Skip to content

Instantly share code, notes, and snippets.

@rain-1
Last active October 1, 2024 19:52
Show Gist options
  • Save rain-1/af8d414855506c24c5c4709bc72b7129 to your computer and use it in GitHub Desktop.
Save rain-1/af8d414855506c24c5c4709bc72b7129 to your computer and use it in GitHub Desktop.
How to get started with the loom

What is this

This is a guide on how to set up a way to loom with a local LLM on your computer. Loom is the name for a way of making use of an LLM base model, such as GPT-2, in order to read, write and explore generated text.

To loom you can use the following software stack:

  • Obsidian with Loomsidian plugin
  • llama.cpp llama-server running GPT2

Obsidian

Install https://obsidian.md/

Create a vault.

Loomsidian

Put this inside your obsidian plugins folder, which is in the subdirectory of your vault named /.obsidian/plugins.

  • git clone https://github.com/rain-1/loom

You need npm to build this. The version in the repos does not currently support llama.cpp.

llama.cpp

  • git clone https://github.com/ggerganov/llama.cpp
  • cd llama.cpp
  • make

Do not worry about graphics card acceleration or anything like that yet. Just get started with GPT2 on CPU.

GPT2

You can download quantized versions of GPT2-xl here:

I recommend gpt2-xl.Q4_K_S.gguf. Save it into llama.cpp/models/

Running it

You can now launch the API endpoint locally on your computer with ./llama-server --host 0.0.0.0 -m ./models/gpt2-xl.Q4_K_M.gguf. You can test it in browser by loading http://localhost:8080.

You need to configure the loomsidian plugin to have a gpt2 profile with the following options:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment