Skip to content

Commit 226b827

Browse files
committed
Public launch
Signed-off-by: Dmitri Saberi <[email protected]>
1 parent 1dfc26f commit 226b827

34 files changed

+5663
-6256
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

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Contributing to Flux
1+
## Contributing to Branches
22

3-
Thanks for your interest in improving Flux!
3+
Thanks for your interest in improving Branches!
44

55
There are multiple opportunities to contribute at any level. It doesn't matter if you are just getting started with Rust or are the most weathered expert, we can use your help.
66

@@ -11,7 +11,7 @@ It should be considered as a guide to help you navigate the process.
1111

1212
### Code of Conduct
1313

14-
Flux adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) (even though it's not a Rust project). This code of conduct describes the _minimum_ behavior expected from all contributors.
14+
Branches adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) (even though it's not a Rust project). This code of conduct describes the _minimum_ behavior expected from all contributors.
1515

1616
Instances of violations of the Code of Conduct can be reported by contacting the team at [[email protected]](mailto:[email protected]).
1717

@@ -20,7 +20,7 @@ Instances of violations of the Code of Conduct can be reported by contacting the
2020
There are fundamentally four ways an individual can contribute:
2121

2222
1. **By opening an issue:** For example, if you believe that you have uncovered a bug
23-
in Flux, creating a new issue in the issue tracker is the way to report it.
23+
in Branches, creating a new issue in the issue tracker is the way to report it.
2424
2. **By adding context:** Providing additional context to existing issues,
2525
such as screenshots, code snippets and helps resolve issues.
2626
3. **By resolving issues:** Typically this is done in the form of either
@@ -55,7 +55,7 @@ If you have examples of other tools that have the feature you are requesting, pl
5555

5656
### Resolving an issue
5757

58-
Pull requests are the way concrete changes are made to the code and dependencies of Flux.
58+
Pull requests are the way concrete changes are made to the code and dependencies of Branches.
5959

6060
Even tiny pull requests, like fixing wording, are greatly appreciated. Before making a large change, it is usually
6161
a good idea to first open an issue describing the change to solicit feedback and guidance. This will increase
@@ -82,7 +82,7 @@ Keep an eye out for comments from code owners to provide guidance on conflicting
8282

8383
#### Reviewing pull requests
8484

85-
**Any Flux community member is welcome to review any pull request**.
85+
**Any Branches community member is welcome to review any pull request**.
8686

8787
All contributors who choose to review and provide feedback on pull requests have a responsibility to both the project and individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it. If there are reasons why you feel the PR should not be merged, explain what those are. Do not expect to be able to block a PR from advancing simply because you say "no" without giving an explanation. Be open to having your mind changed. Be open to working _with_ the contributor to make the pull request better.
8888

@@ -98,8 +98,8 @@ It is tempting to micro-optimize and make everything about relative performance,
9898

9999
Focus first on the most significant aspects of the change:
100100

101-
1. Does this change make sense for Flux?
102-
2. Does this change make Flux better, even if only incrementally?
101+
1. Does this change make sense for Branches?
102+
2. Does this change make Branches better, even if only incrementally?
103103
3. Are there clear bugs or larger scale issues that need attending?
104104
4. Are the commit messages readable and correct? If it contains a breaking change, is it clear enough?
105105

@@ -109,15 +109,15 @@ When changes are necessary, _request_ them, do not _demand_ them, and **do not a
109109

110110
Specific performance optimization techniques, coding styles and conventions change over time. The first impression you give to a new contributor never does.
111111

112-
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Flux maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
112+
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Branches maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
113113

114114
It is always good to clearly indicate nits when you comment, e.g.: `nit: change foo() to bar(). But this is not blocking`.
115115

116116
If your comments were addressed but were not folded after new commits, or if they proved to be mistaken, please, hide them with the appropriate reason to keep the conversation flow concise and relevant.
117117

118118
##### Be aware of the person behind the code
119119

120-
Be aware that _how_ you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Flux better, but the individual might just not want to have anything to do with Flux ever again. The goal is not just having good code.
120+
Be aware that _how_ you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Branches better, but the individual might just not want to have anything to do with Branches ever again. The goal is not just having good code.
121121

122122
##### Abandoned or stale pull requests
123123

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+
async 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

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
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" />
12+
<meta property="og:title" content="Branches" />
1313
<meta property="og:url" content="https://flux.paradigm.xyz" />
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)