Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ell
✓ import ell
✗ import ell
Initialize ell, define a prompt with @ell.simple, and call it.
import ell
import os
# Initialize ell with an API key
api_key = os.environ.get('OPENAI_API_KEY', '')
ell.init(api_key=api_key)
# Define a simple prompt
@ell.simple(model="gpt-4", temperature=0.7)
def hello(name: str):
"""You are a helpful assistant. Say hello to {name}."""
return f"Hello, {name}!"
# Run the prompt
response = hello("World")
print(response)
Debug
Known issues
breakingIn version 0.0.15+, the API for initializing ell changed from `ell.init(api_key=...)` to requiring explicit model provider setup. Older code using `ell.init()` without arguments will fail.fixUse `ell.init(api_key='...')` or configure providers via `ell.config`.
affects: <0.0.15
deprecatedThe `ell.llm` decorator is deprecated and will be removed in 0.1.0. Use `ell.simple` or `ell.complex` instead.fixReplace `@ell.llm` with `@ell.simple` for single-turn prompts or `@ell.complex` for multi-turn.
affects: >=0.0.14, <0.1.0
gotchaPrompt functions must return a string; returning a dict or list will cause a TypeError. The decorator expects a plain string output.fixEnsure the decorated function returns a string. Use f-strings or string formatting.
affects: all
Upgrade
Version history
0.0.17latest on PyPI · released Feb 25, 2025
Audit
Dependencies
openairequiredRequired for OpenAI model support. API client used internally.
anthropicoptionalRequired for Anthropic model support (Claude).