ianarawjo / ChainForge

An open-source visual programming environment for battle-testing prompts to LLMs.
https://chainforge.ai/docs
MIT License
2.21k stars 170 forks source link

🌎 Create client-side version and host on `chainforge.ai` #80

Closed ianarawjo closed 1 year ago

ianarawjo commented 1 year ago

NOTE: We are currently working on this major change in the branch js-backend.

Many users have requested being able to use ChainForge directly from the browser, without pip install. To host ChainForge, however, requires significant changes.

The cleanest, least-security-risk way to host ChainForge is to convert the entire Python backend into client-side Javascript (flask_app.py, query.py, etc). This requires the following functional differences, among many other changes:

The client-side version has a few drawbacks as a consequence:

Thus, the current goal is to retain the Python Flask backend when users are running ChainForge locally. When users are running from Flask (locally), they will be able to still:

all while most of the logic and API calls to model providers (e.g., generating prompt permutations from templates, calling OpenAI) is moved to the front-end.

ianarawjo commented 1 year ago

Part of the reason we want to do this is to add a 'share' button as well, so that, ideally, users on chainforge.ai can click a Share button which creates a unique link to their flow (at first, due to data limitations and concerns, likely without the cache of LLM responses). That would require an additional issue:

ianarawjo commented 1 year ago

This change has largely been performed, and is currently undergoing testing. Note that:

is no longer a goal --the cache folder will no longer be used. Instead, all results will stay local to a given flow. If user wish to 'save/load' a flow, users will need to click export/import buttons, and the cforge file will contain the relevant cache info.

ianarawjo commented 1 year ago

The browser based version of ChainForge has been pushed to main and PyPI. A version will be hosted on chainforge.ai on Wednesday July 5th.

ianarawjo commented 1 year ago

This issue is currently resolved. See the website for details.