sammo  by microsoft

Library for prompt engineering and optimization

Created 1 year ago
729 stars

Top 47.3% 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

2 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 30 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
6 more.

prompt-engine by microsoft

0.1%
3k
NPM library for LLM prompt engineering
Created 3 years ago
Updated 2 years ago
Starred by Clement Delangue Clement Delangue(Cofounder of Hugging Face), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
10 more.

promptsource by bigscience-workshop

0.2%
3k
Toolkit for creating, sharing, and using natural language prompts
Created 4 years ago
Updated 1 year ago
Feedback? Help us improve.