CherGPT-Basic is a simplified, login-free ChatGPT-like interface designed for quick deployment in educational settings. Built with Streamlit and OpenAI, it provides educators with a customizable chat assistant that can be tailored to specific teaching and learning scenarios.
Mobile-friendly interface:
- Custom Instructions: Set and update custom instructions to guide student interactions with the AI
- Chat Log Management: Download and export chat logs as CSV for analysis
- Learning Analytics: Generate teaching and learning analytics based on collected chat logs
- Admin Panel: Secure admin access with password protection for managing settings
- App Description Customization: Customize the app description shown to users
- Persistent Storage: Chat history and instructions stored in PostgreSQL database
- Streaming Responses: Real-time streaming of AI responses for better user experience
CherGPT-Basic enables a variety of educational use cases:
- Historical Personas: Students can interact with historical figures for immersive learning
- Medical Simulations: Practice patient interactions with specific medical conditions
- Language Learning: Guided scenarios and escape rooms with comprehension checks
- Custom Tutoring: Create specialized tutoring assistants for specific subjects
- Interactive Assessments: Build conversational assessments with particular tasks as checks for understanding
- Python 3.8 or higher
- OpenAI API key
- PostgreSQL database (NeonDB recommended)
- Streamlit account (for deployment)
- GitHub account (for deployment)
- Physics CherGPT - Deployed from forked repository
- Physics CPDD CherGPT - Kah How's deployment
git clone https://github.com/ghostleek/chergpt-basic-demo.git
cd chergpt-basic-demoNote: This is a demo repository. For the original project, see String-sg/chergpt-basic.
pip install -r requirements.txtCreate a .streamlit/secrets.toml file with the following configuration:
OPENAI_API_KEY = "your-openai-api-key"
DATABASE_URL = "your-postgresql-connection-string"
ADMIN_PASSWORD = "your-admin-password"streamlit run main.pyThe application will be available at http://localhost:8501
There are three main steps for deploying to production:
- Set up your PostgreSQL database
- Obtain your OpenAI API key
- Deploy to Streamlit Cloud
We recommend using NeonDB for your PostgreSQL database. Get started here
-
Create an account: Visit the NeonDB console, log in, and create your account.
-
Create a new project: Create a free project with Singapore (or your preferred region) as the location. Choose any project and database name you like.
-
Copy connection string: Click the copy icon to get your database connection string. This allows you to store data persistently in CherGPT. Keep this secure - you'll need it in the next steps.
- If you're unsure how to create an OpenAI API key, see this guide.
- Keep this secure - you'll need it for deployment.
Note: Plans to migrate to open-source models are in progress.
-
Create accounts: First, create a Streamlit account and connect your GitHub account if you haven't already.
-
Deploy your app: Go to Streamlit Cloud, click "New app", select your forked repository (
ghostleek/chergpt-basic-demo), set the main file path tomain.py, and choose a custom domain for your app. -
Set up secrets: Go to "Advanced settings" and add your configuration to
secrets.toml:OPENAI_API_KEY = "your-openai-api-key" DATABASE_URL = "your-neondb-connection-string" ADMIN_PASSWORD = "your-chosen-admin-password"
-
Deploy: Click "Deploy" and wait a few minutes for the app to build and launch.
chergpt-basic-demo/
βββ app/
β βββ chatlog/ # Chat log management and analytics
β βββ db/ # Database connection and utilities
β βββ instructions/ # Custom instructions handling
βββ main.py # Main Streamlit application
βββ sidebar.py # Sidebar configuration and admin panel
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Admin Access: Protected by password authentication (configure in secrets)
- Database Security: Connection strings stored as secrets, never committed to repository
- API Keys: OpenAI API keys stored securely in Streamlit secrets
For additional security with SSO authentication, check the Streamlit authentication guide.
Run the test suite:
pytest app_test.pyOnce authenticated as an admin, you can access:
- Edit Description: Customize the app description shown to users
- Custom Instructions: Set system prompts to guide the AI's responses
- Chatlog Management: Download chat logs and view analytics summaries
- Database Management: Drop tables if needed (use with caution)
Contributions are welcome! Feel free to:
- Report bugs and issues
- Suggest new features
- Submit pull requests
- Improve documentation
This project is open-source. Feel free to explore and enhance the functionality of CherGPT-Basic according to your specific needs!
Database connection errors: Ensure your DATABASE_URL in secrets.toml is correct and the database is accessible.
OpenAI API errors: Verify your API key is valid and has sufficient credits.
Admin login not working: Check that ADMIN_PASSWORD is set correctly in your secrets configuration.
Local development issues: Ensure all dependencies are installed with pip install -r requirements.txt.
Need help? Open an issue in the GitHub repository.







