A humble learning assistant made with LLAMA.
Project is created for an exam druing the university course Information Retrieval.
sequenceDiagram
participant user as App user
participant server as Flask server
participant model as Model API
user->>+server: Initialize session
server->>+model: Create class instance
server->>user: Session ID
user->>server: Select topic
server->>model: Produce questions and answers
model->>server: Rertreive Q&A and store them
loop has questions
par answering
server->>user: Return question
user->>server: Send answer
and grading
server->>model: Grade answer
model->>server: Return grade
server->>user: Return grade
end
end
user->>server: Close session
server->>model: Close session
model->>-server: Confirmation
server->>-user: Confirmation
To quickly and simply deploy the app, you can use Docker Compose.
docker compose up
To start running it in the background, you can use the -d
options (for detach).
docker compose up -d
To run the API server, just run the following command. To see which versions of packages are expected, check out the Conda environment.yml.
python -m flask --app dalai/main.py run --no-debugger --no-reload
Another option is to use VSCode debugging tool and run the server with debug: flask server
launcher.
First pull latest image from GitHub container registry.
docker pull ghcr.io/dusansimic/ir-proj/front:latest
Then start the container with the following command. It will start the container in background with an option to automatically remove it once it stops. It will start the web app on port 8080.
docker run --rm -d -p 8080:80 ghcr.io/dusansimic/ir-proj/front:latest
To stop the container first find the container name.
docker ps
And then stop it by entnering it's name in the stop command.
docker stop <container name>
To work on the backend, you can use the same command for running the server (explained above) or
through VSCode run the debug: flask server
launcher.
For the web app, you'll need Node.js (version 22) was used during development. Since the web app is located in the front directory, you'll need to change your current directory to it before taking any other steps.
To test the app you can run the development server with the dev
npm script.
npm run dev
When you would like to build the app, simply run the build
npm script.
npm run build
To test the API for the web application, you can use Bruno as a simple, Postman-like API testing tool. The Bruno collection is located in the bruno/ directory.
- Dušan Simić dusan.simic@dmi.uns.ac.rs
- Vladimir Kovačević vladimir.kovacevic@dmi.uns.ac.rs