A Django-based AI prompt management and chat platform, blending modern APIs, classic templates, and machine learning moderation — built over nearly two months of daily development.
PromptPilot is a full-stack Django project integrating Django REST Framework for backend APIs with traditional Django templates for essential user flows.
It connects to Ollama’s Mistral model for AI-powered chat, supports both browser and terminal interaction, and includes an scikit-learn-powered comment moderation system.
- 5 DRF API endpoints for prompt management, message storage, and more.
- Traditional Django templates for:
- Login / Logout
- Signup
- Home
- Password Reset
- JWT Authentication via django-simple-jwt for secure token-based API access.
- Machine Learning Auto-Moderation with scikit-learn to flag inappropriate comments.
- Secure Secrets Management with python-dotenv.
- Integration with Ollama Mistral API:
- Communicate with Mistral directly from the Bash terminal in VS Code.
- Store AI responses in a dedicated API endpoint.
- Token Auto-Refresh Script to keep
.envcredentials up-to-date. - Code Style Enforcement with black formatter and crispy forms.
- 14 Automated Tests for reliability and regression prevention.
promptpilot/
├── prompts/ # Core prompt models, serializers, and views
├── users/ # User authentication & profile management
├── playgrounds/ # AI prompt execution and logging
├── chatmessages/ # Stores AI conversation history
├── scripts/ # Utility scripts (e.g., token refresh)
├── static/ # Static files
├── templates/ # HTML templates
├── utils/ # Helper functions/utilities
├── .dockerignore
├── .gitignore
├── .env.example
├── README.md
├── requirements.txt
├── manage.py
└── ...git clone https://github.com/pablo727/promptpilot
cd promptpilotpython -m venv .venv
source .venv/bin/activate # Linux / macOS
.venv\Scripts\activate # Windowspip install -r requirements.txtcp .env.example .env
# Fill in your secrets and API keyspython manage.py migratepython manage.py runserverYou can start a real-time chat with the Mistral model directly from your terminal in VS Code. Responses are stored automatically via the DRF API for future retrieval.
Run all tests:
python manage.py testThere are 14 automated tests covering models, views, serializers, and integration points.
The project includes a flag_classifier.py built with scikit-learn to detect and flag potentially inappropriate comments. You can train the model via:
python manage.py train_flag_modelThis project is licensed under the MIT License. Collaborations are welcome!




