Skip to content

Commit 75d5061

Browse files
dmitrisaberiramisbahi
authored andcommitted
Public launch
Signed-off-by: Dmitri Saberi <[email protected]>
1 parent 1dfc26f commit 75d5061

34 files changed

+5655
-6374
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25-
.env
25+
.env
26+
.vercel

CONTRIBUTING.md

-126
This file was deleted.

README.md

+62-22
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,87 @@
11
<div align="center">
2-
<h1 align="center">Flux</h1>
3-
<p align="center">
4-
Graph-based LLM power tool for exploring many completions in parallel.
5-
<br />
6-
<br />
7-
<a href="https://twitter.com/transmissions11/status/1640775967856803840">Announcement</a>
8-
·
9-
<a href="http://flux.paradigm.xyz">Try Online</a>
10-
·
11-
<a href="https://github.com/paradigmxyz/flux/issues">Report a Bug</a>
12-
</p>
2+
3+
<img src="./docs/source/_static/logo.png" alt="Branches Logo" width=200></img>
4+
5+
# Branches
6+
7+
Prototype advanced LLM algorithms for reasoning and planning.
8+
9+
[Try Online](http://code-gen-tree.vercel.app)
10+
[Report a Bug](https://github.com/normal-computing/branches/issues)
11+
[Stay tuned](#stay-tuned-for)
12+
1313
</div>
1414

15-
<br />
15+
![Branches in action: Tree-search visualization for code generation with self-correction in the HumanEval benchmark](https://storage.googleapis.com/normal-blog-artifacts/systerm2/tot_demo.gif)
1616

17-
![A screenshot of a Flux workspace.](/public/meta-full.png)
17+
***Tree-search visualization during code generation.** We visualize a reasoning algorithm which learns from feedback, automatically correcting itself by analyzing error tracebacks to refine its solutions. In this case, we benchmark Python programming problems from the HumanEval dataset.*
1818

1919
## About
2020

21-
Flux is a power tool for interacting with large language models (LLMs) that **generates multiple completions per prompt in a tree structure and lets you explore the best ones in parallel.**
21+
Branches is an AI tool for graph-based prototyping of advanced algorithms for LLM reasoning and planning -- like Tree of Thoughts and Reflexion. Branches is adapted from [Flux](https://github.com/paradigmxyz/flux).
2222

23-
Flux's tree structure allows you to:
23+
Designed for researchers and developers, it allows users to directly interact with AI reasoning processes, streamlining the exploration of complex coding challenges and strategic problem-solving.
2424

25-
- Get a wider variety of creative responses
25+
### Code Generation (HumanEval)
2626

27-
- Test out different prompts with the same shared context
27+
Branches automatically expands decision trees to solve programming problems from the [HumanEval dataset](https://huggingface.co/datasets/openai_humaneval), visualizing reasoning chains and facilitating self-correction through error tracebacks. This is found on the `main` branch and is currently hosted.
2828

29-
- Use inconsistencies to identify where the model is uncertain
29+
### Game of 24
30+
Branches includes a specialized evaluation mechanism for the [Game of 24 puzzle](https://en.wikipedia.org/wiki/24_(puzzle)), leveraging a scoring system to enhance breadth-first search (BFS) by prioritizing promising paths. This is found on the `game-of-24` branch.
3031

31-
It also provides a robust set of keyboard shortcuts, allows setting the system message and editing GPT messages, autosaves to local storage, uses the OpenAI API directly, and is 100% open source and MIT licensed.
32+
## Features
33+
34+
- [x] 🌳 **Automated Tree Expansion**: Leveraging Tree of Thoughts for dynamic expansion in problem-solving.
35+
- [x] 🧠 **Pre-loaded Prompts**: Curated for search-based reasoning to solve specific problems.
36+
- [x] 💻 **Code Interpretation**: Instant execution and error analysis for self-correcting AI-generated code.
37+
- [x] 🔍 **Scoring Mechanism**: Advanced BFS for the Game of 24 with node evaluation for search optimization.
38+
- [x] 📊 **Interactive Visualization**: Graphical representation of tree searches for easy analysis and education. Largely adapted from [Flux](https://github.com/paradigmxyz/flux).
3239

3340
## Usage
3441

35-
Visit [flux.paradigm.xyz](https://flux.paradigm.xyz) to try Flux online or follow the instructions below to run it locally.
42+
To get started with Branches, you can either visit [code-gen-tree.vercel.app](https://code-gen-tree.vercel.app) for the hosted version or run it locally by following the instructions below.
43+
44+
## Deploy to Vercel
45+
```sh
46+
npm i -g vercel
47+
vercel
48+
```
3649

3750
## Running Locally
51+
For local development, checkout the `local-dev` branch. This is slightly modified to use Flask to serve the code interpreter API.
52+
53+
Setup repo
54+
```sh
55+
git clone https://github.com/normal-computing/branches.git
56+
git checkout local-dev
57+
```
3858

59+
**Frontend (User Interface):**
3960
```sh
40-
git clone https://github.com/paradigmxyz/flux.git
4161
npm install
4262
npm run dev
4363
```
4464

65+
**Backend (Code Interpreter):**
66+
```
67+
pip install -r backend/requirements.txt
68+
python backend/interpreter.py
69+
```
70+
71+
## Stay Tuned For
72+
73+
Our commitment to enhancing Branches continues, with exciting new developments on the way:
74+
75+
- More reasoning and planning algorithms beyond the defaults ([#10](https://github.com/normal-computing/branches/issues/10))
76+
- Node Value Editing and Regenerate Subtree Functionality ([#5](https://github.com/normal-computing/branches/issues/5))
77+
- UI Color Fixes and Customization Features ([#6](https://github.com/normal-computing/branches/issues/6))
78+
- Address Model/UI Timeout Issues ([#7](https://github.com/normal-computing/branches/issues/7))
79+
- Enhance Game of 24 Logic, Model Cost Tracking, and Prompt Engineering ([#8](https://github.com/normal-computing/branches/issues/8))
80+
4581
## Contributing
4682

47-
See the [open issues](https://github.com/paradigmxyz/flux/issues) for a list of proposed features (and known issues).
83+
Your contributions make Branches better. Whether it’s bug reports, new features, or feedback, we welcome it all! Report bugs or request features by creating an issue [here](https://github.com/normal-computing/Branches/issues).
84+
85+
## License
86+
87+
Branches is open-source and continues to uphold the [MIT license](LICENSE).

api/execute.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from http import HTTPStatus
2+
import json
3+
from concurrent.futures import ThreadPoolExecutor
4+
from human_eval.execution import check_correctness
5+
from flask import Flask, request, jsonify
6+
7+
8+
app = Flask(__name__)
9+
10+
executor = ThreadPoolExecutor(max_workers=5)
11+
12+
13+
@app.route("/execute", methods=["POST"])
14+
def execute():
15+
data = request.json
16+
17+
problem = data.get("problem", "")
18+
completion = data.get("completion", "")
19+
timeout = data.get("timeout", 5.0)
20+
args = (problem, completion, timeout)
21+
22+
if not completion:
23+
response = jsonify({"error": "No completion provided"})
24+
response.status_code = HTTPStatus.BAD_REQUEST
25+
return response
26+
27+
try:
28+
future = executor.submit(check_correctness, problem, completion, timeout)
29+
result = future.result()
30+
return jsonify({"result": result})
31+
except Exception as e:
32+
response = jsonify({"error": str(e)})
33+
response.status_code = HTTPStatus.INTERNAL_SERVER_ERROR
34+
return response
35+
36+
37+
# check if a 500 error code is thrown
38+
@app.errorhandler(500)
39+
def internal_error(error):
40+
return "500 error: {}".format(str(error)), 500

api/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
openai
2+
git+https://github.com/arunpatro/human-eval.git@pipgit
3+
Flask

docs/source/_static/logo.png

302 KB
Loading

index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
5+
<link rel="icon" type="image/png" href="./docs/source/_static/logo.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77

8-
<title>Flux</title>
8+
<title>Branches</title>
99

1010
<meta name="description" content="LLM power tool." />
1111

12-
<meta property="og:title" content="Flux" />
13-
<meta property="og:url" content="https://flux.paradigm.xyz" />
12+
<meta property="og:title" content="Branches" />
13+
<meta property="og:url" content="https://code-gen-tree.vercel.app" />
1414
<meta property="og:image" content="https://flux.paradigm.xyz/meta.jpg" />
1515
<meta property="og:description" content="LLM power tool." />
1616
<meta property="og:type" content="website" />
1717

1818
<meta name="twitter:card" content="summary_large_image" />
19-
<meta name="twitter:title" content="Flux" />
19+
<meta name="twitter:title" content="Branches" />
2020
<meta name="twitter:description" content="LLM power tool." />
2121
<meta name="twitter:image" content="https://flux.paradigm.xyz/meta.jpg" />
2222

2323
<meta name="theme-color" content="#ffffff" />
2424

25-
<meta name="apple-mobile-web-app-title" content="Flux" />
25+
<meta name="apple-mobile-web-app-title" content="Branches" />
2626
<meta name="apple-mobile-web-app-capable" content="yes" />
2727
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
2828
</head>

0 commit comments

Comments
 (0)