# Ell — Prompt Engineering as Code in Python > Treat prompts as versioned Python functions with automatic tracking, visualization, and A/B testing. Like Git for your AI prompts with a beautiful studio UI. ## Install Paste the prompt below into your AI tool: ## Quick Use ```bash pip install ell-ai ``` ```python import ell @ell.simple(model="claude-sonnet-4-20250514") def summarize(text: str) -> str: "You are a concise summarizer." return f"Summarize this: {text}" result = summarize("Long article text here...") print(result) ``` ## What is Ell? Ell treats prompts as versioned, typed Python functions instead of opaque strings. Every prompt call is automatically tracked with inputs, outputs, and metadata — viewable in Ell Studio, a local visualization tool. It brings software engineering practices (versioning, testing, monitoring) to prompt engineering. **Answer-Ready**: Ell is a Python library that treats AI prompts as versioned functions with automatic tracking, visualization in Ell Studio, and A/B testing. It brings software engineering practices to prompt engineering. 6k+ GitHub stars. **Best for**: Teams iterating on prompts who need versioning and analytics. **Works with**: OpenAI, Anthropic, any OpenAI-compatible API. **Setup time**: Under 2 minutes. ## Core Features ### 1. Prompts as Functions ```python import ell @ell.simple(model="claude-sonnet-4-20250514") def write_poem(topic: str) -> str: "You are a creative poet." return f"Write a short poem about {topic}" # Every call is tracked automatically poem = write_poem("sunset") ``` ### 2. Complex Prompts (Multi-Message) ```python @ell.complex(model="claude-sonnet-4-20250514") def chat(history: list[ell.Message]) -> list[ell.Message]: return [ ell.system("You are a helpful assistant."), *history, ] ``` ### 3. Ell Studio — Visual Dashboard ```bash ell-studio --storage ./ell_logs # Opens http://localhost:8000 ``` Studio shows: - Version history of each prompt function - Input/output pairs for every call - Latency and token usage metrics - Diff view between prompt versions ### 4. Automatic Versioning Ell detects when you change a prompt function and creates a new version: ```python # Version 1 @ell.simple(model="claude-sonnet-4-20250514") def greet(name: str): "You are friendly." return f"Say hi to {name}" # Version 2 (auto-detected) @ell.simple(model="claude-sonnet-4-20250514") def greet(name: str): "You are friendly and enthusiastic." return f"Enthusiastically greet {name}" ``` ### 5. Multimodal Support ```python from PIL import Image @ell.simple(model="gpt-4o") def describe_image(image: Image.Image): return [ ell.system("Describe this image in detail."), ell.user(["What do you see?", image]), ] ``` ## Why Use Ell? | Without Ell | With Ell | |-------------|----------| | Prompts as strings in code | Prompts as typed functions | | Manual copy-paste to track changes | Automatic version control | | No visibility into prompt performance | Studio dashboard with metrics | | Hard to compare prompt variants | Built-in A/B comparison | ## FAQ **Q: How does it compare to LangChain?** A: Ell is focused purely on prompt engineering — versioning, tracking, and iteration. LangChain is a broader framework for chains and agents. **Q: Does it work with Claude?** A: Yes, Anthropic Claude is fully supported. **Q: Where is the data stored?** A: Locally in SQLite (default: `./ell_logs/`). No data sent externally. ## Source & Thanks > Created by [William Guss](https://github.com/MadcowD). Licensed under MIT. > > [MadcowD/ell](https://github.com/MadcowD/ell) — 6k+ stars ## Quick Start ```bash pip install ell-ai ``` Define prompts with Python decorators — versions and calls are automatically tracked. ## What is Ell? Ell treats AI prompts as versioned Python functions. Every call is auto-tracked with inputs and outputs, viewable in the Ell Studio visualization dashboard. **In one sentence**: Ell is a Python library that manages prompts as versioned functions with automatic tracing, visualization, and A/B testing — 6k+ GitHub stars. **For**: Teams needing prompt version management and analytics. **Supports**: OpenAI, Anthropic, and compatible APIs. ## Core Features ### 1. Prompts as Functions Define with the `@ell.simple` decorator — automatically traced. ### 2. Ell Studio Visualization A local dashboard shows version history, call records, and performance metrics. ### 3. Automatic Versioning Modifying a prompt function automatically creates a new version. ### 4. Multimodal Support Supports mixed text + image inputs. ## FAQ **Q: How does it compare to LangChain?** A: Ell focuses on prompt engineering (versioning, tracing, iteration); LangChain is a broader framework. **Q: Where is the data stored?** A: Local SQLite — nothing is sent externally. ## Source & Thanks > [MadcowD/ell](https://github.com/MadcowD/ell) — 6k+ stars, MIT --- Source: https://tokrepo.com/en/workflows/ell-prompt-engineering-code-python-603314fc Author: Script Depot