Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MadcowD/ell
A language model programming framework.
https://github.com/MadcowD/ell
Last synced: 3 months ago
JSON representation
A language model programming framework.
- Host: GitHub
- URL: https://github.com/MadcowD/ell
- Owner: MadcowD
- License: mit
- Created: 2024-07-22T01:08:02.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-11T21:29:37.000Z (3 months ago)
- Last Synced: 2024-09-11T22:17:43.146Z (3 months ago)
- Language: Python
- Size: 23 MB
- Stars: 860
- Watchers: 5
- Forks: 46
- Open Issues: 64
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- StarryDivineSky - MadcowD/ell - 4o-mini自动生成的提交消息,将提示的自动版本控制和序列化直接发送到本地存储。此过程类似于机器学习训练循环中的检查点,但它不需要任何特殊的 IDE 或编辑器 - 全部使用常规 Python 代码完成。3. 用于监控、版本控制和可视化的工具。使用正确的工具,Prompt 工程从一门黑暗的艺术变成了一门科学。Ell Studio 是一个本地开源工具,用于提示版本控制、监控、可视化。使用 Ell Studio,您可以随着时间的推移经验化您的提示优化过程,并在为时已晚之前捕获回归。4. 多模态应该是一流的。LLMs 可以处理和生成各种类型的内容,包括文本、图片、音频和视频。使用这些数据类型进行提示工程应该像使用文本一样简单。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
README
--------------------------------------------------------------------------------
[![Documentation Status](https://img.shields.io/badge/documentation-go)](https://docs.ell.so/) [![Install](https://img.shields.io/badge/get_started-blue)](https://docs.ell.so/installation) [![Discord](https://dcbadge.limes.pink/api/server/vWntgU52Xb?style=flat)](https://discord.gg/vWntgU52Xb) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/wgussml)](https://x.com/wgussml)
```bash
pip install -U ell-ai
````ell` is a lightweight, functional prompt engineering framework built on a few core principles:
### 1. Prompts are programs, not strings.
Prompts aren't just strings; they are all the code that leads to strings being sent to a language model. In `ell` we think of one particular way of using a language model as a discrete subroutine called a **language model program**.
```python
import ell@ell.simple(model="gpt-4o")
def hello(world : str):
"""You are a helpful assistant that writes in lower case.""" # System Message
return f"Say hello to {world[::-1]} with a poem." # User Messagehello("sama")
```![alt text](https://docs.ell.so/_static/gif1.webp)
### 2. Prompts are actually parameters of a machine learning model.
The process of prompt engineering involves many iterations, similar to the optimization processes in machine learning. Because LMPs are just functions, `ell` provides rich tooling for this process.
![ell demonstration](https://docs.ell.so/_static/versions_small.webp)
`ell` provides **automatic versioning and serialization of prompts** through static and dynamic analysis and `gpt-4o-mini` **autogenerated commit messages** directly to a *local store*. This process is similar to `checkpointing` in a machine learning training loop, but it doesn't require any special IDE or editor - it's all done with regular Python code.
### 3. Tools for monitoring, versioning, and visualization
Prompt engineering goes from a dark art to a science with the right tools. **Ell Studio is a local, open source tool for prompt version control, monitoring, visualization**. With Ell Studio you can empiricize your prompt optimization process over time and catch regressions before it's too late.
```bash
ell-studio --storage ./logdir
```### 4. Multimodality should be first class
LLMs can process and generate various types of content, including text, images, audio, and video. Prompt engineering with these data types should be as easy as it is with text.
```python
from PIL import Image
import ell@ell.simple(model="gpt-4o", temperature=0.1)
def describe_activity(image: Image.Image):
return [
ell.system("You are VisionGPT. Answer <5 words all lower case."),
ell.user(["Describe what the person in the image is doing:", image])
]# Capture an image from the webcam
describe_activity(capture_webcam_image()) # "they are holding a book"
```
![ell demonstration](https://docs.ell.so/_static/multimodal_compressed.webp)`ell` supports rich type coercion for multimodal inputs and outputs. You can use PIL images, audio, and other multimodal inputs inline in `Message` objects returned by LMPs.
### ...and much more!
Read more in the [docs](https://docs.ell.so/)!
## Installation
To install `ell` and `ell studio`, you can use pip. Follow these steps:1. Open your terminal or command prompt.
2. Run the following command to install the `ell-ai` package from PyPI:```bash
pip install ell-ai
```3. Verify the installation by checking the version of `ell`:
```bash
python -c "import ell; print(ell.__version__)"
```This will install both `ell` and `ell studio` on your system, allowing you to start using the tools for prompt engineering and visualization.
## Next Steps
Explore the [documentation](https://docs.ell.so/) to learn more about `ell` and its features. Follow the [Getting Started guide](https://docs.ell.so/getting_started.html) to create your first Language Model Program. Join our [Discord community](https://discord.gg/vWntgU52Xb) to connect with other users and get support.