Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is the client threadsafe? #1901

Unanswered
Sconvai asked this question in Q&A
Discussion options

Hello,

I have recently captured a profile for my service and I see that instantiating Openai client consumes are around 16% of CPU. In order to reduce this overhead I am hoping if I can instantiate the client once at the module level and reuse it across all requests. Is this possible. If yes, are there any cons of doing so?

image
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /