Skip to content

Commit 6ece610

Browse files
committed
review and rewrite the readme
1 parent 632ded6 commit 6ece610

File tree

1 file changed

+95
-86
lines changed

1 file changed

+95
-86
lines changed

README.md

Lines changed: 95 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
1+
2+
13
<p align="center">
24
<p align="center">
35
<a href="https://promptsail.com/?utm_source=github&utm_medium=logo" target="_blank">
4-
<img src="https://bucket.mlcdn.com/a/1777/1777896/images/c2ba3a2cf624d3343a98cbb35f1d02dd373d8000.png" alt="Prompt Sail" width="390" height="91">
6+
<img src="docs/assets/images/Logo-teal_black.png" alt="Prompt Sail" width="390" height="91">
57
</a>
68
</p>
79
<p align="center">
8-
Open Source LLM prompt management and monitoring.
10+
LLM’s proxy for prompt and response governance, monitoring, and analysis.
911
</p>
1012
</p>
1113

14+
> ⚠️ **Prompt Sail is currently in Development**: Expect breaking changes and bugs! Feedback and contributions are welcome. Please see the [Contributing Guide](CONTRIBUTING.md) for more information.
15+
16+
<p align="center">
17+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
18+
<img alt="GitHub License" src="https://img.shields.io/github/license/promptsail/prompt_sail">
19+
<img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/promptsail/prompt_sail/docker-publish.yml?label=Build%20and%20Publish%20Docker">
20+
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/promptsail/prompt_sail"/>
21+
<img alt="Github Last Commit" src="https://img.shields.io/github/last-commit/promptsail/prompt_sail"/>
22+
<img alt="Github Contributors" src="https://img.shields.io/github/contributors/promptsail/prompt_sail"/>
23+
<img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/promptsail/prompt_sail"/>
24+
25+
</p>
26+
27+
1228
## What is Prompt Sail?
1329

14-
Prompt Sail is a proxy for Large Language Models (LLMs) such as GPT-3, ChatGPT, DialoGPT, etc.
15-
that allows you to record prompts and responses, analyze the output, compare the outcome over time,
16-
track trends and changes across various models and their versions.
30+
Prompt Sail is a proxy for Large Language Models (LLMs) API's such as OpenAI GPT models, Azure OpenAI, Anthropic Clude etc. that allows you to record prompts and responses, analyze costs, generation speed, compare and track trends and changes across various models and projects over time.
31+
32+
To learn more about Prompt Sail’s features and capabilities, see
33+
34+
* [Documentation](https://promptsail.github.io/prompt_sail/).
35+
36+
* [Examples](https://github.com/PromptSail/prompt_sail/tree/main/examples)
37+
* [OpenAI SDK -> OpenAI API](/examples/openai_sdk_openai.ipynb)
38+
* [Langchain SDK -> OpenAI API](/examples/langchain_openai.ipynb)
39+
* [OpenAI SDK -> Azure OpenAI](/examples/openai_sdk_azure_openai.ipynb)
40+
* [Langchain SDK -> Azure OpenAI](/examples/langchain_azure_openai.ipynb)
41+
* [Langchain SDK -> Azure OpenAI Ada embeddings](/examples/langchain_azure_oai_embeddings.ipynb)
1742

18-
To learn more about Prompt Sail’s features and capabilities, see our [product page](https://promptsail.com/).
43+
<!-- * [API Reference](https://promptsail.github.io/prompt_sail/api/). -->
1944

2045
## Getting started
2146

2247
The simplest way to try Prompt Sail is to create a project on https://try.promptsail.com and integrate it with
2348
your code.
2449

25-
If you prefer to install and manage Prompt Sail yourself, you can download a docker image and run it locally.
50+
If you prefer to install and manage Prompt Sail yourself, you can build or download a docker image and run it locally.
2651

27-
## Run Prompt Sail locally
52+
## Run Prompt Sail locally via Docker Compose
2853

2954
To try out Start Prompt on your own machine, we recommend using docker-compose. Docker images are available from ...
3055

@@ -39,112 +64,96 @@ cd prompt_sail
3964

4065

4166

42-
### Linux machine
67+
### Build docker images
4368

44-
1. Since Prompt Sail relies on subdomains, first you should update your `/ect/hosts` file with the following lines:
45-
46-
```bash
47-
127.0.1.1 project1.promptsail.local
48-
127.0.1.1 project2.promptsail.local
49-
127.0.1.1 promptsail.local
50-
```
51-
52-
3. Build and run the docker image:
69+
Build and run the docker image:
5370

5471
```bash
5572
docker-docker-compose up --build
5673
```
5774

58-
If you want to run the code locally:
59-
60-
Create `.env` file in the root project directory with the following content:
6175

62-
```
63-
OPENAI_API_KEY="[your-openai-api-key]"
64-
MONGO_URL="mongodb://root:password@localhost:27017"
65-
BASE_URL="http://promptsail.local:8000"
66-
```
67-
68-
Make sure you have Poetry installed, then:
69-
```bash
70-
poetry install
71-
poetry shell
72-
```
73-
74-
Make sure you have `make` installed, then:
75-
76-
```bash
77-
make run # to start docker-compose
78-
```
79-
80-
```bash
81-
cd src
82-
python main.py # to run the code
83-
```
84-
85-
### Windows 11 machine
86-
87-
1. Since Prompt Sail relies on subdomains, first you should update your system `host`
88-
```
89-
notepad C:\Windows\System32\Drivers\etc\hosts
90-
```
91-
file with the following lines:
92-
93-
94-
```bash
95-
127.0.1.1 project1.promptsail.local
96-
127.0.1.1 project2.promptsail.local
97-
127.0.1.1 promptsail.local
98-
```
76+
### Create a project
9977

78+
Navigate to http://localhost:80 and add you AI provider of choice.
10079

101-
2. Build and run the docker image:
10280

103-
```bash
104-
docker-compose up --build
105-
```
81+
### Modify your code to use Prompt Sail proxy
10682

83+
To use Prompt Sail with `openai` Python library, you need to set `OPENAI_API_BASE` environment variable, or
84+
modify `openai.api_base` parameter to point to your Prompt Sail project.
10785

86+
```python
87+
from openai import OpenAI
88+
import os
89+
from dotenv import load_dotenv
90+
from pprint import pprint
10891

92+
load_dotenv()
10993

110-
### Create a project
94+
openai_key = os.getenv("OPENAI_API_KEY")
95+
openai_org_id = os.getenv("OPENAI_ORG_ID")
11196

112-
Navigate to http://promptsail.local, feel free to browse projects.
113-
Creating a new project via UI is not yet implemented, stay tuned for new commits.
97+
api_base = "http://localhost:8000/project1/openai/"
11498

115-
### Modify your code to use Prompt Sail proxy
99+
ps_client = OpenAI(
100+
base_url=api_base,
101+
api_key=openai_key,
102+
)
116103

117-
To use Prompt Sail with `openai` Python library, you need to set `OPENAI_API_BASE` environment variable, or
118-
modify `openai.api_base` parameter to point to your Prompt Sail project.
119-
```python
120-
import openai
121-
openai.api_base = "http://[your-project-id].promptsail.local:8000"
122-
openai.ChatCompletion.create(
104+
response = ps_client.chat.completions.create(
123105
model="gpt-3.5-turbo",
124-
messages=[{"role": "user", "content": "Explaining the meaning of life in one sentence."}],
106+
messages=[
107+
{
108+
"role": "system",
109+
"content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair.",
110+
},
111+
{
112+
"role": "user",
113+
"content": "Compose a poem that explains the concept of recursion in programming.",
114+
},
115+
],
125116
)
117+
118+
pprint(response.choices[0].message)
126119
```
127120

128121
Using Prompt Sail with `langchain` is similar:
129122
```python
130-
from langchain.llms import OpenAI
131-
llm = OpenAI(
132-
model_name="text-davinci-003",
133-
openai_api_base="http://[your-project-id].promptsail.local:8000",
123+
from langchain.chat_models import ChatOpenAI
124+
from langchain.prompts.chat import (
125+
ChatPromptTemplate,
126+
HumanMessagePromptTemplate,
127+
SystemMessagePromptTemplate,
134128
)
135-
llm("Explaining the meaning of life in one sentence.")
129+
from langchain.schema import HumanMessage, SystemMessage
130+
131+
haiku_prompt = [
132+
SystemMessage(
133+
content="You are a poetic assistant, skilled in explaining complex programming concepts with creative flair.",
134+
),
135+
HumanMessage(
136+
content="Compose a haiku that explains the concept of recursion in programming.",
137+
),
138+
]
139+
chat = ChatOpenAI(
140+
temperature=0.9,
141+
openai_api_key=openai_key,
142+
openai_organization=openai_org_id,
143+
model="gpt-3.5-turbo-1106",
144+
)
145+
146+
chat(haiku_prompt)
136147
```
137148

138-
### Analyzing the prompts and responses
149+
## Contact
139150

140-
After running your LLM code, navigate back to your project page and see the prompt and response recorded.
151+
- Bugs & requests: file a GitHub ticket
152+
- For business inquiries: email contact@promptsail.com.
153+
- Our website: [https://promptsail.com](https://promptsail.com)
141154

142-
## Testing
143155

144-
To run tests, simpy run `make test`.
156+
## License
145157

146-
## Building the docker image
158+
Prompt Sail is free and open source, under the [MIT license](LICENSE).
147159

148-
```bash
149-
make build
150-
```

0 commit comments

Comments
 (0)