29 Commits

Author SHA1 Message Date
ianarawjo
2c7447d5f7
Saved flows sidebar and save button when running locally (#332)
* Add save to local disk/cache button

* Autosave to local filesystem but hide it

* Use imported filename when saving to local disk after import. Ensure no name clashes.

* Remove unneeded dependencies in pip and update package version

* Hide sidebar button and sidebar when hosted on web
2025-03-02 17:13:40 -05:00
ianarawjo
1206d62b7b
Add Deepseek API (#322)
* Add DeepSeek Model API and settings

* Update Together model list
2025-01-27 22:48:37 -05:00
ianarawjo
f6e1bfa38a
Add Together.ai and update Bedrock (#283)
* feat(bedrock_llama3): added support for Llama3 (#270)

- added also Claude 3 Opus to the list of models
- replaced hardcoded model Id strings with refs to NativeLLM enum

* chore: bump @mirai73/bedrock-fm library (#277)

- the new version adds source code to facilitate debugging

Co-authored-by: ianarawjo <fatso784@gmail.com>

* Adding together.ai support (#280)


---------

Co-authored-by: ianarawjo <fatso784@gmail.com>

* Add Together.ai and update Bedrock models

---------

Co-authored-by: Massimiliano Angelino <angmas@amazon.com>
Co-authored-by: Can Bal <canbal@users.noreply.github.com>
2024-05-17 20:17:18 -10:00
Ian Arawjo
af7f53f76e Fix bug loading OPENAI_BASE_URL from environ var 2024-04-28 14:29:58 -04:00
ianarawjo
583ea6506f
Convert entire front-end to TypeScript. Add image model support. (And more!) (#252)
* Refactor: modularize response boxes into a separate component

* Type store.js. Change info to vars. NOTE: This may break backwards compat.

* Refactor addNodes in App.tsx to be simpler.

* Turn AlertModal into a Provider with useContext

* Remove fetch_from_backend.

* Add build/ to gitignore

* Add support for image models and add Dall-E models.

* Better rate limiting with Bottleneck

* Fix new Chrome bug with file import readers not appearing as arrays; and fix bug with exportCache

* Add ability to add custom right-click context menu items per node

* Convert to/from TF and Items nodes

* Add lazyloader for images

* Add compression to images by default before storing in cache

* Add image compression toggle in Global Settings

* Move Alert Provider to top level of index.js
2024-03-30 22:43:40 -04:00
ianarawjo
eb51d1cee9
Add Amazon Bedrock models to main (#251)
* Adding support for Amazon Bedrock models (#247)

* Create global setting for GenAI features provider, to support Bedrock (Anthropic) models as an alternative

* Reformats dropdown in PromptNode to use Mantine ContextMenu with a nested menu, to save space. 

* Remove build folder from git

* Fix context menu to close on click-off. Refactor context menu array code.

* Ensure context menu is positioned below the Add+ button, like a proper dropdown. 

* Toggle context menu off when clicking btn again.

---------

Co-authored-by: Massimiliano Angelino <angmas@amazon.com>
2024-03-30 17:59:17 -04:00
ianarawjo
0f4275bc75
Add Claude 3 and Pyodide sandboxing (#237)
Adds pyodide WebWorker to run Python scripts, thanks to idea by Shreya.

* Add sandbox option to Python eval nodes.

* Add new Anthropic models

* Disable guards for Python evals on server

* Fix bug with detecting async func in runOverResponses

---------

Co-authored-by: Shreya Shankar <ss.shankar505@gmail.com>
2024-03-05 23:15:35 -05:00
Ian Arawjo
965b96e451 Fix bug when creating dirs for custom providers 2024-01-02 10:36:43 -05:00
ianarawjo
7223735b7f
Add Code Processor nodes (#180)
* Add Code Processor nodes.

* Renamed EvaluatorNode to CodeEvaluatorNode.

* Changed the way evaluator nodes pull responses (from grabResponses to pullInputData).

* Fix SimpleEvalNode to be consistent with CodeEvaluatorNode

* Fix Vis Node where no eval resps are connected, but resps are connected.

* Rebuilt react and update package version
2023-11-27 13:57:27 -05:00
ianarawjo
beeffd0ebb
Better edges, ReactFlow v11, AlephAlpha integration, better .gitignores (#139)
* add aleph alpha to installg guide description

* add aleph alpha to settings to add key

* add settings for alephalpha

* add aleph alpha to models

* add aleph alpha api key to keymap

* no visible changes, removed console.log

* current working copy

* added settings for aleph alpha, added test, working api request

* removed console log

* added static build with Aleph Alpha integration

* added static build with Aleph Alpha integration

* Corrected from ALEPH_ALPHA_KEY to ALEPH_ALPHA_API_KEY

* add additional settings requested

* merge conflicts

* add build to gitignore, best practice, reduces conflicts

* remove empty lines

* Delete chainforge/react-server/build directory

build directory should not be in remote

* remove unnecessary changes

* Update backend.ts

* ...

* fixed import

* add aleph alpha to store, remove available llms from modelsettings, remove double palm key input from globalsettings

* Update to ReactFlow v11

* Add remove button to edge on hover

* Quality of life improvements (#133)

* Quality of life improvements for node and python

* Pinned minor version for mantine modules

* Updated package-lock.json

* Added .gitignore to react-server

* Updated .gitignore to python module

---------

Co-authored-by: ianarawjo <fatso784@gmail.com>

* update gitignore

* Minor fixes to AlephAlpha integration code

* Tested npm i and rebuilt react

* Force commit the react build

* Update package version

---------

Co-authored-by: Denise Wagenführ <denise.wagenfuehr@capgemini.com>
Co-authored-by: fguderia <falko.guderian@capgemini.com>
Co-authored-by: denise710 <53524926+denise710@users.noreply.github.com>
Co-authored-by: wday-cs <119377799+wday-cs@users.noreply.github.com>
2023-09-25 09:44:18 -04:00
Ian Arawjo
ab75768587 Bug fix on Py execution 2023-09-03 12:43:14 -04:00
ianarawjo
0134dbf59b
Custom providers (#122)
* Removed Python backend files that are no longer used (everything in `promptengine`)

* Added `providers` subdomain, with `CustomProviderProtocol`, `provider` decorator, and global singleton `ProviderRegistry`

* Added a tab for custom providers, and a dropzone, in ChainForge global settings UI

* List custom providers in the Global Settings screen once added. 

* Added ability to remove custom providers by clicking X. 

* Make custom funcs sync but call them async'ly.

* Add Cohere custom provider example in examples/

*Cache the custom provider scripts and load them upon page load

* Rebuild react and update package version

* Bug fix when custom provider is deleted and settings screen is opened on the deleted custom provider
2023-08-27 15:11:42 -04:00
Ian Arawjo
07150fc6ae Let users choose hostname and port 2023-07-20 11:17:58 -04:00
Ian Arawjo
0c3ea969dc Added HuggingFace key to load from env variable 2023-07-07 11:12:47 -04:00
ianarawjo
b33397930b
TypeScript backend, HuggingFace models, JavaScript evaluators, Comment Nodes, and more (#81)
* Beginning to convert Python backend to Typescript

* Change all fetch() calls to fetch_from_backend switcher

* wip converting query.py to query.ts

* wip started utils.js conversion. Tested that OpenAI API call works

* more progress on converting utils.py to Typescript

* jest tests for query, utils, template.ts. Confirmed PromptPipeline works.

* wip converting queryLLM in flask_app to TS

* Tested queryLLM and StorageCache compressed saving/loading

* wip execute() in backend.ts

* Added execute() and tested w concrete func. Need to test eval()

* Added craco for optional webpack config. Config'd for TypeScript with Node.js packages browserify'd

* Execute JS code on iframe sandbox

* Tested and working JS Evaluator execution.

* wip swapping backends

* Tested TypeScript backendgit status! :) woot

* Added fetchEnvironAPIKeys to Flask server to fetch os.environ keys when running locally

* Route Anthropic calls through Flask when running locally

* Added info button to Eval nodes. Rebuilt react

* Edits to info modal on Eval node

* Remove/error out on Python eval nodes when not running locally.

* Check browser compat and display error if not supported

* Changed all example flows to use JS. Bug fix in query.ts

* Refactored to LLMProvider to streamline model additions

* Added HuggingFace models API

* Added back Dalai call support, routing through Flask

* Remove flask app calls and socketio server that are no longer used

* Added Comment Nodes. Rebuilt react.

* Fix PaLM temp=0 build, update package vers and rebuild react
2023-06-30 15:11:20 -04:00
ianarawjo
ea3d730bba
Merge 0.1.7 (#76)
* Added asMarkdownAST to ResponseInfo

* Increased margin between LLM responses in response inspector

* Added Inspect Results footer to eval node after run

* Fixed bug when cacheing responses after deleting a model and adding a new one

* Fixed bug in catching error in PromptTemplate's `is_concrete()` method

* Improvements to response inspector UI

* Ensured eval results (scores) are sorted alongside their responses the response inspector UI

* Removed response previews footer, replaced with Inspect responses button

* Prompt and eval nodes now load cached responses upon initialization

* Rebuilt React and raised package version
2023-06-21 10:05:46 -04:00
Ian Arawjo
d283cfdaf6 Bug fixes to queryLLM and merge responses 2023-06-17 09:34:23 -04:00
ianarawjo
1d08507c93
Load OpenAI evals as example flows (#74)
* Add OpenAI Evals tab to Example Flows pane.

* Add OpenAI evals examples (preconverted).

* Set unique IDs for each oaievals cforge file

* Use contenteditable divs in tables to improve performance.

* Update eval code to use json.loads instead of eval()

* Fix bug with $s in templates

* Update package info and point oaievals to main branch

* Made column headers use contenteditable p tags

* Add requests to dependency list

* Rebuilt react and updated package version
2023-06-15 15:41:58 -04:00
ianarawjo
915f30988d
v0.1.5: Tabular Data Node, Evaluator Print Output (#66)
* Use Mantine Textarea controlled for Textfields node, instead of textarea

* Added Tabular data node

* TabularData context menus

* Make TabularData template hooks responsive to column name changes.

* Reduced spacing between template hooks

* Better table styling and rename column popup

* Add 'carry with' feature to Prompt Permutation recursive generation using `associate_id`

* Much nicer var tags on inspect window

* Nicer styling for LLM group headers in inspect screen

* Pass metavars around in the backend to surface them to front-end

* Set min-height on inspect node to be larger

* Added in-line print in Eval nodes

* Append error message to print output

* Minor inspect node CSS tweaks and fixes

* Removed mix-blend-mode due to performance issues scrolling large text

* Added ground truth eval example for math problems

* Updated React build and version number
2023-06-11 11:48:27 -04:00
ianarawjo
000b61200c
0.1.4: Failure Progress on Prompt Nodes, and others (#62)
* Lint Python code with ruff (#60)

* Failure progress on Prompt Nodes

* Change PromptNode preview container color

* Ensure LLM colors are unique and the same across nodes

* Reset LLM colors upon flow load

* Add LLM colors to 3D scatterplot

* Extract inspector internals into separate component. 

* Added inspect modal.

* Lower rate of failure for dummy LLM responses

* Fix useEffect bug in LLMResponseInspector

* Fix export to excel bug

* Remove dependence on browser support for regex negative lookbehind

* Use monospace font in textareas in Safari

* Fix settings modal bug in FireFox

* Change version

* Update README.md
2023-06-07 20:36:55 -04:00
ianarawjo
c6da2314e7
Add Example flows pane and other minor improvements (#59)
* Example flows pane.

* Better Add+ Node UI.

* Added system message comparison example (see .

* Let user switch to gpt4 if initial model is gpt3.5
2023-06-03 14:32:37 -04:00
ianarawjo
7eb5aaa26d
Model settings, more models, and visible temperature (#57)
* Model settings forms

* Editable nicknames and emojis

* Saving and loading model settings

* Temperature indicator on LLM items in PromptNodes

* Ensure LLM nicknames are unique

* Detect when PaLM blocks responses and output standard error msg in response instead

* Fix examples/ to use new cache format

* Add helpful 'could not reach server' text on countQueries fail

* Add Dalai model settings

* Rebuild react and update package version
2023-06-01 15:08:17 -04:00
ianarawjo
737a4d77fe
Add utf8 encoding to all file opens for Windows compat (#52) 2023-05-23 22:35:39 -04:00
Ian Arawjo
51bb8dbd3a Create cache dir upon importCache 2023-05-23 14:52:52 -04:00
Ian Arawjo
b0068985b7 Require flask 2.2.3 or above 2023-05-23 14:29:44 -04:00
Ian Arawjo
0f6176c37d Minor fix boolean histogram vis 2023-05-22 13:16:27 -04:00
Ian Arawjo
ca31d28eb1 Export and import cache data 2023-05-21 23:14:10 -04:00
Ian Arawjo
47b91e9c32 Set API keys in the front-end 2023-05-19 19:40:05 -04:00
ianarawjo
0093fdf0be
Reorganize and package chainforge for pip installation (#50)
* Rename main folders

* Preparing for package deployment

* Use absolute paths and imports

* Move react-server into chainforge dir

* Add MANIFEST.in to copy react-server build over to package

* Add include_package_data

* Add manifest.json and icons to /static.

* Update README.md

* Update GUIDE.md
2023-05-18 00:17:35 -04:00