Skip to content

Return 500 when chain is not ready? #343

Answered by eyurtsev
tigerinus asked this question in Q&A
Discussion options

You must be logged in to vote

@LinkLeong dynamic switching between chains and parameters can be done using configurable runnables.

Configurable runnables allow configuring both parameters on any given chain as well as selecting from alternative chains to run. Please see: https://python.langchain.com/docs/expression_language/how_to/configure

@tigerinus The newest release exposes the underlying APIHandler:

https://github.com/langchain-ai/langserve/blob/main/examples/api_handler_examples/server.py

If the call to load the model is blocking, you may be able to load it on a thread so that it loads in the background.

I suspect you can achieve something similar, by loading the model into a global variable from a thread and im…

Replies: 7 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@tigerinus
Comment options

@eyurtsev
Comment options

Answer selected by eyurtsev
Comment options

You must be logged in to vote
2 replies
@eyurtsev
Comment options

@JavierCCC
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #324 on December 21, 2023 14:58.