Skip to content

Commit 7602b08

Browse files
committed
2 parents 51b8a04 + 85ed756 commit 7602b08

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@ It only caches `POST` requests that have a JSON request body, as these tend to b
1010

1111
Clone the repo and install dependencies.
1212

13-
You will need to sign up for two services if you haven't already:
13+
You will need to sign up for two services (which both have free tiers):
1414

15-
- [Cloudflare](https://www.cloudflare.com):
16-
- [Upstash](https://upstash.com): Cache is stored using Upstash's Worker-compatible redis-over-HTTP service.
15+
- [Cloudflare](https://www.cloudflare.com): Where our worker will be hosted.
16+
- [Upstash](https://upstash.com): We use Upstash's redis-over-HTTP service for storing cached OpenAI responses. Depending on your usage, you may try replacing Redis with [Cloudflare KV](https://developers.cloudflare.com/workers/runtime-apis/kv/) instead which is eventually consistent but will likely provide better read latency.
1717

18-
Both Cloudflare and Upstash have generous free plans.
19-
20-
Set up your redis secrets based on instructions in `wrangler.toml`.
18+
Finally, set up your redis secrets based on instructions in `wrangler.toml`.
2119

2220
### Usage
2321

24-
Start the proxy server (will start at http://localhost:8787 by default):
22+
Start the proxy server at http://localhost:8787 with:
2523

2624
```
2725
yarn start
2826
```
2927

30-
Then, in your [openai/openai-node](https://github.com/openai/openai-node) configuration, pass in the new `basePath` so that it sends requests through your proxy rather than directly to OpenAI:
28+
Then, in your separate project where you have your [openai/openai-node](https://github.com/openai/openai-node) configuration, pass in the new `basePath` so that it sends requests through your proxy rather than directly to OpenAI:
3129

3230
```diff
3331
const { Configuration, OpenAIApi } = require("openai");

0 commit comments

Comments
 (0)