GithubHelp home page GithubHelp logo

dhomane / calamity-gpt-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thesephist/calamity

0.0 1.0 0.0 341 KB

Self-hosted GPT playground

License: MIT License

Python 37.81% CSS 52.96% Makefile 2.47% HTML 6.76%

calamity-gpt-ui's Introduction

Calamity ๐ŸŒ‹

Calamity is a lightweight web app that wraps my custom (private) language model API to let me play and experiment with pretrained autoregressive language models easily. It runs Huggingface transformers wrappers of language models (currently EleutherAI/gpt-j-6B with 6B parameters, because it's cheaper than GPT-3/PaLM/Chinchilla/whatever else) behind a Flask / uWSGI API on the backend, and a Torus/Oak-based frontend that wraps the API. The backend lives in ./services, and the frontend + frontend server in ./src.

Calamity running in a browser

The architecture here is a little weird. There are two independent web apps: the model and API server, and the web app that wraps and calls the API and serves the client user interface. It's designed this way so that the API itself can be reused across other apps in my personal infrastructure, some of which aren't public yet. The current GPT-J-6B configuration requires about 60GB of RAM to fully load the model and 20-25GB to serve inference.

I personally run it on a reasonably-specced DigitalOcean VM behind an Nginx reverse proxy. Both the backend API service and the web app frontend run as systemd daemons. Currently, the API only lets the client customize generated sequence length, number, and the eos_token that marks the end of text generation, but I might add other parameters like temperature down the road.

Development

Calamity is a web app written with Oak. To run and build Calamity, you'll need to install the oak binary.

Calamity's development is managed through a Makefile:

  • make serve (default when just make is run) starts the web server at src/main.oak
  • make build or make b builds the frontend from src/app.js.oak
  • make watch or make w runs the frontend build while watching files for changes (using entr)
  • make fmt or make f re-formats all changed files tracked by Git. To format all files from scratch, run something like oak fmt **/*.oak --fix.

calamity-gpt-ui's People

Contributors

thesephist avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.