explaingit

madcowd/ell

5,871PythonAudience · developerComplexity · 2/5Setup · easy

TLDR

ell is a Python framework that lets you write language model prompts as regular Python functions, automatically tracking every input, output, and code version so you can compare and improve prompts over time.

Mindmap

mindmap
  root((repo))
    What It Does
      Prompts as functions
      Automatic versioning
      History capture
    Key Concepts
      Decorated functions
      Docstring as system msg
      Local store file
    Ell Studio
      Local web interface
      Side-by-side comparison
      Version browsing
    Multimodal Support
      PIL images
      Audio inputs
      Auto conversion
    Use Cases
      Prompt engineering
      LLM app development
      Prompt testing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Write language model prompts as typed Python functions with automatic version tracking and input/output history

USE CASE 2

Browse and compare different versions of your prompts side by side in the local Ell Studio web interface

USE CASE 3

Pass images or audio directly to prompt functions without writing any media conversion code

USE CASE 4

Test and iterate on prompts like regular Python code, with each change creating a new tracked version automatically

Tech stack

PythonPIL

Getting it running

Difficulty · easy Time to first run · 5min

Requires an API key for your chosen language model provider such as OpenAI.

In plain English

ell is a Python framework for writing prompts for language models as regular Python functions. Instead of treating a prompt as a text string you pass to an API, ell encourages you to define it as a decorated function where the docstring becomes the system message and the return value becomes the user message. This makes a prompt a first-class piece of code, with a name, arguments, and the ability to be tested, versioned, and called from anywhere in a program. When you call one of these functions, ell captures what was sent to the model, what came back, and which version of the function was used. It stores this history automatically in a local file called a store, without requiring any extra setup or a separate database. Versioning is based on the actual code of the function, so changing the prompt text or its logic creates a new version automatically, with commit messages generated by a small model. Ell Studio is a local web interface you launch from the command line to browse and compare saved versions. You can look at the inputs and outputs for each version side by side, track how a prompt changed over time, and identify which version produced the best results. The tool is open source and runs entirely on your own machine. Multimodal inputs are supported natively. You can pass PIL image objects, audio, or other media directly alongside text in the same function call, and ell handles the conversion into the format the model expects. The code examples in the README show a webcam image being described in a single function call with no extra conversion code. ell is installed as the ell-ai package via pip. The README links to documentation and a Discord community for support.

Copy-paste prompts

Prompt 1
Using ell, write a Python function decorated with @ell.simple that takes a product name and returns a one-sentence marketing tagline generated by GPT-4.
Prompt 2
Show me how to install ell-ai and write a basic prompt function that summarizes a text passage passed as an argument, with automatic history tracking.
Prompt 3
How do I launch Ell Studio from the command line to browse the version history and compare inputs and outputs of my prompt functions?
Prompt 4
Write an ell prompt function that accepts a PIL image object and asks a language model to describe what is shown in the image.
Prompt 5
Explain how ell's automatic versioning works by showing me a prompt function before and after I change its wording, and what gets stored in the local version history.
Open on GitHub → Explain another repo

← madcowd on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.