Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.81 KB

README.md

File metadata and controls

68 lines (44 loc) · 1.81 KB

OpenUI

PyPI Changelog License

A backend service for generating HTML components with AI

Installation

Clone this repo, then install using pip. You'll probably want to create a virtual env.

git clone https://github.com/wandb/openui
cd openui/backend
pip install .

Usage

You must set the OPENAI_API_KEY even if you just want to try Ollama models. Just set it to xxx in that case like below.

OPENAI_API_KEY=xxx python -m openui

Docker

You can build and run the docker file from the /backend directory:

docker build . -t wandb/openui --load
docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui

Development

First be sure to install the package as editable, then passing --dev as an argument will live reload any local changes.

pip install -e .
python -m openui --dev

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Evaluation

The eval folder contains scripts for evaluating the performance of a model. It automates generating UI, taking screenshots of the UI, then asking gpt-4-vision-preview to rate the elements. More details about the eval pipeline coming soon...

Google Vertex AI

Create a service account with the appropriate permissions and authenticate with:

gcloud auth application-default login --impersonate-service-account ${GCLOUD_SERVICE_ACCOUNT}@${GCLOUD_PROJECT}.iam.gserviceaccount.com