Ape  by weavel-ai

Open-source library for AI prompt engineering

created 1 year ago
400 stars

Top 73.4% on sourcepulse

GitHubView on GitHub
Project Summary

Ape is an open-source library designed for AI prompt engineering, offering a modular framework to implement, benchmark, and compare state-of-the-art prompt optimization techniques. It targets researchers and developers seeking to streamline experimentation and foster collaborative advancements in prompt engineering methodologies.

How It Works

Ape provides a unified Trainer class, enabling clean, single-file implementations of various prompt optimization methods. Its modular architecture, particularly within ape-common, facilitates easy extension for custom techniques. The library includes a diverse benchmarking suite covering SQL, reasoning, mathematical, and classification tasks, with plans for more benchmarks.

Quick Start & Requirements

  • Install via pip: pip install ape-core
  • Requires Python.
  • Example usage involves importing Prompt and a Trainer (e.g., FewShotTrainer), defining a Generator and Metric, and calling the train method.
  • See Example Experiment Code for detailed tutorials.

Highlighted Details

  • Implements techniques from papers like DSPy-MIPRO and EvoPrompt.
  • Includes community implementations such as Few-Shot, TextGradient, and Optuna trainers.
  • Benchmarks include bird-bench (SQL), gpqa (Reasoning), MATH, boolq (Question Answering), and NYT (Classification).
  • Aims to implement every paper on prompt optimization or automated prompt engineering.

Maintenance & Community

  • Contributions are welcomed for paper implementations, benchmarks, community research, and general improvements.
  • Join the Weavel Community Discord for support and discussion.

Licensing & Compatibility

  • Released under the MIT License.
  • Permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

The provided example requires users to implement their own Generator and Metric classes, indicating that core components for training are abstract and need user-defined implementations.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
26 stars in the last 90 days

Explore Similar Projects

Starred by John Yang John Yang(Author of SWE-bench, SWE-agent), Lysandre Debut Lysandre Debut(Chief Open-Source Officer at Hugging Face), and
3 more.

cleanrl by vwxyzjn

0.5%
8k
RL algorithms implementation with research-friendly features
created 6 years ago
updated 3 weeks ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Nathan Lambert Nathan Lambert(AI Researcher at AI2), and
1 more.

tianshou by thu-ml

0.1%
9k
PyTorch RL library for algorithm development and application
created 7 years ago
updated 1 day ago
Feedback? Help us improve.