prompt-declaration-language  by IBM

Declarative language for building robust LLM applications

Created 1 year ago
267 stars

Top 96.0% on SourcePulse

GitHubView on GitHub
Project Summary

Prompt Declaration Language (PDL) is a declarative YAML-based language designed for developers to create reliable, composable LLM prompts and integrate them into software systems. It offers a structured approach to prompt engineering, enabling robust LLM integration with traditional rule-based systems and tools, thereby enhancing prompt management and system reliability.

How It Works

PDL employs a declarative YAML syntax interpreted by the pdl command-line tool. This allows users to define prompt templates, specify LLM interactions, and orchestrate complex workflows involving variables, conditionals, loops, and function calls. The system supports composing multiple LLM calls and integrating with external tools or APIs, providing a structured alternative to imperative prompt scripting for enhanced maintainability and predictability.

Quick Start & Requirements

  • Installation: pip install prompt-declaration-language
  • Prerequisites: Python 3.11+ (WSL recommended for Windows users). Requires LLM model setup (e.g., Ollama locally) or cloud service credentials (IBM watsonx, Replicate). VSCode YAML extension recommended for development.
  • Resources: Links to Quick Start, Example, GUI, Documentation, API Cheat Sheet.

Highlighted Details

  • Declarative YAML syntax for defining prompt templates, LLM calls, and orchestration logic.
  • Supports single/multi-shot prompting, composition of multiple LLM calls, and integration with tools (code execution & APIs).
  • Features control flow constructs (variables, conditionals, loops, functions) and I/O operations (file/stdin reading, JSON parsing).
  • Includes development tools: type checking for model I/O, Python SDK, chat API support, and a live debugging GUI.
  • Experimental trace telemetry is available for debugging and performance analysis.
  • Introduces AutoPDL, a tool for optimizing PDL programs, including few-shot examples and textual prompts.

Maintenance & Community

The provided README does not contain specific details regarding notable contributors, sponsorships, community channels (e.g., Discord/Slack), or a public roadmap.

Licensing & Compatibility

The README does not explicitly state the project's license. This omission requires further investigation to determine compatibility for commercial use or closed-source linking.

Limitations & Caveats

Python 3.11+ is a strict requirement, with WSL recommended for Windows users. Trace telemetry is noted as experimental. The absence of an explicit license in the documentation is a significant caveat for adoption decisions.

Health Check
Last Commit

23 hours ago

Responsiveness

Inactive

Pull Requests (30d)
51
Issues (30d)
0
Star History
24 stars in the last 30 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), David Cournapeau David Cournapeau(Author of scikit-learn), and
3 more.

codecompanion.nvim by olimorris

0.6%
6k
Neovim plugin for AI-powered coding assistance
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.