diff --git a/src/info-page.ts b/src/info-page.ts index 227638e..d9839a3 100644 --- a/src/info-page.ts +++ b/src/info-page.ts @@ -19,7 +19,7 @@ function getInfoPageHtml(host: string) { uptime: process.uptime(), timestamp: Date.now(), baseUrl: host, - kobold: host + "/proxy/kobold", + kobold: host, // kobold doesn't need the suffix openai: host + "/proxy/openai", proompts: keylist.reduce((acc, k) => acc + k.promptCount, 0), ...(config.modelRateLimit ? rateLimitInfo : {}), diff --git a/src/proxy/rate-limit.ts b/src/proxy/rate-limit.ts index 58899c0..fe92498 100644 --- a/src/proxy/rate-limit.ts +++ b/src/proxy/rate-limit.ts @@ -63,6 +63,14 @@ export const ipLimiter = (req: Request, res: Response, next: NextFunction) => { return; } + // Exempt Agnai.chat from rate limiting since it's shared between a lot of + // users. Dunno how to prevent this from being abused without some sort of + // identifier sent from Agnaistic to identify specific users. + if (req.ip === "157.230.249.32") { + next(); + return; + } + const { remaining, reset } = getStatus(req.ip); res.set("X-RateLimit-Limit", config.modelRateLimit.toString()); res.set("X-RateLimit-Remaining", remaining.toString());