# Text generation. Stream output

**URL:** <https://discuss.huggingface.co/t/text-generation-stream-output/29012>\
**Category:** 🤗Transformers\
**Created:** [January 5, 2023, 7:19pm UTC](https://discuss.huggingface.co/t/text-generation-stream-output/29012 "2023-01-05T19:19:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justlearn](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/justlearn/32/13373_2.png) [@Justlearn](https://discuss.huggingface.co/u/Justlearn)\
**Post date:** [January 5, 2023, 7:19pm UTC](https://discuss.huggingface.co/t/text-generation-stream-output/29012/1 "2023-01-05T19:19:31Z")

</div>

Hi, I want to use text generation and stream the output similar to ChatGPT. How to do that?

---

<div class="post-metadata">

**Author:** ![peakji](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/peakji/32/14565_2.png) [@peakji](https://discuss.huggingface.co/u/peakji)\
**Post date:** [March 7, 2023, 2:40pm UTC](https://discuss.huggingface.co/t/text-generation-stream-output/29012/2 "2023-03-07T14:40:57Z")

</div>

I made a streaming generation service for Hugging Face [transformers](https://github.com/huggingface/transformers) that is fully compatible with the OpenAI API: [https://github.com/hyperonym/basaran](https://github.com/hyperonym/basaran)

Hope it meets your needs.

---

<div class="post-metadata">

**Author:** ![yhavinga](https://avatars.discourse-cdn.com/v4/letter/y/df788c/32.png) [@yhavinga](https://discuss.huggingface.co/u/yhavinga)\
**Post date:** [April 4, 2023, 8:05am UTC](https://discuss.huggingface.co/t/text-generation-stream-output/29012/3 "2023-04-04T08:05:10Z")

</div>

I checked out basaran lasted week and its great! Loved the fact that it worked streaming both with t5 and gpt like models! Also the playground was really nice!
