Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
ell is a lightweight, functional prompt engineering framework for Python that treats prompts as composable programs rather than static strings. Created by William Guss (formerly of OpenAI), it provides automatic versioning, visualization via Ell Studio, and multimodal support with a minimal, elegant API. It has 5.9K+ stars on GitHub and is licensed under MIT.
ell is built on the principle that prompts are programs, not strings. Every prompt is a Python function decorated with '@ell.simple' or '@ell.complex', turning LLM interactions into first-class, composable, versionable code. This functional approach enables developers to decompose complex AI tasks into modular, chainable language model programs (LMPs).
Core principles:
pip install -U "ell-ai[all]"
Basic usage with @ell.simple:
import ell # Initialize versioning store ell.init(store="./ell_store", autocommit=True) @ell.simple(model="gpt-4o-mini") def write_poem(topic: str) -> str: # System message set via docstring "You are a creative poet." return f"Write a short poem about {topic}" # Each call is traced, versioned, and logged poem = write_poem("distributed systems") print(poem) @ell.simple(model="gpt-4o") def summarize(text: str) -> str: "You are a concise summarizer." return f"Summarize in 2 sentences: {text}" # Chain LMPs together naturally summary = summarize(poem) print(summary)
Advanced usage with @ell.complex (tools, multimodal):
import ell from PIL import Image @ell.complex(model="gpt-4o") def describe_image(image: Image.Image) -> str: return [ ell.system("You are an image analyst."), ell.user(["Describe this image:", image]) ] # Multimodal: pass images directly img = Image.open("chart.png") description = describe_image(img) print(description.text) # Tool use with @ell.complex @ell.tool() def get_weather(city: str) -> str: "Get current weather for a city." return f"72F and sunny in {city}" @ell.complex(model="gpt-4o", tools=[get_weather]) def weather_assistant(query: str): return [ ell.system("Help users with weather queries."), ell.user(query) ] response = weather_assistant("Whats the weather in Tokyo?")
Ell Studio is a local web application that provides a visual interface for prompt engineering:
Launch with:
ell-studio --storage ./ell_store
ell uses lexical closures to automatically detect when an LMP changes. Every modification – prompt text, model parameters, or function logic – creates a new version with:
This enables empirical prompt optimization: compare version performance, revert regressions, and track iteration history without manual version control.
| ell | LangChain | |
|---|---|---|
| Philosophy | Prompts as functions | Chains as abstractions |
| Weight | Lightweight, minimal deps | Heavy, many dependencies |
| Versioning | Built-in auto-versioning | External (LangSmith) |
| Learning curve | Minimal – just decorators | Steep – many concepts |
| IDE support | Full (native Python) | Partial |
| Focus | Prompt engineering | Full LLM app framework |