Repolode
microsoft

microsoft/prompty

A markdown file format for LLM prompts, with Python, TypeScript, Rust, C# and other runtimes plus a VS Code extension for running and tracing them.

Stars
1,286
Forks
135
Open issues
23
Last commit
5 days ago

What is it?

Prompty is a file format and asset class for LLM prompts. A `.prompty` file combines YAML frontmatter, which holds the model, connection, inputs and tools, with a markdown body that defines system, user and assistant messages using Jinja2 or Mustache templates. The goal is to keep prompts portable and easy to inspect, so the same file can be moved between applications and runtimes without changing the prompt text.

The project ships runtimes for Python, TypeScript, Rust, C#, Java, Go and Swift, with provider packages for OpenAI, Microsoft Foundry and Anthropic. A VS Code extension adds a connections sidebar, live preview, chat mode and a trace viewer that records render, parse and model-call steps. Version 2 also adds an agentic turn loop that executes model-requested tools and returns a final answer.

An OpenAI-compatible endpoint can be set through the connection configuration, so the same prompt can target gateways or self-hosted model servers by changing environment variables.

Key features

  • 01Defines prompts as `.prompty` files with YAML frontmatter and markdown role blocks.
  • 02Supports Jinja2 and Mustache templates and `${env:VAR}` variable references.
  • 03Provides runtimes for Python, TypeScript, Rust, C#, Java, Go and Swift.
  • 04Includes provider packages for OpenAI, Microsoft Foundry and Anthropic.
  • 05VS Code extension with live preview, chat mode and trace viewer.
  • 06Agentic turn loop that runs model-requested tools until a final response.

Use cases

  • Keeping prompts in version control as readable files separate from application code.
  • Running the same prompt from VS Code during development and from a Python or TypeScript service in production.
  • Debugging prompt rendering and model calls with trace files.
  • Routing prompts through an OpenAI-compatible gateway or self-hosted model server.

Quick start

  1. 1

    Write a .prompty file with model config and a markdown prompt body

  2. 2

    Install the Python package with OpenAI support

    uv pip install "prompty[jinja2,openai]"
  3. 3

    Run the prompt from Python with prompty.invoke

  4. 4

    Or install the TypeScript packages with OpenAI support

    npm install @prompty/core @prompty/openai

Things to know

  • Prompty v2 is newer, and the README asks for feedback on it.
  • Running the examples needs an OpenAI or other provider API key.

In collections

Topics

FAQ

What is prompty?
A markdown file format for LLM prompts, with Python, TypeScript, Rust, C# and other runtimes plus a VS Code extension for running and tracing them. Prompty is a file format and asset class for LLM prompts. A `.prompty` file combines YAML frontmatter, which holds the model, connection, inputs and tools, with a markdown body that defines system, user and assistant messages using Jinja2 or Mustache templates. The goal is to keep prompts portable and easy to inspect, so the same file can be moved between applications and runtimes without changing the prompt text.
Is prompty free to use? What license does it have?
prompty is open source under the MIT license. Check the license terms before using it in commercial products.
Is prompty still maintained?
Actively maintained. The last commit to prompty was on Nov 2, 2026.
What can I use prompty for?
Keeping prompts in version control as readable files separate from application code. Running the same prompt from VS Code during development and from a Python or TypeScript service in production. Debugging prompt rendering and model calls with trace files. Routing prompts through an OpenAI-compatible gateway or self-hosted model server.
How do I install prompty?
Write a .prompty file with model config and a markdown prompt body Install the Python package with OpenAI support: uv pip install "prompty[jinja2,openai]" Run the prompt from Python with prompty.invoke Or install the TypeScript packages with OpenAI support: npm install @prompty/core @prompty/openai
Where can I get prompty?
The source code and installation instructions are on GitHub: https://github.com/microsoft/prompty

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects