microsoft

poml: Structure and Render Prompts for Language Models

POML is a markup language and toolkit for building structured, reusable prompts for large language models. It combines templating, data components, styling, and development tools for teams managing prompts in code.

Stars
5k
Forks
256
Stars, last 7 days
+1

Our take

Health score

24/100

How it is scored
Activity
20
Community
32
Issues
21
Pull requests
21

+1 stars in the last 7 days

Overview

POML gives developers a structured way to author prompts for large language models, addressing prompts that become difficult to maintain as instructions, examples, formatting, and external data accumulate. Its markup organizes prompt content into components and can render that content for use in applications.

It is aimed at developers building LLM applications who want reusable, data-driven prompts and a development workflow beyond assembling plain text. It makes sense when prompts need variables, conditional or repeated content, mixed data types, or presentation changes that should not alter the core prompt.

Key Features

  • HTML-like semantic components organize roles, tasks, examples, and output instructions.
  • Data components support embedding or referencing materials such as text files, spreadsheets, and images.
  • CSS-like styles separate presentation choices from prompt content.
  • Templates support variables, loops, conditionals, and variable definitions.
  • A Visual Studio Code extension provides highlighting, completion, documentation, previews, diagnostics, and interactive testing.
  • Node.js and Python SDKs support integration into application workflows.

Use Cases

  • LLM application developers can maintain prompts with distinct roles, tasks, examples, and output requirements.
  • Teams can generate prompts from changing inputs using variables, loops, and conditionals.
  • Applications that pass documents, tables, or images to models can organize those materials alongside prompt instructions.
  • Prompt authors can adjust formatting or verbosity separately from the underlying instructions.
  • VS Code users can preview and test prompts during development, provided they configure a model provider and credentials.

Getting Started

Install the package for your runtime:

npm install pomljs
pip install poml

For syntax, SDK, and extension details, see the README and documentation.

Alternatives

  • genaiscript: GenAIScript uses JavaScript or TypeScript to assemble prompts and orchestrate models, tools, and data; POML focuses on markup-based prompt structure and reuse.
  • py-priompt: PyPriompt composes prompts in Python and selects components to fit token limits; POML provides a markup language and toolkit for structured, reusable prompts.
ProjectLanguageLicenseStarsStatus
pomlTypeScriptMIT5kNot checked yet
genaiscriptTypeScriptMIT2.9kArchived
py-priomptPythonOther65Inactive

Considerations

  • Prompt testing through the VS Code extension requires a configured model provider, API key, and endpoint; these are not supplied by POML.
  • The repository describes a prompt authoring and rendering toolkit, not a hosted model service.
  • Supporting complex prompt workflows introduces a markup syntax and templating layer that users need to learn.
  • The project is MIT-licensed and is not marked as archived in the supplied repository details.

Found this useful?

Share it with someone who would like poml.

Comparisons