Giter VIP home page Giter VIP logo

gpt-test-bench's Introduction

A Simple GPT Web Client

Just a web interface for sending HTTP requests to the paid GPT API.

It uses the openai npm package.

Web application is bootstrapped using create-t3-app.

Update: Severely rate limited Front-end with unconnected API demo: https://gpt-demo.aaanh.app

Production: https://gpt.aaanh.app

Donate/Sponsor: https://ko-fi.com/aaanh

TODO

App Features

  • Application telemetry (Kafka or Cassandra)
    • Emit request events with opaque body
    • Emit error events
    • Implement session-based LogRocket
  • Cache prompts and responses in local storage
  • Multi-turn implementation (similar to ChatGPT)
  • Diffusion implementation (DALL-E 2)

DevOps

  • ConfigMap to export .env variables into the deployment
  • Migrate from Linode bare-metal to AKS

Usage

  • Install dependencies

    npm install
    
  • Copy .env.example to .env

  • Add your OpenAI API key in .env

  • (Optional) Add your upstash Redis tokens for rate limiting

  • Run

    npm run dev
    

Deployment

Note: The steps below apply for Microsoft Azure cloud platform but the principles essentially can be applied on any cloud platforms.

Another note: Currently, the end-to-end build and deploy process only works on AMDx64 platforms. ARM support to be investigated.

Local Cluster

Prerequisites

  • Docker Desktop with Kubernetes enabled
  • Azure CLI
    • Private ACR created
    • Service Principal with acrPull role for that ACR
    • Have a Docker image of the frontend application built and pushed to the private ACR

Step by step

  • Create k8s secret in local cluster. E.g. acr-secret
    kubectl create secret docker-registry acr-secret --docker-server=my-private-cr.azurecr.io --docker-username=service-principal-application-id --docker-password=service-principal-client-secret
  • Reference the k8s secret in the deployment manifest spec
    # ...
    container:
    # ...
    imagePullSecrets:
      - name: acr-secret
  • Deploy the application
    kubectl apply -f k8s/gpt-frontend.yaml
    
  • Navigate to localhost:3000

AKS

  • TBA

gpt-test-bench's People

Contributors

aaanh 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.