operand / agency

A fast and minimal framework for building agent-integrated systems
https://createwith.agency
MIT License
410 stars 21 forks source link

Gradio Application #82

Closed operand closed 1 year ago

operand commented 1 year ago

Summary

This issue is to track development on a new "starter" Gradio application that will replace the Flask/React WebApp class.

For now I'll break out the following tasks and use this issue to track them.

After the above tasks are done, we can begin adding multimodal features and other improvements. Those can be broken into separate issues.

[edit] I'm not sure I'm going to change the name like I originally thought. The demo just needs a new UI and is otherwise fine for now.

Notes

I'm calling it a "starter" application, because I want to reflect a slightly different role for it. The current demo was a proof of concept. It works, but it isn't great for modification or extension. Now that more features will require front end changes, a better foundation is needed.

In addition to replacing the demo, I hope to maintain the app as a foundation for building custom applications of your own. Meaning that it should be easy to copy the source and customize to your needs.


Regarding the tech stack, I have not yet decided what to use, I started the discussion here for ideas if you have any.

I can say the following to start:


I like to work fast and I don't want to shift focus from the core library for long (it needs a lot of work), but decisions like this shouldn't be rushed, so I won't likely ship any big features for the next couple weeks or so while I experiment. I'm still here for fixes or anything that comes up.

I plan to get an initial cut of a new application added as soon as possible to gather feedback. Stay tuned to this issue if you'd like to follow along. And I really appreciate any feedback you can offer.

operand commented 1 year ago

Okay here's what I'm thinking. I've decided to go with Gradio for now.

I did consider some other options. I'm new to these python data driven web frameworks. Here's a comparison table (AI created) that lists the main options I looked at:

Framework Ease of Use Customizability Community Support Popularity Best Suited For
Streamlit High Limited Large High Data dashboards, quick prototyping, data science, and machine learning apps
Gradio High Limited Growing High Machine learning model UIs, handling different data types (images, audio, video)
Panel Moderate High Growing Moderate Data visualization, works with various plotting libraries, geospatial data
Dash Low High Large High Data dashboards, analytical web applications, custom interactive data visualizations

It came down to Streamlit vs Gradio. The main reason being that they both support quick and easy prototyping.

Quick prototyping makes a lot of sense for supporting development of the library. I was hoping for the framework to be more capable of custom applications, but there needs to be a tradeoff. So customizability will have some limits but we always have options like adding new integrations or using the Flask/React app.

What tipped me from Streamlit to Gradio were mostly two things:

  1. Oobabooga TGWUI I really want to build an integration with it. I think it would be great for both projects. Users could hook it up to interface with a network of agents connected through agency using the same interface that they use for training, etc. The integration could also become a source of feedback for development of the library.

  2. Architecture concerns with Streamlit I have some reservations about the architecture of Streamlit. Gradio is more straightforward in that it uses regular http requests with callback functions. I'm assuming it will be easier to reason about if I need to debug something.

One area that I felt Streamlit wins is in hosting options but it's not enough to change my mind. It's easy enough to host a Gradio app if necessary.

Given that I'm settled on Gradio, I'll be jumping into coding. An initial version may not take long but bear with me.

Please let me know if there are any thoughts or concerns about this choice.

operand commented 1 year ago

Alright I just merged the Gradio app! Let me know if you find anything wrong!

https://github.com/operand/agency/pull/90