Skip to main content

promptmap

A data-engineering-inspired prompt orchestration tool for LLMs (think dbt for prompts).

Why promptmap? Treating complex LLM workflows as giant one-shot prompts is like navigating a city by staring at your feet, one wrong turn and you're lost. promptmap turns your prompts into a visual map of connected hypotheses (models) and reality-check landmarks (tests), with built-in tools to inspect runs (promptmap docs).

Mechanically, this means you: write modular prompts in Jinja2, chain them into a dependency graph with ref(), and validate outputs against reality with promptmap test. Iterate on complex LLM workflows without losing context or rewriting from scratch. (Read more on the philosophy in motivation.md).

DAG visual


Quick start

uv tool install promptmap
promptmap init my_project   # asks for provider, model + API key; writes settings.yml and .env
# or: promptmap init my_project --provider anthropic --model claude-sonnet-4-5 --api-key sk-...
# or: promptmap init my_project --no-interactive   (blank settings.yml/.env to edit)

promptmap calls your LLM through LiteLLM (100+ providers). The provider and model live in settings.yml at the project root — change them with promptmap run --provider X --model Y or edit the file by hand (values aren't validated). Name models once with aliases: in settings.yml (low: openai/gpt-4o-mini) and pick one per prompt with {{ config(model="low") }}. Need full control over the call? Add a client.py.

Edit your .prompt files in map/, then run the pipeline, test expectations, and inspect the run:

cd my_project   # API key lives in .env (init adds the right variable)

promptmap run     # Execute the prompt DAG
promptmap test    # Validate outputs against map/*.testprompt
promptmap docs    # Generate HTML report of the run and run history
promptmap serve   # Launch the interactive local UI / HTTP server
promptmap clear-cache MODEL  # Make one model start cold on the next run
promptmap edit [MODEL]       # Show what can be edited + the command for it (-i to be asked)

Claude Code skill (teaches Claude the promptmap workflow, prompt style and testing approach):

mkdir -p ~/.claude/skills/promptmap && curl -fsSL https://raw.githubusercontent.com/conradbez/promptmap/main/skills/promptmap/SKILL.md -o ~/.claude/skills/promptmap/SKILL.md

Core concepts

1. Models (map/*.prompt)

Each .prompt file is a node in your DAG. Use ref('model_name') to inject the output of an upstream model:

{# map/outline.prompt #}
Based on this topic, create a detailed outline:

{{ ref('topic') }}

2. Model types (config(model_type=...))

Not every node in your pipeline needs to be a standard LLM call. Override model_type at the top of a .prompt file for deterministic reshaping or coding agents:

Model Type What it does Declaration
LLM (default) Sends the rendered Jinja prompt to your configured LLM. Standard .prompt file
template Renders Jinja directly with no LLM call (for reshaping upstream outputs). {{ config(model_type="template") }}
agent Hands the prompt to mini-swe-agent, which can run shell commands in a scratch folder before replying. Text in, text out. Upstream promptfiles are copied in, and files it writes become the model's files. Pure Python, no Node needed. {{ config(model_type="agent") }}
coding_agent mini-swe-agent as a pure function: an upstream folder in (or empty), the patched folder plus a diff out. Unchanged inputs are reused without re-running the agent; a run cut off mid-way replays its finished steps on restart instead of paying for them again. {{ config(model_type="coding_agent", inherit_coding_folder="repo") }}

(More model kinds, such as execute_python, agent_multi_harness (mini-swe-agent / opencode / pi), browser_use (browser-use in a local or cloud browser; pip install "promptmap[browser]"), python_modal, agent_modal and agent37, come with pip install "promptmap[extras]".)

3. Tests (map/*.testprompt)

Run promptmap test to validate the latest run's outputs against your expectations:

  • LLM-as-a-judge: Prompt tests in map/*.testprompt (alongside your models) pass when the LLM returns {"results": "pass"}.
  • Deterministic checks: Compare output fields directly in YAML cases (map/*.yml) using expect (no LLM judge needed).

4. Visualizing & serving (promptmap docs & promptmap serve)

Inspect prompt graph visually:

  • promptmap docs generates a self-contained HTML report of every run—showing rendered prompts, model outputs, token usage, and test results across the DAG.
  • promptmap serve starts a local server to interactively explore the DAG, trigger runs or inspect previous results.

Documentation

Category Guides
Inputs & Data Passing variables (promptdata) · Passing files (promptfiles) · RAG inside prompts · Global instructions
Workflow & DAG Grouping models in folders · Map & reduce (each=) · Dynamically skipping models · Models that produce files · Run IDs & iterating on the last answer (previous)
Testing & Eval Writing tests · Validation · Bulk YAML testing & expect
CLI, UI & API promptmap docs (HTML report) · promptmap serve & HTTP server · promptmap ls · Python API & callbacks · Token usage
Customization Provider/model (settings.yml) & custom backend (client.py) · Output format & config() · Agent models · Custom model kinds · Architecture

Metadata

Release files for promptmap 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for promptmap 0.8.3
File Size Uploaded Provenance Actions
promptmap-0.8.3.tar.gz 302.5 kB Without provenance Details for promptmap-0.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for promptmap 0.8.3
File Interpreter ABI Platform Actions
promptmap-0.8.3-py3-none-any.whl Python 3 none any Details for promptmap-0.8.3-py3-none-any.whl

Total release size: 579.8 kB

Release files / promptmap-0.8.3.tar.gz

Download URL promptmap-0.8.3.tar.gz
Size 302.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3688686dd47d49973bef9c57a3257cc71aee7e22dfe46242b2a7ff9c0f2493d7
BLAKE2b-256 checksum
How to use checksums
fa39e66ddfccd9414e1ec71a79215d36229824f2a61f63c2dc16637ccf1b5925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / promptmap-0.8.3-py3-none-any.whl

Download URL promptmap-0.8.3-py3-none-any.whl
Size 277.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fab4cd15233c9ce14ee7de5551967750b9c8458819f91f27bc88f7fe4015dc81
BLAKE2b-256 checksum
How to use checksums
784967cf2ee20ff49146120c31bbda092f5d08b4487b9abc13f2a9b1c394b76e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for promptmap 0.8.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page