simplifies infopage and updates README

This commit is contained in:
nai-degen 2023-04-11 03:19:05 -07:00 committed by nai-degen
parent 15ed8e7c25
commit 44f667976a
3 changed files with 9 additions and 21 deletions

View File

@ -6,10 +6,9 @@ colorTo: purple
sdk: docker sdk: docker
pinned: false pinned: false
--- ---
<!-- -->
# OAI Reverse Proxy # OAI Reverse Proxy
Reverse proxy server for the OpenAI API. Forwards text generation requests while rejecting administrative/billing requests. Includes optional rate limiting and prompt filtering to prevent abuse. Reverse proxy server for the OpenAI (and soon Anthropic) APIs. Forwards text generation requests while rejecting administrative/billing requests. Includes optional rate limiting and prompt filtering to prevent abuse.
### Table of Contents ### Table of Contents
- [What is this?](#what-is-this) - [What is this?](#what-is-this)
@ -19,16 +18,14 @@ Reverse proxy server for the OpenAI API. Forwards text generation requests while
- [Deploy to Repl.it (WIP)](#deploy-to-replit-wip) - [Deploy to Repl.it (WIP)](#deploy-to-replit-wip)
## What is this? ## What is this?
If you have an API key you want to share with a friend, you can use this to keep your key safe while still allowing them to generate text with the API. If you would like to provide a friend access to an API via keys you own, you can use this to keep your keys safe while still allowing them to generate text with the API. You can also use this if you'd like to build a client-side application which uses the OpenAI or Anthropic APIs, but don't want to build your own backend. You should never embed your real API keys in a client-side application. Instead, you can have your frontend connect to this reverse proxy and forward requests to the downstream service.
You can also use this if you'd like to build a client-side application which uses the OpenAI, but don't want to build your own backend. You should never embed your real OpenAI API key in a client-side application. Instead, you can have your frontend connect to this reverse proxy and forward requests to OpenAI.
This keeps your keys safe and allows you to use the rate limiting and prompt filtering features of the proxy to prevent abuse. This keeps your keys safe and allows you to use the rate limiting and prompt filtering features of the proxy to prevent abuse.
## Why? ## Why?
OpenAI keys have full account permissions. They can revoke themselves, generate new keys, modify spend quotas, etc. You absolutely should not share them, nor should you embed them in client-side applications as they can be easily stolen. OpenAI keys have full account permissions. They can revoke themselves, generate new keys, modify spend quotas, etc. **You absolutely should not share them, post them publicly, nor embed them in client-side applications as they can be easily stolen.**
This proxy only forwards text generation requests to OpenAI and rejects requests which would otherwise modify your account. This proxy only forwards text generation requests to the downstream service and rejects requests which would otherwise modify your account.
--- ---

View File

@ -1,8 +1,5 @@
<!-- This file is loaded by the server's status page. It is a good place to put <!-- Don't remove this header, Showdown needs it to parse the file correctly -->
friendly welcome messages and instructions for connecting to your deployment. -->
# OAI Reverse Proxy # OAI Reverse Proxy
This is a simple reverse proxy for the OpenAI API. To use it, refer to the `appUrls` listed in the Service Info section below and paste them into your preferred front-end. This is a simple reverse proxy for the OpenAI API. To use it, refer to the `endpoints` listed in the Service Info section below and paste them into your preferred front-end.
[https://github.com/nai-degen/oai-reverse-proxy](https://github.com/nai-degen/oai-reverse-proxy)

View File

@ -43,16 +43,10 @@ function getInfoPageHtml(host: string) {
const info = { const info = {
uptime: process.uptime(), uptime: process.uptime(),
timestamp: Date.now(), timestamp: Date.now(),
appUrls: { endpoints: {
tavern: {
kobold: host,
openai: host + "/proxy/openai/v1",
},
agnaistic: {
kobold: host, kobold: host,
openai: host + "/proxy/openai", openai: host + "/proxy/openai",
}, },
},
proompts: keys.reduce((acc, k) => acc + k.promptCount, 0), proompts: keys.reduce((acc, k) => acc + k.promptCount, 0),
...(config.modelRateLimit ? { proomptersNow: getUniqueIps() } : {}), ...(config.modelRateLimit ? { proomptersNow: getUniqueIps() } : {}),
keyInfo, keyInfo,