Microsoft’s prompt engine is a library for helping developers create prompts for Large Language Models (LLMs).

Prompt engineering, a technique for enabling specific behavior out of LLMs like GPT-3 and Codex, involves crafting inputs that coax the model to produce certain kinds of outputs. Also, few-shot prompting is a discipline that provides examples of inputs and outputs, so the model has a reference for the type of output desired.

Prompt engineering can include formatting a question and passing it to the model, but can also require substantial code to manipulate and update strings. 

Microsoft created this library to codify patterns and practices around prompt engineering, according to the project’s GitHub page

The library currently supports three distinct engines, one of which is Prompt Engine. The Code Engine creates prompts for Natural Language to Code scenarios and Chat Engine creates prompts with descriptions and examples.

The project offers a way to represent prompts as YAML and to load it into a prompt-engine class.