Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limits on API endpoints #886

Merged
merged 14 commits into from Mar 6, 2024
Merged

Add limits on API endpoints #886

merged 14 commits into from Mar 6, 2024

Conversation

nsarrazin
Copy link
Collaborator

@nsarrazin nsarrazin commented Feb 29, 2024

This PR adds a new env var RATE_LIMITS which can contain limits for conversations, number of messages in a conversation, max length of a message, number of created assistants and messages per minute.

@nsarrazin
Copy link
Collaborator Author

cc @gary149 @julien-c what do we think of these default settings ?

@nsarrazin nsarrazin added enhancement New feature or request back This issue is related to the Svelte backend or the DB huggingchat For issues related to HuggingChat specifically labels Feb 29, 2024
@julien-c
Copy link
Member

(in theory the numbers we use shouldn't be published, imo)

@nsarrazin
Copy link
Collaborator Author

@julien-c @gary149 moved the RATE_LIMITS var to our secrets, see here

@gary149 gary149 requested a review from coyotte508 March 4, 2024 13:31
Copy link
Member

@coyotte508 coyotte508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly style comments, code ok otherwise

src/lib/server/rateLimits.ts Outdated Show resolved Hide resolved
src/lib/server/rateLimits.ts Outdated Show resolved Hide resolved
src/routes/conversation/[id]/+server.ts Outdated Show resolved Hide resolved
src/lib/server/rateLimits.ts Outdated Show resolved Hide resolved
@nsarrazin nsarrazin merged commit 537b6f5 into main Mar 6, 2024
3 checks passed
@nsarrazin nsarrazin deleted the feat/rate_limits branch March 6, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back This issue is related to the Svelte backend or the DB enhancement New feature or request huggingchat For issues related to HuggingChat specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants