How to Set Up and Run Tutor-GPT: Your Learning Companion

Jun 8, 2022 | Educational

Welcome to the world of Tutor-GPT, a cutting-edge LangChain LLM application developed by PlasticLabs. This app redefines the educational experience by dynamically adapting to your learning needs. In this guide, we’ll walk you through the process of setting up Tutor-GPT, running it locally, and troubleshooting common issues. So, let’s dive in!

Understanding Tutor-GPT: An Analogy

Imagine Tutor-GPT as a personalized tutor who doesn’t just listen to what you say but also understands your learning journey. Like a talented chef who adjusts their recipe based on the ingredients available, Tutor-GPT customizes its prompts to teach you more effectively. Every time you interact with it, it evaluates what works best for you, like a teacher refining their lessons to suit the class’s needs. It’s not just about rote learning; it’s about adapting, evolving, and growing together.

Project Structure Overview

The Tutor-GPT project is modular, comprising several components for efficient management and functionality:

  • **agent**: Contains core logic and prompting architecture.
  • **bot**: Hosts the Discord bot implementation.
  • **api**: Provides an API interface to the Tutor-GPT backend.
  • **www**: Features a NextJS web frontend connecting to the API.
  • **common**: Holds commonly used resources across interfaces.
  • **supabase**: Contains SQL scripts for local Supabase setup.

Setting Up Tutor-GPT

To get started, ensure you have Python and Node.js installed. Following the steps below will help you set up your Tutor-GPT instance effortlessly.

Installation Steps

1. Clone the repository:

git clone https://github.com/plastic-labs/tutor-gpt.git

2. Change into the directory:

cd tutor-gpt

3. Install Python dependencies using Poetry:

poetry install

4. Navigate to the web folder and install NodeJS dependencies:

cd www && yarn install

Using Docker (Recommended)

If you prefer containerization, you can build and run Tutor-GPT using Docker:

git clone https://github.com/plastic-labs/tutor-gpt.git
cd tutor-gpt
docker build -t tutor-gpt-core .

To run the Discord bot, use:

docker run --env-file .env tutor-gpt-core python -u -m bot.app

And for the web UI:

docker run -p 8000:8000 --env-file .env tutor-gpt-core python -m uvicorn api.main:app --host 0.0.0.0 --port 8000

Configuration Setup

Before running the application, you’ll need to set up a few environment variables in a .env file:

  • **OPENAI_API_KEY**: Generate this key from OpenAI.
  • **SUPABASE_URL**: URL for your Supabase instance.
  • **SUPABASE_KEY**: API key for interacting with Supabase.
  • **CONVERSATION_TABLE**: Table name for storing conversation metadata.
  • **MEMORY_TABLE**: Table for holding messages.
  • For Discord usage, you’ll also need **BOT_TOKEN** and **THOUGHT_CHANNEL_ID**.
  • For Web usage, specify **URL** and other relevant variables.

Troubleshooting

If you encounter any issues while setting up or running Tutor-GPT, consider the following solutions:

  • Ensure Docker is running if using Docker for installation.
  • Verify your .env file contains all the necessary environment variables.
  • Make sure dependencies are correctly installed via Poetry or Yarn.
  • If you run into permissions issues, try using administrator mode or adjust file permissions.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox