You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Create a report to help us reproduce and fix the bug
2
+
description: Report a bug to help us improve prompt-ops
3
3
labels: ["bug"]
4
4
body:
5
5
- type: markdown
6
6
attributes:
7
7
value: >
8
-
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the
9
-
existing and past issues](https://github.com/meta-llama/llama-stack/issues).
8
+
Thanks for taking the time to report a bug! Please search [existing issues](https://github.com/meta-llama/prompt-ops/issues) first to avoid duplicates.
10
9
11
10
- type: textarea
12
-
id: system-info
11
+
id: bug-description
13
12
attributes:
14
-
label: System Info
15
-
description: |
16
-
Please share your system info with us. You can use the following command to capture your environment information
17
-
python -m "torch.utils.collect_env"
18
-
13
+
label: What happened?
14
+
description: A clear description of the bug and what you expected to happen instead.
19
15
placeholder: |
20
-
PyTorch version, CUDA version, GPU type, #num of GPUs...
16
+
I was trying to optimize prompts using the facility dataset, but...
17
+
18
+
Expected: The optimization should complete successfully
19
+
Actual: Got an error about missing configuration
21
20
validations:
22
21
required: true
23
22
24
-
- type: checkboxes
25
-
id: information-scripts-examples
26
-
attributes:
27
-
label: Information
28
-
description: 'The problem arises when using:'
29
-
options:
30
-
- label: "The official example scripts"
31
-
- label: "My own modified scripts"
32
-
33
23
- type: textarea
34
-
id: bug-description
24
+
id: reproduction
35
25
attributes:
36
-
label: 🐛 Describe the bug
37
-
description: |
38
-
Please provide a clear and concise description of what the bug is.
39
-
40
-
Please also paste or describe the results you observe instead of the expected results.
26
+
label: How to reproduce
27
+
description: Steps to reproduce the issue, including any commands or code.
41
28
placeholder: |
42
-
A clear and concise description of what the bug is.
29
+
1. Run `prompt-ops optimize --config configs/facility.yaml`
30
+
2. See error...
43
31
44
-
```llama stack
45
-
# Command that you used for running the examples
32
+
```bash
33
+
# Your command here
46
34
```
47
-
Description of the results
48
35
validations:
49
36
required: true
50
37
51
38
- type: textarea
39
+
id: environment
52
40
attributes:
53
-
label: Error logs
54
-
description: |
55
-
If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````.
56
-
41
+
label: Environment
42
+
description: Your Python version and any relevant system info.
57
43
placeholder: |
58
-
```
59
-
The error message you got, with the full traceback.
60
-
```
61
-
44
+
- Python version: 3.9.0
45
+
- prompt-ops version: 0.0.8
46
+
- OS: macOS 14.0
62
47
validations:
63
-
required: true
64
-
48
+
required: false
65
49
66
50
- type: textarea
67
-
id: expected-behavior
68
-
validations:
69
-
required: true
70
-
attributes:
71
-
label: Expected behavior
72
-
description: "A clear and concise description of what you would expect to happen."
73
-
74
-
- type: markdown
51
+
id: error-logs
75
52
attributes:
76
-
value: >
77
-
Thanks for contributing 🎉!
53
+
label: Error logs (if any)
54
+
description: Paste any error messages or stack traces.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Contributing to llama-prompt-ops
1
+
# Contributing to prompt-ops
2
2
We want to make contributing to this project as easy and transparent as
3
3
possible.
4
4
@@ -23,4 +23,4 @@ We use GitHub issues to track public bugs. Please ensure your description is cle
23
23
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
24
24
25
25
## License
26
-
By contributing to llama-prompt-ops, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.
26
+
By contributing to prompt-ops, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.
Copy file name to clipboardExpand all lines: README.md
+41-26Lines changed: 41 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,52 @@
1
-
<h1align="center"> Llama Prompt Ops </h1>
1
+
<h1align="center"> Prompt Ops </h1>
2
2
3
-
## What is llama-prompt-ops?
3
+
### 🎉 New: Prompt Duel Optimizer (PDO) Published!
4
+
5
+
We've published a new paper on **PDO (Prompt Duel Optimizer)** - an efficient label-free prompt optimization method using dueling bandits and Thompson sampling. PDO achieves state-of-the-art results on BIG-bench Hard and MS MARCO benchmarks.
<ahref="https://github.com/meta-llama/llama-models/blob/main/models/?utm_source=llama-prompt-ops&utm_medium=readme&utm_campaign=main"><imgalt="Llama Model cards"src="https://img.shields.io/badge/Llama_OSS-Model_cards-green?logo=meta" /></a>
<ahref="https://github.com/meta-llama/llama-models/blob/main/models/?utm_source=prompt-ops&utm_medium=readme&utm_campaign=main"><imgalt="Llama Model cards"src="https://img.shields.io/badge/Llama_OSS-Model_cards-green?logo=meta" /></a>
<ahref="https://huggingface.co/meta-llama"><imgalt="Hugging Face meta-llama"src="https://img.shields.io/badge/Hugging_Face-meta--llama-yellow?logo=huggingface" /></a>
17
29
18
30
</p>
19
31
<palign="center">
20
32
<ahref="https://github.com/meta-llama/synthetic-data-kit"><imgalt="Llama Tools Syntethic Data Kit"src="https://img.shields.io/badge/Llama_Tools-synthetic--data--kit-orange?logo=meta" /></a>
21
-
<ahref="https://github.com/meta-llama/llama-prompt-ops"><imgalt="Llama Tools Syntethic Data Kit"src="https://img.shields.io/badge/Llama_Tools-llama--prompt--ops-orange?logo=meta" /></a>
33
+
<ahref="https://github.com/meta-llama/prompt-ops"><imgalt="Llama Tools Syntethic Data Kit"src="https://img.shields.io/badge/Llama_Tools-prompt--ops-orange?logo=meta" /></a>
llama-prompt-ops is a Python package that **automatically optimizes prompts** for Llama models. It transforms prompts that work well with other LLMs into prompts that are optimized for Llama models, improving performance and reliability.
39
+
prompt-ops is a Python package that **automatically optimizes prompts** for Llama models. It transforms prompts that work well with other LLMs into prompts that are optimized for LLM models, improving performance and reliability.
28
40
29
41
**Key Benefits:**
30
42
-**No More Trial and Error**: Stop manually tweaking prompts to get better results
31
-
-**Fast Optimization**: Get Llama-optimized prompts in minutes with template-based optimization
43
+
-**Fast Optimization**: Get model-optimized prompts in minutes with template-based optimization
32
44
-**Data-Driven Improvements**: Use your own examples to create prompts that work for your specific use case
33
45
-**Measurable Results**: Evaluate prompt performance with customizable metrics
34
46
35
47
## Requirements
36
48
37
-
To get started with llama-prompt-ops, you'll need:
49
+
To get started with prompt-ops, you'll need:
38
50
39
51
- Existing System Prompt: Your existing system prompt that you want to optimize
40
52
- Existing Query-Response Dataset: A JSON file containing query-response pairs (as few as 50 examples) for evaluation and optimization (see [prepare your dataset](#preparing-your-data) below)
@@ -50,7 +62,7 @@ To get started with llama-prompt-ops, you'll need:
@@ -66,7 +78,7 @@ To get started with llama-prompt-ops, you'll need:
66
78
2.[**Prepare your dataset**](#preparing-your-data): Create a JSON file with query-response pairs for evaluation and optimization
67
79
3.**Configure optimization**: Set up a simple YAML file with your dataset and preferences (see [example configuration](configs/facility-simple.yaml))
68
80
4.[**Run optimization**](#step-4-run-optimization): Execute a single command to transform your prompt
69
-
5.[**Get results**](#prompt-transformation-example): Receive a Llama-optimized prompt with performance metrics
81
+
5.[**Get results**](#prompt-transformation-example): Receive a model-optimized prompt with performance metrics
70
82
71
83
72
84
## Real-world Results
@@ -85,27 +97,29 @@ These results were measured on the [HotpotQA multi-hop reasoning benchmark](http
85
97
86
98
### Step 1: Installation
87
99
100
+
> **Note:** We recommend installing from source as we are currently transitioning package names on PyPI. This ensures you get the latest stable version without any naming conflicts.
# Alternative: Install from PyPI (may have naming transition issues, still on version 0.0.7)
113
+
# pip install llama-prompt-ops
114
+
101
115
```
102
116
103
117
### Step 2: Create a sample project
104
118
105
119
This will create a directory called my-project with a sample configuration and dataset in the current folder.
106
120
107
121
```bash
108
-
llama-prompt-ops create my-project
122
+
prompt-ops create my-project
109
123
cd my-project
110
124
```
111
125
@@ -116,13 +130,14 @@ Add your API key to the `.env` file:
116
130
```bash
117
131
OPENROUTER_API_KEY=your_key_here
118
132
```
119
-
You can get an OpenRouter API key by creating an account at [OpenRouter](https://openrouter.ai/). For more inference provider options, see [Inference Providers](./docs/inference_providers.md).
133
+
134
+
prompt-ops uses LiteLLM as a unified API client. LiteLLM automatically detects the provider from your model name (e.g., `openrouter/model`, `groq/model`) and looks for the corresponding provider-specific environment variable (`OPENROUTER_API_KEY`, `GROQ_API_KEY`, etc.). For more inference provider options, see [Inference Providers](./docs/inference_providers.md).
120
135
121
136
### Step 4: Run Optimization
122
137
The optimization will take about 5 minutes.
123
138
124
139
```bash
125
-
llama-prompt-ops migrate # defaults to config.yaml if --config not specified
140
+
prompt-ops migrate # defaults to config.yaml if --config not specified
126
141
```
127
142
128
143
Done! The optimized prompt will be saved to the `results` directory with performance metrics comparing the original and optimized versions.
@@ -141,7 +156,7 @@ Below is an example of a transformed system prompt from proprietary LM to Llama:
141
156
142
157
## Preparing Your Data
143
158
144
-
To use llama-prompt-ops for prompt optimization, you'll need to prepare a dataset with your prompts and expected responses. The standard format is a JSON file structured like this:
159
+
To use prompt-ops for prompt optimization, you'll need to prepare a dataset with your prompts and expected responses. The standard format is a JSON file structured like this:
145
160
146
161
```json
147
162
[
@@ -156,15 +171,15 @@ To use llama-prompt-ops for prompt optimization, you'll need to prepare a datase
156
171
]
157
172
```
158
173
159
-
If your data matches this format, you can use the built-in [`StandardJSONAdapter`](src/llama_prompt_ops/core/datasets.py) which will handle it automatically.
174
+
If your data matches this format, you can use the built-in [`StandardJSONAdapter`](src/prompt_ops/core/datasets.py) which will handle it automatically.
160
175
161
176
### Custom Data Formats
162
177
163
178
If your data is formatted differently, and there isn't a built-in dataset adapter, you can create a custom dataset adapter by extending the `DatasetAdapter` class. See the [Dataset Adapter Selection Guide](docs/dataset_adapter_selection_guide.md) for more details.
164
179
165
180
## Multiple Inference Provider Support
166
181
167
-
llama-prompt-ops supports various inference providers and endpoints to fit your infrastructure needs. See our [detailed guide on inference providers](./docs/inference_providers.md) for configuration examples with:
182
+
prompt-ops supports various inference providers and endpoints to fit your infrastructure needs. See our [detailed guide on inference providers](./docs/inference_providers.md) for configuration examples with:
168
183
169
184
- OpenRouter (cloud-based API)
170
185
- vLLM (local deployment)
@@ -174,7 +189,7 @@ llama-prompt-ops supports various inference providers and endpoints to fit your
174
189
175
190
For more detailed information, check out these resources:
176
191
177
-
-[Quick Start Guide](docs/basic/readme.md): Get up and running with llama-prompt-ops in 5 minutes
192
+
-[Quick Start Guide](docs/basic/readme.md): Get up and running with prompt-ops in 5 minutes
178
193
-[Intermediate Configuration Guide](docs/intermediate/readme.md): Learn how to configure datasets, metrics, and optimization strategies
179
194
-[Dataset Adapter Selection Guide](docs/dataset_adapter_selection_guide.md): Choose the right adapter for your dataset format
180
195
-[Metric Selection Guide](docs/metric_selection_guide.md): Select appropriate evaluation metrics for your use case
0 commit comments