{"data":{"slug":"microsoft-prompty","name":"prompty","tagline":"Tool for managing LLM prompts","github_url":"https://github.com/microsoft/prompty","owner":"microsoft","repo":"prompty","owner_avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=4","primary_language":"Rust","stars":1269,"forks":127,"topics":["generative-ai","llm-evaluation","llms","promptengineering","prompty"],"archived":false,"github_pushed_at":"2026-09-19T02:09:32+00:00","maintenance_label":"Very active","stars_delta_30d":32,"url":"https://www.graphcanon.com/tools/microsoft-prompty","markdown_url":"https://www.graphcanon.com/tools/microsoft-prompty.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/microsoft-prompty","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=microsoft-prompty","description":"Prompty makes it easy to create, manage, debug, and evaluate LLM prompts for your AI applications.  Prompty is an asset class and format for LLM prompts designed to enhance observability, understandability, and portability for developers. ","homepage_url":"https://prompty.ai","license":"MIT","open_issues":14,"watchers":15,"ai_summary":"Prompty simplifies creating and evaluating large language model prompts to improve observability and portability for developers.","readme_excerpt":"# Prompty\n\n\n\n\n\n> **Prompty v2** — Prompty v2 packages are available for Python, TypeScript,\n> Rust, and C#. The shared `.prompty` format is aligned across runtimes by\n> generated model types and conformance vectors. Feedback welcome via\n> [Issues](https://github.com/microsoft/prompty/issues).\n\nPrompty is a **markdown file format** (`.prompty`) for LLM prompts. Write your prompt once — run it from VS Code or a language runtime that shares Prompty's generated model and conformance vectors.\n\n<p align=\"center\">\n  <img src=\"img/prompty-flow.svg\" alt=\"Prompty flow: .prompty file → Runtime → LLM Provider\" width=\"700\">\n</p>\n\n## Quick Start\n\n### 1. Write a `.prompty` file\n\n```prompty\n---\nname: greeting\nmodel:\n  id: gpt-4o-mini\n  provider: openai\n  connection:\n    kind: key\n    apiKey: ${env:OPENAI_API_KEY}\ntemplate:\n  format:\n    kind: jinja2\n  parser:\n    kind: prompty\n---\nsystem:\nYou are a friendly assistant.\n\nuser:\nSay hello to {{name}}.\n```\n\n### 2. Run it\n\n**Python**\n```bash\nuv pip install \"prompty[jinja2,openai]\"\n```\n```python\nimport prompty\n\nresult = prompty.invoke(\"greeting.prompty\", inputs={\"name\": \"Jane\"})\nprint(result)\n```\n\n**TypeScript**\n```bash\nnpm install @prompty/core @prompty/openai\n```\n```typescript\nimport { invoke } from \"@prompty/core\";\nimport \"@prompty/openai\";\n\nconst result = await invoke(\"greeting.prompty\", { name: \"Jane\" });\nconsole.log(result);\n```\n\n**VS Code** — open the `.prompty` file and press **F5**.\n\n### Use an OpenAI-compatible endpoint\n\nPrompty's `openai` provider can also target OpenAI-compatible control planes,\ngateways, or self-hosted model servers by setting `model.connection.endpoint`.\nThe prompt asset stays portable: switch the endpoint and key at runtime without\nchanging the prompt body.\n\n```prompty\n---\nname: governed-greeting\nmodel:\n  id: gpt-4o-mini\n  provider: openai\n  connection:\n    kind: key\n    endpoint: ${env:OPENAI_BASE_URL:https://api.openai.com/v1}\n    apiKey: ${env:OPENAI_API_KEY}\ntemplate:\n  format:\n    kind: jinja2\n  parser:\n    kind: prompty\n---\nsystem:\nYou are a careful assistant.\n\nuser:\nSay hello to {{name}}.\n```\n\nFor example, to route through Tuning Engines:\n\n```bash\nexport OPENAI_BASE_URL=https://api.tuningengines.com/v1\nexport OPENAI_API_KEY=sk-te-your-inference-key\n```\n\nThis keeps the `.prompty` file unchanged while the endpoint provides routing,\npolicy, usage tracking, or trace correlation around OpenAI-compatible calls.\n\n## What's new in v2: agentic turns\n\nPrompty v2 keeps the prompt asset simple, then adds a shared **agentic turn**\nruntime when your app needs tools, memory, and runtime controls. Define tools in\nfrontmatter, bind the actual functions in host code, and call `turn()` instead\nof `invoke()` when the model should loop through tool calls before returning a\nfinal answer.\n\n- **Tool loop** — execute model-requested tools, append tool results, and retry\n  until the model returns a final response.\n- **Runtime controls** — guardrails, cancellation, steering messages, retries,\n  and event callbacks live in code instead of prompt text.\n- **Context and memory** — thread inputs, context budgets, compaction, and\n  memory-aware turns keep long conversations portable across runtimes.\n- **Observable agents** — every render, parse, model call, tool call, and final\n  result can flow into traces.\n\n```python\nfrom prompty import turn\n\nresult = turn(\n    \"agent.prompty\",\n    inputs={\"question\": \"What's the weather in Seattle?\"},\n    tools={\"get_weather\": get_weather},\n)\n```\n\n## Contributor hygiene\n\nPrompty normalizes text files to LF line endings via `.gitattributes`. Enable the\nrepo hook once per clone so staged files are normalized before each commit and\nwhitespace errors are blocked locally:\n\n```bash\ngit config core.hooksPath .githooks\n```\n\nBefore opening a PR, you can run the same core hygiene checks directly:\n\n```bash\ngit diff --check\ngit ls-files --eol | grep 'w/crlf'\n```\n\n## VS Code Extension\n\nThe v2 extension includes a connections sidebar, live preview, chat mode, and a redes","github_created_at":"2024-04-22T16:55:53+00:00","created_at":"2026-07-11T11:59:35.343397+00:00","updated_at":"2026-09-20T06:57:07.296195+00:00","categories":[{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"},{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"}],"tags":[{"slug":"generative-ai","name":"generative-ai"},{"slug":"llm-frameworks","name":"llm frameworks"},{"slug":"llm-evaluation","name":"llm-evaluation"},{"slug":"promptengineering","name":"promptengineering"},{"slug":"prompty","name":"prompty"}],"trust":{"provenance":{"is_fork":false,"github_id":790316547,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-20T06:57:05.432Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":2,"days_since_push":1,"last_release_at":"2026-09-10T20:39:01Z","stars_delta_30d":32,"open_issues_delta_30d":-13},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T11:59:36.585Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-20T06:57:06.481Z"},"languages":{"value":["rust"],"source":"github.language","observed_at":"2026-09-20T06:57:06.481Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-20T06:57:06.481Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When working with LLM prompts in AI applications that require enhanced observability and debugging capabilities directly within TypeScript projects.","If you are looking to improve the portability of your prompts across different environments as a developer."],"when_not_to_use":["For developers not using TypeScript, consider alternative solutions more aligned with their programming language preferences.","When the primary need is for real-time collaboration on prompt creation, Prompty focuses more on individual management and evaluation rather than collaborative editing features."],"source":"enrich:decision_facts","observed_at":"2026-07-17T04:05:30.259Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Prompty is specifically designed for managing and evaluating large language model prompts in TypeScript."}]}}