sammo  by microsoft

Library for prompt engineering and optimization

created 1 year ago
710 stars

Top 49.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

SAMMO is a Python library for prompt engineering and optimization, targeting researchers and developers who need to systematically improve LLM prompt performance. It offers a structure-aware approach to prompt modification and execution, enabling efficient data labeling, prompt prototyping, and instruction optimization.

How It Works

SAMMO treats prompts as programs, allowing manipulation via CSS-like selectors and Markdown parsing. This structure-aware approach facilitates multi-objective optimization, such as balancing prompt length and accuracy, using techniques like beam search. It supports parallel execution and rate limiting for large-scale LLM interactions.

Quick Start & Requirements

  • Install: pip install sammo jupyter
  • Prerequisites: Python 3.9+
  • To run tutorials: Clone the repository (git clone https://github.com/microsoft/sammo.git), cd sammo, and launch Jupyter Notebook (jupyter notebook --notebook-dir docs/tutorials).
  • Live demo available on Binder.

Highlighted Details

  • Supports prompt optimization via structure-aware metaprompting.
  • Enables efficient data labeling through minibatching.
  • Offers parallelization and rate-limiting for large-scale prompt execution.
  • Features recent updates for Markdown-to-program conversion and CSS selector-based prompt querying.

Maintenance & Community

The project is authored by Tobias Schnabel and welcomes contributions, requiring a Contributor License Agreement (CLA). It adheres to the Microsoft Open Source Code of Conduct.

Licensing & Compatibility

Licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

SAMMO is positioned as a tool for prompt optimization and large-scale execution, explicitly noting it is less suitable for interactive, agent-based or production-ready LLM applications, recommending AutoGen and LangChain respectively for those use cases.

Health Check
Last commit

1 month ago

Responsiveness

1+ week

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
2 more.

prompt-engine by microsoft

0.0%
3k
NPM library for LLM prompt engineering
created 3 years ago
updated 2 years ago
Feedback? Help us improve.