Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added storm wiki frontend with themes #123

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ build/
secrets.toml
*.log
*/assertion.log
*results/
*results/
*.db
2 changes: 1 addition & 1 deletion examples/run_storm_wiki_deepseek.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ def main(args):
parser.add_argument('--remove-duplicate', action='store_true',
help='If True, remove duplicate content from the article.')

main(parser.parse_args())
main(parser.parse_args())
44 changes: 44 additions & 0 deletions frontend/demo_light/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
secrets.toml

# macOS files
.DS_Store
.idea

# FastAPI files
*.db
.venv
.env
DEMO_WORKING_DIR
*.service

# Node.js files
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# TypeScript files
*.tsbuildinfo
/dist/

# Python files
__pycache__/
*.py[cod]
*.pyo
*.pyd
.Python
env/
venv/
pip-log.txt
pip-delete-this-directory.txt
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

21 changes: 15 additions & 6 deletions frontend/demo_light/.streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
[theme]
primaryColor = "#bd93f9"
backgroundColor = "#282a36"
secondaryBackgroundColor = "#44475a"
textColor = "#f8f8f2"
font = "sans serif"

[server]
enableStaticServing = true

[client]
showErrorDetails = false
toolbarMode = "minimal"

[theme]
primaryColor = "#F63366"
backgroundColor = "#FFFFFF"
secondaryBackgroundColor = "#F0F2F6"
textColor = "#262730"
font = "sans serif"
[browser]
gatherUsageStats = false

[global]
developmentMode = false
92 changes: 62 additions & 30 deletions frontend/demo_light/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,66 @@
# STORM Minimal User Interface

This is a minimal user interface for `STORMWikiRunner` which includes the following features:
1. Allowing user to create a new article through the "Create New Article" page.
2. Showing the intermediate steps of STORMWikiRunner in real-time when creating an article.
3. Displaying the written article and references side by side.
4. Allowing user to view previously created articles through the "My Articles" page.

<p align="center">
<img src="assets/create_article.jpg" style="width: 70%; height: auto;">
</p>

<p align="center">
<img src="assets/article_display.jpg" style="width: 70%; height: auto;">
</p>

## Setup
1. Make sure you have installed `knowledge-storm` or set up the source code correctly.
2. Install additional packages required by the user interface:
```bash
pip install -r requirements.txt
```
2. Make sure you set up the API keys following the instructions in the main README file. Create a copy of `secrets.toml` and place it under `.streamlit/`.
3. Run the following command to start the user interface:
```bash
streamlit run storm.py
```
The user interface will create a `DEMO_WORKING_DIR` directory in the current directory to store the outputs.

# STORM wiki

[STORM](https://github.com/stanford-oval/storm) frontend modified.

## Features & Changes


- themes: dracula soft dark color and other light and dark themes
- engines: duckduckgo, searxng and arxiv
- llm: ollama, anthropic
- users can change search engine before triggering search
- users can save primary and fallback llm in settings
- save result files as '*.md'
- add date to to top of the result file
- added arize-phoenix to trace.
- added github ci file to test fallback options for search and llm
- change number of display columns
- pagination in sidebar

## Prerequisites

- Python 3.8+
- `knowledge-storm` package or source code
- Required API keys (see main STORM repository)

## Installation

1. Clone the repository:
```sh
git clone https://github.com/yourusername/storm-minimal-ui.git
cd storm-minimal-ui
```

2. Install dependencies:
```sh
pip install -r requirements.txt
cp .env.example .env
cp secrets.toml.example ./.streamlit/secrets.toml
```

edit .env file
```
STREAMLIT_OUTPUT_DIR=DEMO_WORKING_DIR
OPENAI_API_KEY=YOUR_OPENAI_KEY
STORM_TIMEZONE="America/Los_Angeles"
```

also update serecets.toml

3. Set up API keys:
- Copy `secrets.toml.example` to `.streamlit/secrets.toml`
- Add your API keys to `.streamlit/secrets.toml`

## Usage

Run the Streamlit app:
```sh
streamlit run storm.py --server.port 8501 --server.address 0.0.0.0

```

## Customization

You can customize the `STORMWikiRunner` powering the user interface according to [the guidelines](https://github.com/stanford-oval/storm?tab=readme-ov-file#customize-storm) in the main README file.
Modify `set_storm_runner()` in `demo_util.py` to customize STORMWikiRunner settings. Refer to the [main STORM repository](https://github.com/stanford-oval/storm) for detailed customization options.

The `STORMWikiRunner` is initialized in `set_storm_runner()` in [demo_util.py](demo_util.py). You can change `STORMWikiRunnerArguments`, `STORMWikiLMConfigs`, or use a different retrieval model according to your need.
Binary file removed frontend/demo_light/assets/article_display.jpg
Binary file not shown.
Binary file removed frontend/demo_light/assets/create_article.jpg
Binary file not shown.
Loading