Skip to content
No new version for more than 90 days, so OpenNavo has paused recommending and installing it. Homebrew still offers this app.

PDL Release Notes

Mandana Vaziri; Louis Mandel; Claudio Spiess; Martin Hirzel ยท A macOS app and command-line tool for exploring and running YAML-based programs that compose LLM prompts, code, and data.

CaskDeveloper Toolsย 319

No new version for more than 90 days, so OpenNavo has paused recommending and installing it. Homebrew still offers this app.

Install command
brew install --cask pdl
30-day installs
1
1-year installs
51
Last 365 days
Latest version
0.9.3
Download size
11MB
dmg
Release cadence
Irregular
0 releases in 30 days
  1. 0.9.3

    LatestPatch

    OpenNavo editorial Added to Homebrew

    Adds model-usage and scope variables, variable selection for code blocks, and Jinja template parameters. The release documents two backward-incompatible changes.

    Features
    Adds pdl_usage and pdl_scope to the PDL scope.Adds scope to Python and Jinja code blocks.Adds parameters to Jinja code blocks.
    Updates
    Changes function-signature syntax generated by .signature.Changes rule re-evaluation for aggregator declarations and functions.

    PDL 0.9.3 adds two variables to the PDL scope. pdl_usage provides accumulated model-call statistics, including model_calls, prompt_tokens, and completion_tokens. The release example calculates total tokens by adding the prompt and completion token values; it does not describe a separate total-token field. pdl_scope lets programs inspect the variables available at the current execution point.

    Python and Jinja code blocks gain a scope field to select which variables are available to the code. By default, all variables in pdl_scope are available. Jinja code blocks also gain a parameters field for configuring the Jinja Template constructor, including whitespace-handling options.

    The release documents two backward-incompatible changes: the syntax of function signatures generated by .signature has changed, and the rules for re-evaluating aggregator declarations and functions have changed. The release notes also list fixes and other implementation, test, and documentation changes without further detail.

    Source: https://github.com/IBM/prompt-declaration-language/releases/tag/v0.9.3

  2. 0.9.2

    Patch

    OpenNavo editorial Added to Homebrew

    Adds a sequence block for executing PDL blocks in order and combining their results according to a join specification. Also updates standard-library functions and fixes an AutoPDL optimizer event-loop issue.

    Language
    Adds sequence blocks with configurable result joining.
    Library
    Adds stdlib.bool_confidence and parameter support for llm_as_judge.
    Fixes
    Fixes an event-loop issue in the AutoPDL optimizer.

    PDL 0.9.2 introduces the sequence block, which runs a list of PDL blocks in order and combines their results using the provided join specification. The release notes show join: { as: array } as one way to collect results into an array.

    The standard library adds stdlib.bool_confidence, and llm_as_judge now accepts parameters. The AutoPDL optimizer also receives an event-loop fix. The release notes additionally mention a CI change: tests are no longer run with Python 3.13 to reduce CI load; this is a test configuration change, not a stated runtime compatibility change.

    Official release notes

  3. 0.9.1

    Patch

    OpenNavo editorial Added to Homebrew

    Adds CSV format support in the parser field and changes string contributions to be stringified as JSON.

    Features
    The parser field supports CSV format.
    Changes
    Values contributing to a string are stringified as JSON.

    PDL 0.9.1 adds support for CSV format in the parser field. It also changes how values are handled when contributing to a string: they are stringified as JSON.

    Source: PDL v0.9.1 release.

  4. 0.9.0

    Expand

    GitHub Release Added to Homebrew

    New Features

    The main new features are:

    • contribute to a file or standard input and error
    • @pdl Python decorator

    contribute to files

    The user can declare a file aggregator that can be used in the contribute to accumulate the results of the blocks. For example, in the following program, an aggregator named log associated to the file /tmp/log.txt is declared. This aggregator is used to store the output of the model in the file /tmp/log.txt.

    defs:
      log:
        aggregator:
          file: /tmp/log.txt
    text:
    - Hello
    - model: ollama_chat/granite3.3:2b
      contribute: [ result, context, log ]
    

    By default, the aggregator stdin and stderr are available to contribute to the standard input and standard error. It is useful, for example to outpout debug information. In the following program, the raw output of the model is emitted on the standard error:

    text:
    - Hello
    - model: ollama_chat/granite3.3:2b
      modelResponse: raw_response
      contribute:
        - result
        - context
        - stderr:
            value: ${raw_response}
    

    @pdl Python decorator

    In order to make it easy to define functions as PDL programs, we provide a @pdl decorator.

    from pdl.pdl import pdl
    
    @pdl
    def chain_of_thought(scope):
        """
        lastOf:
        - "Question: ${ question }\n"
        - "Answer: Let's think step by step. "
        - model: ollama_chat/granite3.3:2b
          parameters:
              stop:
              - "<|endoftext|>"
              - "Question:"
              include_stop_sequence: false
        """
        return
    
    def main():
        result = chain_of_thought(
            scope={"model": "ollama_chat/granite3.2:2b",
                   "question": "How to write Hello World in OCaml?\n"}
        )
        print(result)
    
    if __name__ == "__main__":
        main()
    

    In this example, the function chain_pf_thought is a string representing a PDL program. The free variables in the string are values passed in the dictionary scope given on argument.

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.8.0...v0.9.0

  5. 0.8.0

    Expand

    GitHub Release Added to Homebrew

    New Features

    The main changes in this release are:

    • AutoPDL: automatic optimization of PDL programs
    • Calling PDL functions from Jinja and Python
    • Map/reduce block

    AutoPDL: automatic optimization of PDL programs

    Given a PDL program with some free variables, a search space for these free variable, a loss function, and a training set, you can optimize the PDL program using the pdl-optimize command. This allows to optimize any part of a PDL program such as the textual prompts, the few-shots examples, or the prompting patterns. This work is based on the paper AutoPDL: Automatic Prompt Optimization for LLM Agents. A new section of the manual is describing how to use the optimizer.

    Calling PDL functions from Jinja and Python

    It is now possible to call a function defined in PDL inside a Jinja expression or a Python code block. Here is an example where the function translate is called in the Jinja expression ${ translate("Hello", language="French") }:

    description: Calling a PDL function from Jinja
    defs:
      translate:
        function:
          sentence: string
          language: string
        return:
          lastOf:
          - |
            Translate the sentence '${ sentence }' to ${ language }.
            Only give the result of the translation.
          - model: ollama_chat/granite3.2:2b
    text: |
      The way to say hello in French is ${ translate("Hello", language="French") }.
    

    Map/reduce block

    Similar to the repeat loops, PDL now offers a map block. The difference with the repeat block is that the context is not accumulated between iterations, each iteration is executed with the same context. Here is an example of map block:

    lastOf:
    - "Hello, "
    - for:
        name: [Alice, Bob, Charlie]
      map:
        lastOf:
        - my name is ${ name }
        - model: ollama/granite3.2:2b
      join:
        as: array
    

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.7.1...v0.8.0

  6. 0.7.0

    Expand

    GitHub Release Added to Homebrew

    New Features

    The main new features are the following and are detailed bellow:

    • new retry attribute to any block,
    • new index field to introduce a loop index in repeat blocks
    • new syntax for types with suport for JSON Schema,
    • extract the signature of a function f with f.signature,
    • loop and sequences with independent contexts,
    • support for granite-io processors created in Python.

    The retry field

    Any block can now have a retry field indicating how many times a block should be executed if it encounters a runtime error. For example, a model call can be retried 5 times as follows:

    model: replicate/ibm-granite/granite-3.3-8b-instruct
    input: How to program "Hello World!"?
    retry: 5
    

    The loop index field

    A common pattern in PDL programs is to introduce a variable to index the loop iterations. For example, a loop that turns a list of strings into a list of object with a field name and id would be written as follows:

    defs:
      id: -1
    for:
      name: [ "Alice", "Nicolas", "Rosa", "Remi" ]
    repeat:
      defs:
        id: ${ id + 1}
      data:
        name: ${name}
        id: ${id}
    join:
      as: array
    

    With the new index field that introduced a variable name as loop index, this code can now be simplified as follows:

    for:
      name: [ "Alice", "Nicolas", "Rosa", "Remi" ]
    index: id
    repeat:
      data:
        name: ${name}
        id: ${id}
    join:
      as: array
    

    New type syntax

    We extended the type syntax to be able to write directly some JSON Schema as block specification. To do so, the type must contain the type or enum field. For example, we can write a model block that checks that the output starts with the letter "A" as follows:

    model: ollama/granite3.3:2b
    input: Generate a word that starts with the letter "A". Just output the single word.
    spec:
      type: string
      pattern: "^[Aa]"
    

    To make the syntax more uniform, we are using the JSON Schema syntax for the base type. So for example, we are using number instead of float for floating point numbers. We discuss the breaking changes below.

    Extract function signature

    In order to make the use of PDL functions as tools by LLMs easier, we provide the ability to extract the signature of a function f by executing f.signature. Here is an example:

    defs:
      calc:
        description: Calculator function
        function:
          expr:
            type: string
            description: Arithmetic expression to calculate
        return:
          lang: python
          code: result = ${ expr }
    text: ${ calc.signature }
    

    The output is:

    {"type": "function", "name": "calc", "description": "Calculator function", "parameters": {"type": "object", "properties": {"expr": {"type": "string", "description": "Arithmetic expression to calculate"}}, "required": ["expr"], "additionalProperties": false}}
    

    An example of tool use is given in search.pdl.

    Independent contexts

    Blocks containing lists of blocks (text, array, object, and lastOf) as well as loops can now be annotated with context: independent. It means that each sub-block is executed in an independent copy of the context. Therefore, if we execute the following program, both model calls are executed with the same input containing the message Hello:

    lastOf:
    - Hello
    - context: independent
      array:
      - model: ollama/granite3.2:2b
      - model: ollama/granite3.3:2b
    

    Support for granite-io processors objects

    In addition to the ability to call granite-io processors using the lookup mechanism using backend and processors names, it is possible now to use granite-io processors or backends created in Python. Here is an example:

    defs:
      io_proc:
        lang: python
        code: |
          from granite_io import make_backend, make_io_processor
          model_name = "granite3.2:2b"
          backend = make_backend("openai", { "model_name": model_name })
          result = make_io_processor(model_name, backend=backend)
    processor: ${ io_proc }
    input: Write an Hello World program in Python.
    

    Breaking Changes

    This version of PDL is coming with a large number of breaking changes:

    • types syntax,
    • granite-io syntax,
    • rename max_iterations into maxIterations,
    • trace format.

    Types syntax

    As mentioned above, to be consistent with JSON Schema, we renamed the basic types as follows:

    • str -> string
    • bool -> boolean
    • int -> integer
    • float -> number
    • obj -> object
    • list -> array

    Moreover, since we can use JSON schema, we removed the old way to put constraints on types. So for example, the following type:

    spec: { int: { minimum: 0 } }
    

    must be rewritten:

    spec: { type: integer, minimum: 0 }
    

    Finally, the type null now corresponds to a value of any type. For example, the identity function can be written as follows:

    function:
      x:
    return: ${ x }
    

    Granite-io processors

    The structure of the granite-io block changed. Now, the processor field is required and the definition of io-processor is given has sub-fields of this field. So a block that was defined as follows:

    processor:
    model: "granite3.2:2b"
    backend: openai
    input: Hello
    

    is now defined like this:

    processor:
        type: Granite 3.2
        model: "granite3.2:2b"
        backend: openai
    input: Hello
    

    Loop iteration bound

    The syntax to bound the number of iterations of a loop changed. It is now maxIteration. Here is an example

    index: i
    repeat: ${ i }
    maxIterations: 3
    

    Trace format

    The format of the traces generated with the --trace (-t) option has changed. Some internal fields like defsite have changed to pdl__defsite. It means that traces generated with old version of the interpreter are not compatible with the new version of the UI.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.6.1...v0.7.0

  7. 0.6.2

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.6.1...v0.6.2

  8. 0.6.1

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.6.0...v0.6.1

  9. 0.6.0

    Expand

    GitHub Release Added to Homebrew

    This new release has two major changes:

    • pdl-lint, a linter for PDL programs (thanks to @vite-falcon!)
    • mesages in the context with the same role are not automatically merged anymore.

    For example, the following program generates 3 messages:

    lastOf:
      - role: user
        text:
          - hello
          - "\n"
          - world
      - ${pdl_context}
    

    result:

    [{"role": "user", "content": "hello", "defsite": "lastOf.text.0"}, {"role": "user", "content": "\n", "defsite": "lastOf.text.1"}, {"role": "user", "content": "world", "defsite": "lastOf.text.2"}]
    

    To generate only one message, you have to use a message block:

    lastOf:
      - role: user
        content:
          text:
            - hello
            - "\n"
            - world
      - ${pdl_context}
    

    result

    [{"role": "user", "content": "hello\nworld", "defsite": "lastOf.message"}]
    

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.5.1...v0.6.0

  10. 0.5.1

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.5.0...v0.5.1

  11. 0.5.0

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.4.2...v0.5.0

  12. 0.4.2

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.4.1...v0.4.2

  13. 0.4.0

    Expand

    GitHub Release

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.3.0...v0.4.0

  14. 0.3.0

    Expand

    GitHub Release Added to Homebrew

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.2.0...v0.3.0

  15. 0.2.0

    Expand

    GitHub Release

    Warning: This release introduce a non-backward compatible change: call blocks take closures as argument instead of function names. In practice, a function call like call: f must be replace by call: ${f}.

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.1.1...v0.2.0

  16. 0.1.1

    Expand

    GitHub Release

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.1.0...v0.1.1

  17. 0.1.0

    Expand

    GitHub Release

    Warning: This release introduce a non-backward compatible change: implicit lastOf (lists of blocks) are not allowed anymore.

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.0.9...v0.1.0

  18. 0.0.9

    Expand

    GitHub Release

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.0.8...v0.0.9

  19. 0.0.7

    Expand

    GitHub Release

    What's Changed

    New Contributors

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.0.6...v0.0.7

  20. 0.0.6

    Expand

    GitHub Release

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.0.5...v0.0.6

  21. 0.0.5

    Expand

    GitHub Release

    What's Changed

    Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.0.4...v0.0.5