Skip to content

Commit 1207567

Browse files
committed
Remove IBM
Signed-off-by: Louis Mandel <[email protected]>
1 parent c1e0a71 commit 1207567

File tree

26 files changed

+182
-729
lines changed

26 files changed

+182
-729
lines changed

README.md

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
# PDL (Prompt Declaration Language)
22

3-
[![tests](https://github.com/IBM/prompt-declaration-language/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/IBM/prompt-declaration-language/actions?query=workflow%3Abuild+branch%3Amain)
4-
[![night tests](https://github.com/IBM/prompt-declaration-language/actions/workflows/run-examples.yml/badge.svg?branch=main)](https://github.com/IBM/prompt-declaration-language/actions?query=workflow%3Arun-examples+branch%3Amain)
5-
[![documentation](https://github.com/IBM/prompt-declaration-language/actions/workflows/mkdocs-gh-pages.yml/badge.svg?branch=main)](https://github.com/IBM/prompt-declaration-language/actions?query=workflow%3Amkdocs-gh-pages+branch%3Amain)
6-
[![PyPI version shields.io](https://img.shields.io/pypi/v/prompt-declaration-language?color=success)](https://pypi.python.org/pypi/prompt-declaration-language/)
7-
[![Quay Publish](https://github.com/IBM/prompt-declaration-language/actions/workflows/publish-quay.yaml/badge.svg)](https://github.com/IBM/prompt-declaration-language/actions/workflows/publish-quay.yaml)
8-
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
9-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
10-
[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)
11-
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
12-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
13-
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9672/badge)](https://bestpractices.coreinfrastructure.org/projects/9672)
14-
153
PDL is a declarative language designed for developers to create reliable, composable LLM prompts and integrate them into software systems. It provides a structured way to specify prompt templates, enforce validation, and compose LLM calls with traditional rule-based systems.
164

175
[**Quick Start**](#quick-start) **|** [**Example**](#example-program-a-basic-llm-call) **|** [**GUI**](#graphical-experience) **|** [**Key Features**](#key-features) **|** [**Documentation**](#documentation) **|** [**API Cheat Sheet**](#api-cheat-sheet)
@@ -22,7 +10,7 @@ A PDL program is written *declaratively*, in YAML. The `pdl` command
2210
line tool interprets this program, accumulating messages and sending
2311
them to the models as specified by your program. PDL supports both
2412
hosted and local models. See
25-
[here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models)
13+
[here](./docs/tutorial.md#using-ollama-models)
2614
for instructions on how to install an Ollama model locally.
2715

2816
To install the `pdl` command line tool:
@@ -50,20 +38,17 @@ To run this program:
5038
pdl <path/to/example.pdl>
5139
```
5240

53-
For more information on the `pdl` CLI see
54-
[here](https://ibm.github.io/prompt-declaration-language/). To try the
55-
screenshot on the right live, click
56-
[here](https://pdl.s3-web.us-east.cloud-object-storage.appdomain.cloud/#/demos/Simple%20LLM%20interaction).
57-
5841
## Graphical Experience
5942

6043
The screenshot on the right (above) shows PDL's graphical user
6144
interface. This GUI allows for interactive debugging and live
62-
programming. You may install this via `brew install pdl` on MacOS. For
63-
other platforms, downloads are available
64-
[here](https://github.com/IBM/prompt-declaration-language/releases/latest). You
65-
may also kick the tires with a web version of the GUI
66-
[here](https://pdl.s3-web.us-east.cloud-object-storage.appdomain.cloud/).
45+
programming.
46+
47+
To run the GUI, go to the `pdl-live-react` directory and run to following commands:
48+
```
49+
npm i
50+
npm start
51+
```
6752

6853
To generate a trace for use in the GUI:
6954
```bash
@@ -75,7 +60,7 @@ pdl --trace <file.json> <my-example.pdl>
7560

7661
## Key Features
7762

78-
- **LLM Integration**: Compatible with any LLM, including IBM watsonx
63+
- **LLM Integration**: Compatible with any LLM
7964
- **Prompt Engineering**:
8065
- Template system for single/multi-shot prompting
8166
- Composition of multiple LLM calls
@@ -91,9 +76,9 @@ pdl --trace <file.json> <my-example.pdl>
9176

9277
## Documentation
9378

94-
- [Documentation](https://ibm.github.io/prompt-declaration-language/)
95-
- [Tutorial](https://ibm.github.io/prompt-declaration-language/tutorial/)
96-
- [API References](https://ibm.github.io/prompt-declaration-language/api_reference/)
79+
- [Documentation](./docs/README.md)
80+
- [Tutorial](./docs/tutorial.md)
81+
- [API References](./docs/api_reference.md)
9782

9883

9984
### API Cheat Sheet
@@ -116,16 +101,9 @@ pip install 'prompt-declaration-language[examples]'
116101
### Environment Setup
117102

118103
You can run PDL with LLM models in local using [Ollama](https://ollama.com), or other cloud service.
119-
See [here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models) for
104+
See [here](./docs/tutorial.md#using-ollama-models) for
120105
instructions on how to install an Ollama model locally.
121106

122-
If you use watsonx:
123-
```bash
124-
export WX_URL="https://{region}.ml.cloud.ibm.com"
125-
export WX_API_KEY="your-api-key"
126-
export WATSONX_PROJECT_ID="your-project-id"
127-
```
128-
129107
If you use [Replicate](https://replicate.com/):
130108
```bash
131109
export REPLICATE_API_TOKEN="your-token"
@@ -140,7 +118,7 @@ VSCode setup for syntax highlighting and validation:
140118
// .vscode/settings.json
141119
{
142120
"yaml.schemas": {
143-
"https://ibm.github.io/prompt-declaration-language/dist/pdl-schema.json": "*.pdl"
121+
"./src/pdl/pdl-schema.json": "*.pdl"
144122
},
145123
"files.associations": {
146124
"*.pdl": "yaml",
@@ -209,22 +187,17 @@ text:
209187
PDL includes experimental support for gathering trace telemetry. This can
210188
be used for debugging or performance analysis, and to see the shape of prompts sent by LiteLLM to models.
211189
212-
For more information see [here](https://github.com/IBM/prompt-declaration-language/blob/main/docs/telemetry.md).
190+
For more information see [here](./docs/telemetry.md).
213191
214-
<img src="https://ibm.github.io/prompt-declaration-language/assets/telemetry.png" alt="Trace Telemetry"/>
192+
<img src="./docs/assets/telemetry.png" alt="Trace Telemetry"/>
215193
216194
217195
218196
## Contributing
219197
220-
See the [contribution guidelines](https://ibm.github.io/prompt-declaration-language/contrib) for details on:
198+
See the [contribution guidelines](./docs/contrib.md) for details on:
221199
- Code style
222200
- Testing requirements
223201
- PR process
224202
- Issue reporting
225203
226-
## References
227-
228-
- [PDL Schema](https://github.com/IBM/prompt-declaration-language/blob/main/src/pdl/pdl-schema.json)
229-
- [arXiv Paper](http://arxiv.org/abs/2410.19135)
230-

docs/README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PDL is based on the premise that interactions with an LLM are mainly for the pur
1111

1212
PDL provides the following features:
1313

14-
- Ability to use any LLM locally or remotely via [LiteLLM](https://www.litellm.ai/), including [IBM's watsonx](https://www.ibm.com/watsonx), as well as the [Granite IO Processor](https://github.com/ibm-granite/granite-io) framework
14+
- Ability to use any LLM locally or remotely via [LiteLLM](https://www.litellm.ai/)
1515
- Ability to templatize not only prompts for one LLM call, but also composition of LLMs with tools (code and APIs). Templates can encompass tasks of larger granularity than a single LLM call
1616
- Control structures: variable definitions and use, conditionals, loops, functions
1717
- Ability to read from files and stdin, including JSON data
@@ -23,14 +23,14 @@ PDL provides the following features:
2323

2424
The PDL interpreter takes a PDL program as input and generates data by executing its instructions (calling out to models, code, etc...).
2525

26-
See below for a quick reference, followed by [installation notes](#interpreter_installation) and an [overview](#overview) of the language. A more detailed description of the language features can be found in this [tutorial](https://ibm.github.io/prompt-declaration-language/tutorial).
26+
See below for a quick reference, followed by [installation notes](#interpreter_installation) and an [overview](#overview) of the language. A more detailed description of the language features can be found in this [tutorial](./tutorial.md).
2727

2828

2929
## Quick Reference
3030

31-
<img src="https://ibm.github.io/prompt-declaration-language/assets/pdl_quick_reference.png" alt="PDL Quick Reference"/>
31+
<img src="./assets/pdl_quick_reference.png" alt="PDL Quick Reference"/>
3232

33-
(See also [PDF version](https://github.com/IBM/prompt-declaration-language/blob/main/docs/assets/pdl_quick_reference.pdf).)
33+
(See also [PDF version](./assets/pdl_quick_reference.pdf).)
3434

3535

3636
## Interpreter Installation
@@ -56,7 +56,7 @@ brew install pdl
5656
For other platforms, see installation notes.
5757

5858
You can run PDL with LLM models in local using [Ollama](https://ollama.com), or other cloud service.
59-
See [here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models) for
59+
See [here](./tutorial.md#using-ollama-models) for
6060
instructions on how to install an Ollama model locally.
6161

6262
Most examples in this repository use IBM Granite models on [Ollama](https://ollama.com) and some are on [Replicate](https://replicate.com/). In order to run these examples, you need to create a free account
@@ -80,13 +80,13 @@ pdl <path/to/example.pdl>
8080

8181
The folder `examples` contains many examples of PDL programs. They cover a variety of prompting patterns such as CoT, RAG, ReAct, and tool use.
8282

83-
We highly recommend to edit PDL programs using an editor that support YAML with JSON Schema validation. For example, you can use VSCode with the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and configure it to use the [PDL schema](https://github.com/IBM/prompt-declaration-language/blob/main/src/pdl/pdl-schema.json). This enables the editor to display error messages when the yaml deviates from the PDL syntax and grammar. It also provides code completion.
84-
The PDL repository has been configured so that every `*.pdl` file is associated with the PDL grammar JSONSchema (see [settings](https://github.com/IBM/prompt-declaration-language/blob/main/.vscode/settings.json)). You can set up your own VSCode PDL projects similarly using the following `.vscode/settings.json` file:
83+
We highly recommend to edit PDL programs using an editor that support YAML with JSON Schema validation. For example, you can use VSCode with the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and configure it to use the [PDL schema](https://github.com/anonymous/prompt-declaration-language/blob/main/src/pdl/pdl-schema.json). This enables the editor to display error messages when the yaml deviates from the PDL syntax and grammar. It also provides code completion.
84+
The PDL repository has been configured so that every `*.pdl` file is associated with the PDL grammar JSONSchema. You can set up your own VSCode PDL projects similarly using the following `.vscode/settings.json` file:
8585

8686
```
8787
{
8888
"yaml.schemas": {
89-
"https://ibm.github.io/prompt-declaration-language/dist/pdl-schema.json": "*.pdl"
89+
./src/pdl/pdl-schema.json": "*.pdl"
9090
},
9191
"files.associations": {
9292
"*.pdl": "yaml",
@@ -106,7 +106,7 @@ We can pass initial data to the interpreter to populate variables used in a PDL
106106
pdl --data <JSON-or-YAML-data> <my-example>
107107
```
108108

109-
For an example, see [file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/free_variables.pdl).
109+
For an example, see [file](../examples/tutorial/free_variables.pdl).
110110

111111
This can also be done by passing a JSON or YAML file:
112112

@@ -209,13 +209,13 @@ The PDL interpreter can also stream the background conversation instead of the r
209209
pdl --stream context examples/hello/hello.pdl
210210
```
211211

212-
See the [tutorial](https://ibm.github.io/prompt-declaration-language/tutorial) for more information about the conversational background context and how to use roles and chat templates.
212+
See the [tutorial](./tutorial.md) for more information about the conversational background context and how to use roles and chat templates.
213213

214214

215215
Consider now an example from AI for code, where we want to build a prompt template for code explanation. We have a JSON file as input
216216
containing the source code and some information regarding the repository where it came from.
217217

218-
For example, given the data in this JSON [file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/code/data.yaml):
218+
For example, given the data in this JSON [file](../examples/code/data.yaml):
219219
```yaml
220220
source_code:
221221
|
@@ -259,7 +259,7 @@ public static Map<String, String> deserializeOffsetMap(String lastSourceOffset)
259259
}
260260
```
261261

262-
In PDL, this would be expressed as follows (see [file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/code/code.pdl)):
262+
In PDL, this would be expressed as follows (see [file](../examples/code/code.pdl)):
263263

264264
```yaml
265265
description: Code explanation example
@@ -310,7 +310,7 @@ public static Map<String, String> deserializeOffsetMap(String lastSourceOffset)
310310
The code is a Java method that takes a string `lastSourceOffset` as input and returns a `Map<String, String>`. The method uses the Jackson library to deserialize the JSON-formatted string into a map. If the input string is null or empty, an empty HashMap is returned. Otherwise, the string is deserialized into a Map using the `JSON_MAPPER.readValue()` method.
311311
```
312312

313-
Notice that in PDL variables are used to templatize any entity in the document, not just textual prompts to LLMs. We can add a block to this document to evaluate the quality of the output using a similarity metric with respect to our [ground truth](https://github.com/IBM/prompt-declaration-language/blob/main/examples/code/ground_truth.txt). See [file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/code/code-eval.pdl):
313+
Notice that in PDL variables are used to templatize any entity in the document, not just textual prompts to LLMs. We can add a block to this document to evaluate the quality of the output using a similarity metric with respect to our [ground truth](../examples/code/ground_truth.txt). See [file](../examples/code/code-eval.pdl):
314314

315315
```yaml
316316
description: Code explanation example
@@ -438,7 +438,7 @@ The output of this program is the corresponding serialized JSON object, with the
438438
439439
## PDL Language Tutorial
440440
441-
See [PDL Language Tutorial](https://ibm.github.io/prompt-declaration-language/tutorial)
441+
See [PDL Language Tutorial](./tutorial.md)
442442
443443
## Debugging Tools
444444
@@ -451,7 +451,7 @@ To produce an execution trace consumable by the Live Explorer, you can run the i
451451
pdl <my-example> --trace <my-example_trace.json>
452452
```
453453
454-
This produces an additional file named `my-example_trace.json` that can be uploaded to the [Live Explorer](https://ibm.github.io/prompt-declaration-language/viewer/) visualizer tool. The Live Explorer shows a timeline of execution and a tile for every block. By clicking on a tile, the user can discover more information such as input/context/output for LLM calls. It also provides the ability to re-run a block for eventual live programming.
454+
This produces an additional file named `my-example_trace.json` that can be uploaded to the [Live Explorer](./viewer.md) visualizer tool. The Live Explorer shows a timeline of execution and a tile for every block. By clicking on a tile, the user can discover more information such as input/context/output for LLM calls. It also provides the ability to re-run a block for eventual live programming.
455455
456456
This is similar to a spreadsheet for tabular data, where data is in the forefront and the user can inspect the formula that generates the data in each cell. In the Live Explorer, cells are not uniform but can take arbitrary extents. Clicking on them similarly reveals the part of the code that produced them.
457457
@@ -460,9 +460,9 @@ This is similar to a spreadsheet for tabular data, where data is in the forefron
460460
PDL includes experimental support for gathering trace telemetry. This can
461461
be used for debugging or performance analysis, and to see the shape of prompts sent by LiteLLM to models.
462462
463-
For more information see [here](https://github.com/IBM/prompt-declaration-language/blob/main/docs/telemetry.md).
463+
For more information see [here](./telemetry.md).
464464
465-
<img src="https://ibm.github.io/prompt-declaration-language/assets/telemetry.png" alt="Trace Telemetry"/>
465+
<img src="./telemetry.png" alt="Trace Telemetry"/>
466466

467467
## Best Practices
468468

@@ -504,10 +504,3 @@ When using Granite models, we use the following defaults for model parameters:
504504
- `temperature`: 0.7
505505
- `top_p`: 0.85
506506
- `top_k`: 50
507-
508-
For a complete list of issues see [here](https://github.com/IBM/prompt-declaration-language/issues).
509-
510-
511-
## Contributing to the Project
512-
513-
See [Contributing to PDL](https://ibm.github.io/prompt-declaration-language/contrib).

docs/contrib.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ You can report issues or open a pull request (PR) to suggest changes.
66

77
To report an issue, or to suggest an idea for a change that you haven't had time to write-up yet:
88

9-
1. [Review existing issues](https://github.com/IBM/prompt-declaration-language/issues) to see if a similar issue has been opened or discussed.
9+
1. [Review existing issues](https://github.com/anonymous/prompt-declaration-language/issues) to see if a similar issue has been opened or discussed.
1010

1111
2. [Open an
12-
issue](https://github.com/IBM/prompt-declaration-language/issues/new). Be sure to include any helpful information, such as version used, error messages, or logs that you might have.
12+
issue](https://github.com/anonymous/prompt-declaration-language/issues/new). Be sure to include any helpful information, such as version used, error messages, or logs that you might have.
1313

1414

15-
To report vulnerabilities privately, you can contact the authors by email (see [pyproject.toml](https://github.com/IBM/prompt-declaration-language/blob/main/pyproject.toml)).
15+
To report vulnerabilities privately, you can contact the authors by email (see [pyproject.toml](https://github.com/anonymous/prompt-declaration-language/blob/main/pyproject.toml)).
1616

1717
## Suggesting a change
1818

19-
To suggest a change to this repository, [submit a pull request](https://github.com/IBM/prompt-declaration-language/pulls) with the complete set of changes that you want to suggest. Before creating a PR, make sure that your changes pass all of the tests and add tests for new features.
19+
To suggest a change to this repository, [submit a pull request](https://github.com/anonymous/prompt-declaration-language/pulls) with the complete set of changes that you want to suggest. Before creating a PR, make sure that your changes pass all of the tests and add tests for new features.
2020

2121
The test suite can be executed with the following command in the top-level folder:
2222
```
@@ -34,7 +34,7 @@ pre-commit run --all-files
3434

3535
Follow the following instructions to set up a dev environment to get started with contributing to PDL.
3636

37-
1. Create a fork of https://github.com/IBM/prompt-declaration-language
37+
1. Create a fork of https://github.com/anonymous/prompt-declaration-language
3838
2. Clone your fork
3939
3. Set up a Python virtual environment and install dependencies
4040

0 commit comments

Comments
 (0)