Simplifying Hugging Face Spaces API calls in Flutter using hugging_face_chat_gradio package

When I first started using the Hugging Face Spaces API in Flutter, I thought it would be a simple POST → GET workflow.

But turns out, the GET request is actually a stream, which means you have to:

Continuously listen to the data

Check if the full response has been received

Accumulate all chunks

Parse the final JSON

That’s a lot of moving parts—especially in Dart where this pattern isn’t as straightforward as in Python or JavaScript.

So, I built hugging_face_chat_gradio :package:

A package that handles all of this for you:

:white_check_mark: Just send a message, get a response

:white_check_mark: No need to worry about streaming, parsing, or JSON handling

:white_check_mark: Fully documented for easy use

If you’re working with Hugging Face Spaces in Flutter, check it out!

2 Likes

Great contribution to the community, Flutter is a framework with a lot of potential, thank you!

Best regards,
Adrian Araya, RidgeRun.ai

2 Likes

I would love to use it. But I cant find hugging_face_chat_gradio. Can you explain where to find it?

2 Likes

Thank you so much, Adrian! :folded_hands:
Really appreciate your kind words. Flutter does have amazing potential, and I’m glad to contribute something that hopefully makes life a bit easier for others working with Hugging Face APIs.

If you ever give the package a try, I’d love to hear your feedback!

1 Like

Thanks for your interest! :raising_hands:
You can find the package here: hugging_face_chat_gradio

Let me know if you run into any issues or have questions—happy to help!

2 Likes