poml

microsoftMIT更新放缓

用类 HTML 的标记语言来组织 LLM 提示词,把散落在代码里的 prompt 拆成可复用、可维护的模块,并配套 VS Code 扩展方便编写和调试。

Prompt Orchestration Markup Language

v0.0.8发布于 2025-08-25 05:52 UTC4,962star253fork同步于 2026-11-10 11:36 UTC

怎么上手

由 README 提炼,执行前请确认
pip install poml
npm install pomljs
硬件要求按 README 说明

README 未说明;提示词测试需自行配置 LLM 模型、API key 和 endpoint

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用类 HTML 标记语言组织 LLM 提示词,解决提示词结构混乱、数据难集成和格式敏感问题

用类 HTML 的标记语言来组织 LLM 提示词,把散落在代码里的 prompt 拆成可复用、可维护的模块,并配套 VS Code 扩展方便编写和调试。

核心能力

  • 用 role、task、example 等语义组件模块化组织提示词
  • 用 document、table、img 组件嵌入外部文本、表格和图片
  • 用 CSS 式 stylesheet 分离内容与呈现,缓解格式敏感
  • 内置模板引擎支持变量、for 循环、if 条件与 let 定义
  • 提供 VS Code 扩展与 Node.js、Python SDK

容易踩的坑

VS Code 扩展测试提示词前必须先配置模型提供方、API key 和 endpoint,否则无法运行;示例中引用的图片需与 .poml 文件放在同一目录;Python 本地开发安装需先克隆仓库再执行 pip install -e .

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

4 个版本v0.0.8
  1. v0.0.8POML v0.0.8pre-release最新正式版2025-08-25 · 2025-08-25 05:52 UTC

    Summary: Version 0.0.8 includes 52 merged pull requests from July–August 2025. This release incorporates numerous issue resolutions, new feature requests, and contributions from three new external contributors. If no critical issues are reported, this will be the final pre-release.

    Highlights

    • Token Management: Introduced token counting and controls via charLimit, tokenLimit, and priority. Documentation
    • Meta Enhancements: Added support for output schemas, tool definitions, and per-file runtime configuration. Documentation
    • OpenAI Chat Format Integration: Details
    • MCP Integration (Preview): Details
    • Ecosystem Integrations: Added support for LangChain, MLflow, AgentOps, and Weave.
    • Tutorial: New example for building a travel expense agent. Documentation
    • Tracing Improvements: Increased robustness and usability. Documentation
    • VS Code CodeLens: Added CodeLens support for template local debugging. Documentation
    • VS Code Testing: Enhanced Test command reliability with Vercel AI SDK and multi-provider support. Documentation

    Complete PR List

  2. v0.0.7POML v0.0.7pre-release2025-07-25 · 2025-07-25 10:25 UTC
    查看更新说明

    Highlights

    • Preview now supports a customized context and stylesheet that can be dynamically attached and configured.
    • Tracing is now alive. Use trace to debug and test POML living in a large agent application.
    • @poml comes into VSCode Copilot in a beta stage. Try @poml /ask and @poml /edit. Explore the prompt gallery.
    • Token counts of the messages are added to the live preview.
    • Supports enabling/disabling components and specifying min/maxVersion (beta stage).

    What's Changed

    Full Changelog: https://github.com/microsoft/poml/compare/v0.0.6...v0.0.7

  3. v0.0.6POML v0.0.6pre-release2025-07-04 · 2025-07-04 09:57 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/microsoft/poml/compare/v0.0.5...v0.0.6

  4. v0.0.5POML v0.0.5pre-release2025-06-05 · 2025-06-05 10:44 UTC
    查看更新说明

    This is the pre-release before we actually push to public channels. Please use it as a preview of POML features.

    To install the VSCode extension, download the .vsix package and click "install from VSIX" in your extension manager (thanks to stackoverflow for the image).

    image

    To install the Python SDK, use pip install poml-0.0.5-py3-none-any.whl in command line. I haven't confirmed the usability of the package yet. Development installation is still recommended.

    Node.JS SDK is not packed in this pre-release.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    POML: Prompt Orchestration Markup Language

    Documentation VSCode Extension PyPI npm (latest) Test Status License: MIT Discord

    POML (Prompt Orchestration Markup Language) is a novel markup language designed to bring structure, maintainability, and versatility to advanced prompt engineering for Large Language Models (LLMs). It addresses common challenges in prompt development, such as lack of structure, complex data integration, format sensitivity, and inadequate tooling. POML provides a systematic way to organize prompt components, integrate diverse data types seamlessly, and manage presentation variations, empowering developers to create more sophisticated and reliable LLM applications.

    Demo Video

    The 5-minute guide to POML

    Key Features

    • Structured Prompting Markup: Employs an HTML-like syntax with semantic components such as <role>, <task>, and <example> to encourage modular design, enhancing prompt readability, reusability, and maintainability.
    • Comprehensive Data Handling: Incorporates specialized data components (e.g., <document>, <table>, <img>) that seamlessly embed or reference external data sources like text files, spreadsheets, and images, with customizable formatting options.
    • Decoupled Presentation Styling: Features a CSS-like styling system that separates content from presentation. This allows developers to modify styling (e.g., verbosity, syntax format) via <stylesheet> definitions or inline attributes without altering core prompt logic, mitigating LLM format sensitivity.
    • Integrated Templating Engine: Includes a built-in templating engine with support for variables ({{ }}), loops (for), conditionals (if), and variable definitions (<let>) for dynamically generating complex, data-driven prompts.
    • Rich Development Toolkit:
      • IDE Extension (Visual Studio Code): Provides essential development aids like syntax highlighting, context-aware auto-completion, hover documentation, real-time previews, inline diagnostics for error checking, and integrated interactive testing.
      • Software Development Kits (SDKs): Offers SDKs for Node.js (JavaScript/TypeScript) and Python for seamless integration into various application workflows and popular LLM frameworks.

    Quick Start

    Here's a very simple POML example. Please put it in a file named example.poml. Make sure it resides in the same directory as the photosynthesis_diagram.png image file.

    <poml>
      <role>You are a patient teacher explaining concepts to a 10-year-old.</role>
      <task>Explain the concept of photosynthesis using the provided image as a reference.</task>
    
      <img src="https://raw.githubusercontent.com/microsoft/poml/HEAD/photosynthesis_diagram.png" alt="Diagram of photosynthesis" />
    
      <output-format>
        Keep the explanation simple, engaging, and under 100 words.
        Start with "Hey there, future scientist!".
      </output-format>
    </poml>
    

    This example defines a role and task for the LLM, includes an image for context, and specifies the desired output format. With the POML toolkit, the prompt can be easily rendered with a flexible format, and tested with a vision LLM.

    Installation

    Visual Studio Code Extension

    Install from Visual Studio Code Marketplace.

    You can also install the extension manually by downloading the .vsix file from our GitHub releases page and installing it in VS Code via the Extensions view.

    Before testing prompts with the POML toolkit, make sure you have configured your preferred LLM model, API key, and endpoint. If these are not set, prompt testing will not work.

    To configure in Visual Studio Code:

    • Open the extension settings (open "Settings" and search for "POML").
    • Set your model provider (e.g., OpenAI, Azure, Google), API key, and endpoint URL in the POML section.
    • Alternatively, you can add these settings directly to your settings.json file.

    Node.js (via npm)

    npm install pomljs
    

    Python (via pip)

    pip install poml
    

    For development or local installation, you might use pip install -e . from a cloned repository.

    Refer to the documentation for more details on installing the nightly build.

    Documentation

    For detailed information on POML syntax, components, styling, templating, SDKs, and the VS Code extension, please refer to our documentation.

    Learn More

    Citation

    If you find POML useful or related to your research, please cite the following paper:

    @misc{zhang2025promptorchestrationmarkuplanguage,
          title={Prompt Orchestration Markup Language},
          author={Yuge Zhang and Nan Chen and Jiahang Xu and Yuqing Yang},
          year={2025},
          eprint={2508.13948},
          archivePrefix={arXiv},
          primaryClass={cs.HC},
          url={https://arxiv.org/abs/2508.13948},
    }
    

    Ecosystem & Community Projects

    • mini-poml-rs – Experimental Rust-based POML renderer for environments without JavaScript or Python interpreters.
    • poml-ruby – Ruby gem implementation of POML for Ruby applications.
    • ai-chatbot-with-python-and-angular – A chatbot built with Python and Angular (version 20), utilizing POML for prompting and the Langchain framework. Developed by HERE AND NOW AI.
    • PomlSDK.jl – Julia implementation of the POML specification.

    Contributing

    This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

    When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

    This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

    Trademarks

    This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

    Responsible AI

    This project has been evaluated and certified to comply with the Microsoft Responsible AI Standard. The team will continue to monitor and maintain the repository, addressing any severe issues, including potential harms, if they arise. For more details, refer to the Responsible AI Readme.

    License

    This project is licensed under the MIT License. See the LICENSE file for details.