Skip to content

Latest commit

 

History

History
131 lines (93 loc) · 4.52 KB

installation.org

File metadata and controls

131 lines (93 loc) · 4.52 KB

Easy instructions

Running Pen.el on your host machine

This is a demo of setting up Pen.el for the first time.

The following commands run on your host machine.

sudo adduser --home /home/pen pen
sudo usermod -aG docker pen
sudo usermod -aG sudo pen

sudo login pen
git clone "https://github.com/semiosis/pen.el"
git clone "https://github.com/semiosis/prompts"

# Currently about 8GB
docker pull semiosis/pen.el:latest

mkdir -p $HOME/.pen

# Put in your keys, or do not, it's up to you!
echo "sk-<openai key here>" > $HOME/.pen/openai_api_key       # https://openai.com/
echo "<ai21 key here>" > $HOME/.pen/ai21_api_key              # https://www.ai21.com/
echo "<hf key here>" > $HOME/.pen/hf_api_key                  # https://huggingface.co/
echo "<nlpcloud key here>" > $HOME/.pen/nlpcloud_api_key      # https://nlpcloud.io/
echo "<alephalpha key here>" > $HOME/.pen/alephalpha_api_key  # https://aleph-alpha.de/
echo "<cohere key here>" > $HOME/.pen/cohere_api_key          # https://cohere.ai/

# Add the scripts to the PATH
echo export PATH="$(realpath .)/pen.el/scripts:\$PATH" >> $HOME/.profile

# Add this to prevent C-s from freezing the terminal
echo "stty stop undef 2>/dev/null; stty start undef 2>/dev/null" | tee -a $HOME/.zshrc >> $HOME/.bashrc

# Source your .profile
. $HOME/.profile

# Run pen
pen

Assuming the key that you entered is the actual key, continue now to use Pen!

In this test, everything except Apostrophe seemed to be working on a clean installation. I have introduced a bug that I will fix soon. Done!

Running Pen.el exclusively within the docker container

You will need to source ~/.profile and setup-term.sh upon entering a container shell. From there, you may consult the run.sh command for initiating the pen daemons for the first time.

Advanced installation

These setup instructions are designed for Debian 10 or Ubuntu 20.04.

Dependencies

  • emacs 28

Tutorial

https://semiosis.github.io/posts/pen-tutorial/

AIx API key (for GPT-J-6b)

Get your key.

https://apps.aixsolutionsgroup.com/

OpenAI API key (for GPT-3)

You will need your own OpenAI API key.

The shell command openai-complete.sh requires OPENAI_API_KEY to be provided to at as an environment variable.

It’s up to you to provide this to the script.

./scripts/openai-complete.sh

Alternatively, the script will look for it here $HOME/.pen/openai_api_key.

Setup script for a Debian 10 docker image

./scripts/setup.sh

Adjust this script for your own installation.

Emacs .emacs / init.el

The following emacs init file contains the base requirements to run pen.el in a vanilla emacs.

./src/init.el

Configure pen.el

See the above init.el file for an example of where to load your config (after all dependencies are loaded).

Example emacs config

./src/pen-example-config.el

Running pen.el

This is tested to run on a Debian 10 docker image.

./scripts/run.sh

Add scripts to PATH

pen.el requires some external scripts to be in the path.