ProML (Prompt Markup Language)
Author: Johan Caripson
ProML is a structured markup language for Large Language Model prompts. The project now ships a full toolchain: a formal specification, a production-ready parser and runtime, a CLI, a local registry, a constrained-decoding adapter layer, and developer ergonomics such as formatting, documentation, and editor support.
✨ Highlights
- Formal spec & docs —
docs/contains the language guide, minimal grammar, and 29 governing principles for prompt engineering. - Reference parser —
proml/parser.pybuilds an AST, validates block order, semver, repro tiers, policies, pipelines, and test definitions. - Strict I/O test runner —
proml_test.pyparses.promlfiles, enforces JSON Schema/regex/grammar constraints, and runs caching-aware assertions. - Constraint engine — pluggable validators for regex, JSON Schema, and CFG grammar; ships with a Guidance-compatible adapter for decoder-time enforcement.
- Engine profiles & caching — structured metadata for model, temperature, token limits, and cost budgets with hash-based cache keys and adapter registry (OpenAI, Anthropic, Local, Ollama, Stub).
- CLI & registry —
promlcommand (init, lint, fmt, test, run, bench, publish, import) plus a YAML registry for semver-aware module discovery. - Developer experience — schema-aware formatter, VS Code extension skeleton, MkDocs plugin, and example prompts under
test_prompts/.
🚀 Quick Start
Clone the repo and ensure dependencies are installed (Python 3.10+ recommended). The CLI runs directly via python3 -m proml.cli.
Install locally in editable mode:
python3 -m pip install -e .
For full tooling (docs, tests, Guidance adapter) use the dev extras:
python3 -m pip install -e .[dev]
Format & Lint
python3 -m proml.cli fmt test_prompts/sentiment_analysis.proml
python3 -m proml.cli lint test_prompts
The formatter is schema-aware and preserves inline comments thanks to ruamel.yaml.
Run Tests
python3 proml_test.py test_prompts/sentiment_analysis.proml
python3 proml_test.py test_prompts/caching_example.proml
Execute a Prompt
python3 -m proml.cli run test_prompts/sentiment_analysis.proml \
--input comment="I love this product" --provider stub
Use --provider stub for offline evaluation; registered adapters handle OpenAI, Anthropic, Local backends, and more.
Registry Workflow
python3 -m proml.cli publish test_prompts/sentiment_analysis.proml
python3 -m proml.cli import com.example.sentiment --version ^1.0.0
Published modules are tracked in proml_registry.yaml with integrity hashes and reproducibility metadata.
🧰 Developer Tooling
- Formatting & comments: schema-aware formatter retains inline annotations across blocks.
- Guidance adapter:
proml.adapters.GuidanceGenerationAdapterlets you enforce regex/grammar/schema constraints inside Guidance programs. - MkDocs plugin:
mkdocs_proml_plugin.pyrenders.promlmodules into documentation pages automatically. - VS Code extension:
tools/vscode/provides syntax highlighting and snippets for.promlfiles.
📚 Documentation
Browse the specification and principles in the docs index. The minimal spec includes a formal EBNF grammar, block invariants, determinism tiers, policy semantics, pipelines, and testing requirements.
🔬 Tests
The repository includes targeted tests for the parser, formatter, and adapters under tests/. Run them with:
PYTHONPATH=. python3 tests/test_formatter.py
PYTHONPATH=. python3 tests/test_guidance_adapter.py
🌐 Publishing Docs
The project is preconfigured for MkDocs out of the box. After installing mkdocs and mkdocs-material, run mkdocs serve to preview the docs site locally. A Hugo configuration is also included for alternative static site generation.
🙌 Contributing & Next Ideas
Issues and PRs are welcome! Impactful directions include:
- Package the CLI as a distributable (
pip install proml). - Build richer adapters (Guidance grammar, OpenAI function-calling integration).
- Expand formatter lint rules (comment style, schema normalization hints).
- Publish example modules and tutorials demonstrating real-world prompt workflows.
Have fun building reproducible, testable LLM workflows with ProML.
Metadata
Release files for proml-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| proml_cli-0.1.0.tar.gz | 26.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| proml_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.4 kB
Release files / proml_cli-0.1.0.tar.gz
| Download URL | proml_cli-0.1.0.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
102218dd2f66e1ea64baae34a72a29f2ae1692790711199b574242942bb31c8a
|
|
BLAKE2b-256 checksum How to use checksums |
f41360d2c4020cdda21fd1159f22c3c1a51e90c7870ab3da2e7c290753248a14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / proml_cli-0.1.0-py3-none-any.whl
| Download URL | proml_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60f187e19277426da02673628974bd05a87b663ff7f0b41a74232c4c6596dece
|
|
BLAKE2b-256 checksum How to use checksums |
81e1e63cdd7084758641f066b3c0f1f8148de107e3d258e5b52b3130d17042c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|