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
|`PROMPTLAB_SECRET_KEY`|**Recommended**| JWT signing key for authentication. Should be 32+ characters for security. | Auto-generated (not persistent) |
This sample ([quickstart.py](quickstart.py)) demonstrates how to use PromptLab to evaluate a simple prompt.
3
+
This sample ([hosted.py](hosted.py)) demonstrates how to use self-hosted PromptLab.
4
4
5
5
## Installation and Setup
6
6
7
-
It's highly recommended to use a virtual environment (try venv or conda or uv).
7
+
To host PromptLab in your environment, please follow this guide - [Self Hosting PromptLab](../../docs/self_hosting.md).
8
+
9
+
To interact with the hosted PromptLab service, locally install the PromptLab package in a virtual environment (try venv or conda or uv).
8
10
9
11
```bash
10
12
pip install promptlab
@@ -15,79 +17,15 @@ pip install promptlab
15
17
The first step to use PromptLab is to initialize the PromptLab object. Please check [Tracer](../../docs/README.md#tracer) to learn more about the tracer configuration.
Once the PromptLab object is ready, you can start the PromptLab Studio to check the assets and experiments.
23
-
24
-
```python
25
-
pl.studio.start(8000)
26
-
```
27
-
28
-
## Create a Prompt Template
29
-
30
-
A prompt template is a prompt with or without placeholders. Please check [Prompt Template](../../docs/README.md#prompt-template) to learn more about it.
31
-
32
-
A prompt template has two main attributes - `system_prompt` and `user_prompt`. The sample prompt used in this example is:
33
-
34
-
```python
35
-
prompt_name ="essay_feedback"
36
-
prompt_description ="A prompt for generating feedback on essays"
37
-
system_prompt ="You are a helpful assistant who can provide feedback on essays."
38
-
user_prompt ="""The essay topic is - <essay_topic>.
Here, `<essay_topic>` and `<essay>` are placeholders that will be replaced with real data before sending to the LLM. PromptLab will search the dataset for columns with these exact names and use their values to replace the corresponding placeholders. Ensure that the dataset contains columns named `essay_topic` and `essay`.
46
-
47
-

48
-
49
-
## Create Dataset
50
-
51
-
A dataset is a JSONL file used to design the experiment. Please check [Dataset](../../docs/README.md#dataset) to learn more about it.
52
-
53
-
```python
54
-
dataset_name ="essay_samples"
55
-
dataset_description ="dataset for evaluating the essay_feedback prompt"
An experiment evaluates the outcome of a prompt against a set of metrics for a given dataset. Developers can modify hyperparameters (such as prompt template and models) and compare experiment results to determine the best prompt to deploy in production. Please check [Experiment](../../docs/README.md#experiment) to learn more about it.
66
-
67
-
In the [quickstart.py](quickstart.py), we are using the prompt template and dataset created in the previous steps to design an experiment. It also uses two evaluation metrics: `semantic_similarity` and `fluency`. Please check [Metric](../../docs/README.md#metric) to learn more about evaluation metrics.
0 commit comments