Prompty
Prompty is an open-source markdown file format and set of runtimes for defining, running, tracing, and building agentic LLM prompts.
At a Glance
About Prompty
Prompty, from Microsoft, is a markdown-based file format (.prompty) for LLM prompts. A single file pairs YAML frontmatter (model configuration, inputs, tools, template settings) with a markdown prompt body, and can be executed from VS Code or from language runtimes. The project is MIT licensed and its v2 packages are available for Python, TypeScript, Rust, and C#.
What It Is
Prompty is a prompt asset format plus runtimes and tooling. The frontmatter holds model and connection details, typed input schemas with defaults, and tool definitions (function, MCP, OpenAPI). The body uses role markers (system:, user:, assistant:) and Jinja2 or Mustache templating. Variable references such as ${env:VAR} and ${file:path} pull in environment values and files, with file access scoped to the prompt's directory by default.
How the Pipeline Works
Every prompt runs through four stages: render (expand template variables), parse (split role markers into messages), execute (call the LLM through a registered provider), and process (extract content, parse structured output, stream chunks). Providers include OpenAI, Microsoft Foundry, and Anthropic. The OpenAI provider can also target OpenAI-compatible endpoints by setting a connection endpoint, leaving the prompt unchanged. In Python, invoke runs the whole pipeline, or load, prepare, and run can be called step by step, with async variants.
Agentic Turns and Tracing
Prompty v2 adds a turn() runtime for agentic loops. Tools are declared in frontmatter while handlers are supplied in host code. The loop executes model-requested tools and feeds results back until a final answer. Guardrails, steering, cancellation, retries, context budgets, compaction, and memory-aware conversations are controlled in code. Executions produce traces with messages, token use, latency, and raw responses, via console, JSON file, or OpenTelemetry backends, and a @trace decorator for custom functions.
VS Code Extension
The VS Code extension offers syntax highlighting, autocomplete, a connections sidebar for OpenAI, Microsoft Foundry, and Anthropic, live preview, an interactive chat mode with tool calling, F5 execution, and a trace viewer for .tracy files.
Community Discussions
Be the first to start a conversation about Prompty
Share your experience with Prompty, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Prompty core format and runtimes are MIT licensed and free to use, modify and distribute.
- MIT licensed
- Runtimes for Python, TypeScript, C#, Rust (also Java, Go, Swift)
- VS Code extension with trace viewer
- Agentic turn runtime
- External LLM provider costs (e.g. OpenAI, Anthropic, Microsoft Foundry API keys) are separate
Capabilities
Key Features
- Markdown .prompty file format with YAML frontmatter
- Jinja2 and Mustache templating
- Typed input schemas with defaults
- Function, MCP, and OpenAPI tool definitions
- Four-stage render/parse/execute/process pipeline
- Agentic turn() runtime with tool loop
- Guardrails, steering, cancellation, and retries
- Context budgets, compaction, and memory-aware turns
- Tracing with console, JSON file, and OpenTelemetry backends
- VS Code extension with live preview, chat mode, and trace viewer
- OpenAI-compatible endpoint support
- Plugin system for custom providers
