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 openai streaming #101

Merged
merged 41 commits into from
May 23, 2024
Merged

add openai streaming #101

merged 41 commits into from
May 23, 2024

Conversation

aniketmaurya
Copy link
Collaborator

this PR converts the existing OpenAI Spec to return streaming response

@aniketmaurya aniketmaurya changed the title add openai streaming [WIP] add openai streaming May 21, 2024
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 68.37607% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 79%. Comparing base (41a256d) to head (fc1d5f0).

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #101   +/-   ##
===================================
- Coverage    81%    79%   -2%     
===================================
  Files        13     13           
  Lines       743    806   +63     
===================================
+ Hits        599    633   +34     
- Misses      144    173   +29     

@aniketmaurya aniketmaurya added the enhancement New feature or request label May 21, 2024
@aniketmaurya aniketmaurya self-assigned this May 21, 2024
@aniketmaurya aniketmaurya changed the title [WIP] add openai streaming add openai streaming May 21, 2024
Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

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

Looks good, a few comments before we merge

src/litserve/specs/openai.py Show resolved Hide resolved
src/litserve/specs/openai.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

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

Looks good, one comment, and it's missing changes to the README.md (which is now incompatible with what is in here).
Also we need to produce a good error message for when the user returns from predict instead of yielding ("OpenAISpec requires predict to be streaming... etc")

src/litserve/specs/openai.py Outdated Show resolved Hide resolved
@aniketmaurya
Copy link
Collaborator Author

aniketmaurya commented May 22, 2024

@lantiga added validation to ensure that predict and encode_response are generator along with a guide for users. Please let me know if I missed anything else.

@lantiga
Copy link
Collaborator

lantiga commented May 23, 2024

Looks good, let's see if tests pass and we merge

@lantiga lantiga merged commit 937ac9c into main May 23, 2024
19 checks passed
@lantiga lantiga deleted the aniket/openai-streaming branch May 23, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci / tests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants