-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
LitGPT Python API draft #1459
LitGPT Python API draft #1459
Conversation
Thanks @rasbt. this is really clean!! |
This looks great @rasbt One question related to conversations and statefulness: right now the API will take a prompt and generate a formatted prompt from it internally, and then come back with the output. However you may also come in with a multi-turn conversation, and you’ll have to format it properly. So we either add support for a conversation (i.e. type of input is If we allow the input to be a dict of turns, we’ll also need to expand the prompt formatting accordingly (which we know we need to do anyway). |
Fair point. I guess we can handle it 2 ways: Option 1
Option 2We reserve
What do you think @aniketmaurya @lantiga @awaelchli ? |
I think the input of multiturn should always be a dict with all turns. We shouldn’t make the api stateful (ie assuming kvcache is there) or we won’t be able to orchestrate multiple conversations in the future. |
Wow, that's actually happening. Thanks Sebastian 👍 @lantiga I don't understand what is an orchestration of multiple conversations. |
Co-authored-by: awaelchli <aedu.waelchli@gmail.com>
I think this means if you have multiple conversations going. For example thing of an example where you are hosting the model via LitServe, and then you have multiple people interacting with it (similar to how multiple people use ChatGPT). The interaction of one user shouldn't influence the interaction by another user. |
Thanks for the explanation. |
Merging this documentation it here so that we don't have too many open PRs sitting for a long time. This will then be implemented in 2 steps. V1 for the version @aniketmaurya needs asap, and then adding the training functionality. |
This is a first draft for the Python API.
In LitServe, the usage could then look like as follows:
LitServe example
CC @lantiga @aniketmaurya