What is ell?
ell
is a unique command-line interface (CLI) specifically crafted to interact with Large Language Models (LLMs) through Bash scripting. This project allows users to communicate efficiently with LLMs directly from their terminal.
Key Features
- Interactive Terminal Use: Users can ask questions or send queries to LLMs from their terminal, making it a convenient way to access powerful AI models without needing a graphical interface.
- Pipeline Friendliness:
ell
can be integrated with other commands and scripts, allowing seamless data flow between different command-line applications. - Contextual Queries: Users can bring the current terminal context to LLMs, enabling more relevant and situation-aware responses from the models.
- Function Calling: Through versatile templates,
ell
supports function calls, enhancing its capability to handle complex queries and tasks.
System Requirements
To utilize ell, the following tools are required:
- Bash (4.1 or later): The script relies on newer versions of Bash along with coreutils or OS X utilities.
- JSON Parsing (jq): Required for handling JSON data structure.
- HTTPS Requests (curl): Used for sending data over HTTPS.
- Optionally, perl and util-linux are needed if you want to use record mode features for advanced input/output tracking.
How to Install ell
Installation is straightforward. Clone the ell
repository into a directory of your choice and append the path to your system's PATH variable:
git clone --depth 1 https://github.com/simonmysun/ell.git ~/.ellrc.d
echo 'export PATH="${HOME}/.ellrc.d:${PATH}"' >> ~/.bashrc
After following these steps, ell
should be installed and accessible from your terminal.
Configuration
Configuration involves setting up access to specific language models. For instance, to use Google's gemini-1.5-flash
, you need to define parameters like model, template, API key, and URL in the ~/.ellrc
file. Similarly, you can set up gpt-4o-mini
from OpenAI by adjusting the configuration file accordingly.
Examples of Usage
Before using ell
, ensure proper configuration. Here are some typical commands:
-
Simple Queries: Ask a straightforward question:
ell "What is the capital of France?"
-
Model-Specific Query with File Input: Use a specific model and read from a file:
ell -m gpt-4o -f user_prompt.txt
-
Stdin Input: You can pipe data directly from standard input:
cat somecode.py | ell -f -
-
Interactive Mode: Engage in a live interaction with context recording:
ell -i
Creating Templates
ell
utilizes templates for more structured and functional interactions with LLMs. Details on writing and utilizing templates are available in the project's template documentation.
Plugins and Customization
The project supports plugins enhancing functionality by allowing additional scripts to work with ell
. Users can implement plugins to expand the interaction capabilities with LLM providers.
Risks Consideration
Understand the potential risks when using third-party APIs and handling sensitive data. Users are advised to review the Risks Consideration document for detailed information.
FAQs
-
Naming: The name "ell" combines "shell" and "LLM," emphasizing its role as a shell-based LLM interfacing tool. Its simplicity and lack of conflict with existing software make it effective for command line use.
-
Why Bash?: Bash is widely available on Unix-like systems, making it an ideal platform for the lightweight and straightforward needs of
ell
.
Similar Projects
Other projects offer command-line interaction with LLMs across various languages and frameworks, such as gpt-cli
in Python, chatgpt-cli
in Go, and others in Node.js and TypeScript.
Contributing to ell
Developers and enthusiasts are encouraged to contribute by suggesting improvements, reporting bugs, or sharing their own enhancements to the project.
License
ell
is open-source, offered under the MIT License, allowing for broad usage and distribution. Check the LICENSE file for further details.