█

AI/TLDR

Buy me a coffee
Buy me a coffee

Prompty

A markdown file format for LLM prompts, with runtimes in several languages and a VS Code extension

Prompt ProgrammingOpen source
Latest
python/2.0.0
Updated
10 Sep 2026
Language
Python, TypeScript, Rust, C#
License
MIT

What's new

python/2.0.010 Sep 2026

The Python runtime graduated to 2.0.0, bringing the v2 rebuild with agent-loop resilience, context compaction, agent memory and structured result casting.

IN SHORT

What is Prompty?

Prompty is an open-source project from Microsoft that defines a markdown file format, .prompty, for LLM prompts. It sits in the Prompt Programming category of the App Orchestration tools and is open-source, written in Python, TypeScript, Rust, C# and licensed MIT. To get started: write a .prompty file.

Updated Markdown version ↗

Overview

Prompty is an open-source project from Microsoft that defines a markdown file format, .prompty, for LLM prompts. A .prompty file has two parts: YAML frontmatter that holds the model configuration, inputs and tools, and a markdown body that holds the prompt itself, split into messages by system:, user: and assistant: role markers and filled in with Jinja2 or Mustache template syntax.

VS Code with a .prompty file open on the left and the Prompty live preview on the right showing the rendered system and user messages with their filled-in inputs
Live preview renders the template and inputs into the exact messages the model will receivePrompty README ↗

The idea is to write a prompt once and run it anywhere Prompty runs. The same file can be executed from the VS Code extension or from a language runtime: packages exist for Python, TypeScript, Rust and C#, with Java, Go and Swift runtimes in the repo, and the runtimes are kept aligned by shared generated model types and cross-runtime conformance vectors. Each runtime runs the same pipeline: load the file, render the template, parse it into messages, execute the call against a provider (OpenAI, Microsoft Foundry or Anthropic) and process the response.

Flow diagram: a .prompty file (markdown plus YAML frontmatter) goes to a runtime that renders, parses, executes and processes it, which calls an LLM provider such as OpenAI, Foundry or Anthropic
The pipeline every Prompty runtime runs: render, parse, execute, processPrompty README ↗

Prompty v2 adds an agentic turn runtime on top of the plain prompt asset. Tools are declared in the frontmatter, the actual functions are bound in host code, and calling turn() instead of invoke() lets the model loop through tool calls before returning a final answer, with guardrails, retries, cancellation, context budgets and memory handled in code rather than prompt text. Every render, parse, model call and tool call can be written to a trace file for inspection.

What it does

  • One .prompty file holds the model config, inputs, tools and the prompt body, using YAML frontmatter plus markdown with system/user/assistant role markers
  • Jinja2 or Mustache templating, plus ${env:VAR}, ${env:VAR:default} and ${file:path.json} references for secrets and data
  • Runtimes for Python, TypeScript, Rust and C# (with Java, Go and Swift in the repo), kept aligned by shared conformance vectors
  • Providers for OpenAI, Microsoft Foundry and Anthropic; the openai provider can also target any OpenAI-compatible endpoint via model.connection.endpoint
  • VS Code extension with New Prompty scaffolding, live preview, a connections sidebar, chat mode with tool calling and F5 to run
  • Every execution writes a .tracy trace showing render, parse, execute and process steps with timing, token counts and payloads
Prompty trace viewer in VS Code showing a tree of pipeline steps with token counts and timings, and the input and output JSON of a chat completion call
A .tracy trace breaks one run into its render, parse, model and tool-call stepsPrompty README ↗

Getting started

Write a .prompty file, then run it from Python, TypeScript or VS Code. The commands and code below are taken from the project README.

Write a .prompty file

Put the model and template settings in the frontmatter and the prompt in the body. The API key is read from an environment variable.

yamlyaml
---
name: greeting
model:
  id: gpt-4o-mini
  provider: openai
  connection:
    kind: key
    apiKey: ${env:OPENAI_API_KEY}
template:
  format:
    kind: jinja2
  parser:
    kind: prompty
---
system:
You are a friendly assistant.

user:
Say hello to {{name}}.

Install the Python runtime

Install the package with the Jinja2 and OpenAI extras (other extras: foundry, anthropic, or all).

bashbash
uv pip install "prompty[jinja2,openai]"

Run it from Python

Invoke the file with its inputs.

pythonpython
import prompty

result = prompty.invoke("greeting.prompty", inputs={"name": "Jane"})
print(result)

Or run it from TypeScript

Install the core package plus a provider package with npm install @prompty/core @prompty/openai; importing the provider registers it.

tsts
import { invoke } from "@prompty/core";
import "@prompty/openai";

const result = await invoke("greeting.prompty", { name: "Jane" });
console.log(result);

Or run it in VS Code

With the Prompty extension installed, open the .prompty file and press F5. Right-click in the explorer and choose New Prompty to scaffold a new file; prompts with a thread input open an interactive chat panel.

Prompty chat panel in VS Code beside an agent .prompty file, showing a user question about Seattle weather, a get_current_weather tool call and the assistant's answer
Chat mode opens for thread-enabled prompts and shows each tool call inlinePrompty README ↗

Step through the pipeline

invoke() runs the whole load, render, parse, execute, process pipeline; the step-by-step functions let you inspect the messages before sending them.

pythonpython
agent = prompty.load("my-prompt.prompty")
messages = prompty.prepare(agent, inputs={...})
result = prompty.run(agent, messages)

Let the model call tools with turn()

Declare tools in the frontmatter, bind the real functions in code, and call turn() so the runtime loops through tool calls until the model returns a final answer.

pythonpython
from prompty import turn

result = turn(
    "agent.prompty",
    inputs={"question": "What's the weather in Seattle?"},
    tools={"get_weather": get_weather},
)

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Keeping prompts as versioned files in a repo, with model settings and inputs next to the prompt text instead of buried in application code
  • Sharing the same prompt asset between a Python service, a TypeScript app and other runtimes without rewriting it
  • Iterating on a prompt inside VS Code with live preview, chat mode and a trace viewer before wiring it into an app
  • Building small tool-calling agents whose tools, memory and guardrails are declared once and run on any Prompty runtime

How Prompty compares

Prompty alongside other open-source prompt programming tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Prompt Optimizer★ 42.9kA prompt optimization workbench that rewrites system and user prompts, then tests and compares the versions side by side; ships as a web app, desktop app, Chrome extension, Docker image and MCP server.
DSPy★ 39.3kA Stanford framework for programming language models with composable modules and automatic prompt optimization instead of hand-written prompts.
GEPA★ 7.6kA reflective, evolutionary optimizer that improves prompts and other text components of a system using language-model feedback.
ell★ 5.8kA Python library that treats prompts as versioned functions, with tooling to track, visualize, and iterate on them as code.
AdalFlow★ 4.2kA PyTorch-like library for building and auto-optimizing LLM pipelines, tuning prompts across the components of a task.
LMQL★ 4.2kA query language for LLMs that mixes Python control flow with prompts and constraints to script multi-step generation.
Hunyuan PromptEnhancer★ 3.8kChain-of-thought prompt rewriter for text-to-image and image-editing models, shipped as 7B/32B weights plus GGUF quantisations.
Prompty★ 1.3kA markdown file format for LLM prompts, with runtimes in several languages and a VS Code extension