Skip to content

Hosting the LTL Tutor

Siddhartha Prasad edited this page Oct 16, 2024 · 5 revisions

While the LTL Tutor is available at ltl-tutor.xyz, you can deploy and host your own version of the tutor.

Self Hosting Steps

The LTL Tutor app can be run as a Docker image as follows:

  1. Clone the LTL Tutor Git repository
git clone https://github.com/brownplt/LTLTutor
cd LTLTutor
  1. Within the cloned directory, build the Docker image:
docker build -t ltltutor:latest .
  1. You can now run the container as follows, making the tutor available on port 5000 on your local network.
docker run --rm -it -p 5000:5000 -e SECRET_KEY=secret ltltutor

Since the LTL Tutor uses session authentication, you must provide it with a secret key unique to your application.

This container can be deployed in any production environment using a variety of tools, including Docker Compose, Kubernetes, or Heroku.

User Records

If you do decide to host the LTL Tutor app, we ask you to periodically share user records with us so we can improve the tutor. These records are anonymous, and are transparently available to each user. We will use these records to evaluate the tutor's overall efficacy (including the quality of generated questions and value of its feedback mechanisms) and improve our picture of LTL misconceptions (including identifying new misconception classes, and understanding more about the relative prevalence of existing misconceptions).

An example record might look as follows:

{"21": {"user_id": "outnumbered-soilures", "timestamp": "2024-05-21 15:45:47", "misconception": "MisconceptionCode.ImplicitG", "question_text": "Eventually, it is not the case that from this point on, 'z' holds.\n ", "question_options": "[{\"value\": \"(F (! (G z)))\", \"misconceptions\": \"[]\"}, {\"value\": \"(F (! z))\", \"misconceptions\": \"['MisconceptionCode.ImplicitG']\"}, {\"value\": \"(! (G z))\", \"misconceptions\": \"['MisconceptionCode.ImplicitF', 'MisconceptionCode.OtherImplicit']\"}, {\"value\": \"(G (! (G z)))\", \"misconceptions\": \"['MisconceptionCode.BadStateQuantification']\"}]", "correct_answer": false}}

By default, the LTL Tutor container stores user records to a local database file (/src/db/database.db). You can persist this file independent of database runs by mounting a directory in place of src/db during your container run.

docker run --rm -it -v /path/to/store/db:/src/db -e SECRET_KEY=<secret> -p 5000:5000 ltltutor

Alternately, you can set the DATABASE_URL environment variable to point at any SQL Alchemy supported database, and the ltltutor container will store records in this database.

docker run --rm -it -e DATABASE_URL=<url> -e SECRET_KEY=<secret> -p 5000:5000 ltltutor
Clone this wiki locally