Skip to content

Commit e25cfc0

Browse files
committed
Update NPX related description
1 parent b900b11 commit e25cfc0

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,41 @@ With the [Docker image](https://hub.docker.com/r/aiql/openai-proxy-docker), you
2222
- #### [RESTful OpenAPI](https://api-ui.aiql.com) (provided by AIQL)
2323

2424

25-
## How to use
26-
Just:
25+
## Run remotely via Docker
26+
27+
Execute this command to start the proxy with default settings:
2728

2829
```shell
2930
sudo docker run -d -p 9017:9017 aiql/openai-proxy-docker:latest
3031
```
3132

32-
Then, you can use it by ```YOURIP:9017```
33+
Then, you can access it by ```YOURIP:9017```
3334

3435
> For example, the proxied OpenAI Chat Completion API will be: ```YOURIP:9017/v1/chat/completions```
3536
>
3637
> It should be the same as ```api.openai.com/v1/chat/completions```
3738
3839
You can change default port and default target by setting `-e` in docker, which means that you can use it for any backend followed by OpenAPI format:
40+
3941
| Parameter | Default Value |
40-
| ----- | ----- |
41-
| PORT | 9017 |
42-
| TARGET | https://api.openai.com |
42+
| --------- | ------------- |
43+
| PORT | 9017 |
44+
| TARGET | https://api.openai.com |
45+
46+
47+
## Run locally via NPX
48+
49+
Execute this command to start the proxy with default settings:
50+
51+
```shell
52+
npx @ai-ql/api-proxy
53+
```
54+
55+
To skip installation prompts and specify parameters:
56+
57+
```shell
58+
npx -y @ai-ql/api-proxy --target="https://api.deepinfra.com/v1/openai" --port="9019"
59+
```
4360

4461

4562
## How to dev

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ function createProxyApp(target) {
2525
},
2626
error: (err, req, res) => {
2727
console.error('Proxy error:', err);
28-
res.status(500).send('Proxy error');
28+
res.status(500).json({
29+
error: 'Proxy Error',
30+
message: err.message
31+
});
2932
},
3033
},
3134
}));

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)