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.
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.

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.

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

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.
---
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).
uv pip install "prompty[jinja2,openai]"Run it from Python
Invoke the file with its inputs.
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.
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.

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.
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.
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.
| Tool | Stars | What it does |
|---|---|---|
| Prompt Optimizer | ★ 42.9k | A 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.3k | A Stanford framework for programming language models with composable modules and automatic prompt optimization instead of hand-written prompts. |
| GEPA | ★ 7.6k | A reflective, evolutionary optimizer that improves prompts and other text components of a system using language-model feedback. |
| ell | ★ 5.8k | A Python library that treats prompts as versioned functions, with tooling to track, visualize, and iterate on them as code. |
| AdalFlow | ★ 4.2k | A PyTorch-like library for building and auto-optimizing LLM pipelines, tuning prompts across the components of a task. |
| LMQL | ★ 4.2k | A query language for LLMs that mixes Python control flow with prompts and constraints to script multi-step generation. |
| Hunyuan PromptEnhancer | ★ 3.8k | Chain-of-thought prompt rewriter for text-to-image and image-editing models, shipped as 7B/32B weights plus GGUF quantisations. |
| Prompty | ★ 1.3k | A markdown file format for LLM prompts, with runtimes in several languages and a VS Code extension |
