Home

Awesome

ell

A command-line interface for LLMs written in Bash.

Features

<video src="https://github.com/user-attachments/assets/dce8ce33-c948-4db3-83db-8f8e2f1cb6a1"></video>

Basic usage of ell (webm, 1,6MiB)

Requirements

To use ell, you need the following:

Install

git clone --depth 1 https://github.com/simonmysun/ell.git ~/.ellrc.d
echo 'export PATH="${HOME}/.ellrc.d:${PATH}"' >> ~/.bashrc

or

git clone --depth 1 git@github.com:simonmysun/ell.git ~/.ellrc.d
echo 'export PATH="${HOME}/.ellrc.d:${PATH}"' >> ~/.bashrc

This will clone the repository into .ellrc.d in your home directory and add it to your PATH.

Configuration

See Configuration.

Here's an example configuration to use gemini-1.5-flash from Google. You need to set these variables in your ~/.ellrc:

ELL_API_STYLE=gemini
ELL_LLM_MODEL=gemini-1.5-flash
ELL_TEMPLATE=default-gemini
ELL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ELL_API_URL=https://generativelanguage.googleapis.com/v1beta/models/

Here's an example configuration to use gpt-4o-mini from OpenAI.

ELL_API_STYLE=openai
ELL_LLM_MODEL=gpt-4o-mini
ELL_TEMPLATE=default-openai
ELL_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ELL_API_URL=https://api.openai.com/v1/chat/completions

Usage examples

Make sure you have configured correctly.

Ask a question:

ell "What is the capital of France?"

Specify a model and use a file as input:

ell -m gpt-4o -f user_prompt.txt

reading from stdin is also supported:

cat somecode.py | ell -f -

If you prefer add another piece of prompt instantly instead of adding it in the template:

(cat somecode.py; echo "Explain this code") | ell -f -

Record terminal input and output and use as context:

ell -r
# do random stuff
ell What does the error code mean?
ell How to fix it?

Run in interactive mode:

ell -i

In interactive mode, record mode is automatically enabled to allow you chat with context.

Specify a template and start in record mode and interactive mode:

ell -r -i -t ctf-gemini

or

ell -r -i -t ctf-openai

depends on which API you are using.

<video src="https://github.com/user-attachments/assets/afb85632-fa0e-405e-afd8-57d22bd9439d"></video>

Example application of a capture the flag game (webm, 2.6MiB)

Writing Templates

See Templates.

Note that the use of the plugin support of LLM providers in ell is made with templates.

Styling

See Styling.

Plugins

See Plugins.

The term "Plugin" here means a script that can be called by ell. It can be used to extend ell's functionality. The plugins supported by LLM providers is not included here. Please refer to Templates.

Risks to consider

See Risks Consideration.

Q&A

Similar Projects

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.