GooeyAI / gooey-server

The core orchestration logic behind Gooey.AI
https://gooey.ai
Other
9 stars 2 forks source link

🏠 Homepage · 👾 Explore Workflows · 📚 Docs · 🤖 API · 🛟 Discord · 💃🏾 Start Building

Gooey.AI is the low-code orchestration platform with discoverable workflows & unified billing to all of GenAI universe.

🤖🍲 What is Gooey Server?

Gooey.AI is a low-code AI recipe platform and Gooey Server is our core repo.
It allows users to discover, customize, and deploy AI "recipes" using the best of private and open-source AI, all using a single API with a single auth token.
Recipes are workflows that incorporate various models to accomplish a task; they are designed to be highly customizable and shareable.

🧑‍💻 Who is this for and why would I want to use it?

For most developers, we DO NOT recommend running or forking Gooey Server; use our APIs or client SDK instead.
The repo is intended only for developers who want to run and deploy their own server cluster or run Gooey locally for development purposes.

Specifically, this repo may be for you if:

📋 Setup

☁️ Create a google cloud / firebase account

  1. Create a google cloud project
  2. Create a firebase project (using the same google cloud project)
  3. Enable the following services:
  4. Go to IAM, Create a service account with following roles:
    • Cloud Datastore User
    • Cloud Speech Administrator
    • Cloud Translation API Admin
    • Firebase Authentication Admin
    • Storage Admin
  5. Create and Download a JSON Key for this service account and save it to the project root as serviceAccountKey.json.
  6. Add your project & bucket name to .env

💻 Setup (Mac)

🐧 Setup (Linux)

🌍 Frontend

Clone gooey-gui repo, in the same directory as gooey-server and follow the setup steps.

🧪 Run Tests

ulimit -n unlimited  # Increase the number of open files allowed
./scripts/run-tests.sh

🗄 Initialize databse

# reset the database
./manage.py reset_db -c
# create the database
./manage.py sqlcreate | psql postgres
# run migrations
./manage.py migrate
# load the fixture (donwloaded by ./scripts/run-tests.sh)
./manage.py loaddata fixture.json
# create a superuser to access admin
./manage.py createsuperuser

🏃 Run

Note: The gooey-server project is not currently set up to be run without support from Gooey. This software requires access to a Google Cloud instance as well as business data loaded in the database. If you are interested in running this software totally independently, reach out to support@gooey.ai to communicate with our enterprise team.

Services

The processes that it starts are defined in Procfile. Currently they are these:

Service Port
API + GUI Server 8080
Admin site 8000
Usage dashboard 8501
Celery -
UI 3000
Vespa 8085

Honcho

You can start all required processes in one command with Honcho:

poetry run honcho start

This will spin up the API server at http://localhost:8080. To view the autogenerated API documentation, navigate to http://localhost:8080/docs

This default startup assumes that Redis, RabbitMQ, and PostgreSQL are installed and running as background services on ports 6379, 5672, and 5432 respectively.

The gooey-gui repo should be cloned at ../gooey-gui/ (adjacent to where thegooey-server repo sits). You can open the Procfile and comment this out if you don't need to run it.

Note: the Celery worker must be manually restarted on code changes. You can do this by stopping and starting Honcho.

Vespa (used for vector search)

You need to install OrbStack or Docker Desktop for this to work.

  1. Create a persistent volume for Vespa:
    docker volume create vespa
  2. Run the container:
    docker run \
    --hostname vespa-container \
    -p 8085:8080 -p 19071:19071 \
    --volume vespa:/opt/vespa/var \
    -it --rm --name vespa vespaengine/vespa
  3. Run the setup script
    ./manage.py runscript setup_vespa_db

📐 Code Formatting

Use black - https://pypi.org/project/black

💣 Secret Scanning

Gitleaks will automatically run pre-commit (see pre-commit-config.yaml for details) to prevent commits with secrets in the first place. To test this without committing, run pre-commit from the terminal. To skip this check, use SKIP=gitleaks git commit -m "message" to commit changes. Preferably, label false positives with the #gitleaks:allow comment instead of skipping the check.

Gitleaks will also run in the CI pipeline as a GitHub action on push and pull request (can also be manually triggered in the actions tab on GitHub). To update the baseline of ignored secrets, run python ./scripts/create_gitleaks_baseline.py from the venv and commit the changes to .gitleaksignore.