An automated content moderation tool for the Particl Marketplace using Large Language Models (LLMs) to analyze and moderate content according to customizable policies.
- Overview
- Prerequisites
- Installation
- Configuration
- Usage
- Troubleshooting
- Related Projects
- Official Resources
- License
This tool provides automated content moderation for Particl marketplace listings using LLMs. It can:
- Scan marketplace listings automatically
- Process listings through LLM models for content analysis
- Apply customizable moderation policies
- Vote on listings based on moderation results
- Run in continuous mode for automated monitoring
- Python 3.8 or higher
- Ollama (for LLM support)
- Particl Core (will be installed through the application)
- Sufficient disk space for blockchain data
- Download Python from python.org
- Run the installer (ensure "Add Python to PATH" is checked)
- Verify installation by opening Command Prompt and typing:
python --version
- If this doesn't work, try:
py --version
- If this doesn't work, try:
Using Homebrew:
brew install python
Verify installation:
python3 --version
sudo apt update
sudo apt install python3 python3-pip python3-venv
Verify installation:
python3 --version
Note: Depending on your system configuration, you might need to use python
instead of python3
for commands. If one doesn't work, try the other.
- Clone the repository:
git clone <repository-url>
cd particl_moderation
- From the root directory of the project, run the setup script:
# On Linux/macOS
python3 setup_environment.py
# On Windows
python setup_environment.py
- Activate the virtual environment by typing these commands in the root directory of the project:
# On Linux/macOS
source venv/bin/activate
# On Windows
venv\Scripts\activate
- From the root directory, start the application:
# On Linux/macOS
python3 app.py
# On Windows
python app.py
- Install Particl Core from the settings menu
- Start the Particl daemon
- Create a new wallet or initialize an existing one
- Deposit PART coins to your wallet (required for voting)
- Choose and install an LLM model (via settings)
- Configure moderation policies
- After creating or initializing your wallet, you'll need to deposit PART coins
- Coins are required for voting on marketplace listings
- The wallet must remain unlocked during operation
- Keep sufficient funds for your planned moderation activities
- Choose from available models in settings
- The default model is Gemma2:2b as it offers the best balance of speed, accuracy and resources (RAM and VRAM/storage) requirements
- More models will be added over time after they've been throroughly tested for accuracy
- Configure content rules
- Choose to apply rule templates (serve as examples) or create your own rules using natural language
- If creating custom rules, be as precise as possible, and test results on test listings before applying to production listings (from Particl Marketplace)
- Ensure you have PART coins in your wallet for voting
- Set up moderation policies in settings
- Choose operation mode:
- Manual Mode: Scan and process listings on demand. Recommended for initial setup to verify LLM decisions align with your moderation standards
- Continuous Mode: Enables automated background monitoring and moderation. Requires keeping the terminal window open during operation
- Perfect for learning system behavior and testing new moderation policies
- Manually deploy listing scanning and processing from the Scan and Process Listings menu option in the main menu. Choose to moderate test or real listings
- Review individual listings post-processing by navigating to the Display Processed Listings from the menu, or check the /config/results.txt file
- Verify LLM decisions, search for specific items, and edit them as necessary by using the specified keyboard controls
- Broadcast moderation decisions by selection the Broadcast Moderation Decisions menu option in the main menu
- Continuously scans for new marketplace listings
- Processes listings through moderation queue
- Applies LLM analysis based on policies
- Broadcasts votes automatically
- Repeats cycle after a delay
- Logs all actions for review (config/moderation.log)
- Start with manual mode to understand system behavior and test new moderation policies (important)
- Regularly monitor moderation logs
- Keep sufficient PART balance for voting
- Backup wallet and configuration files
- Remember that LLMs are deterministic systems. Therefore, they can hallucinate or return undesirable moderation decisions. This is why it is vital to thoroughly test new moderation policies on test listings, then deploy manually on live listings before starting the Continuous Mode.
Common issues and solutions:
-
Python Command Not Found
- Try both
python
andpython3
commands - Verify PATH environment variables
- Reinstall Python if necessary
- Try both
-
Virtual Environment Issues
- Ensure you're in the project root directory
- Try recreating the virtual environment
- Check Python version compatibility
-
LLM Model Issues
- Verify Ollama installation
- Check model installation status
- Try reinstalling the model with
ollama rm [model_name]
andollama run [model_name]
(e.g.,ollama rm gemma2:2b
andollama run gemma2:2b
)
-
Wallet Connection Issues
- Verify daemon is running
- Check wallet unlock status
- Ensure sufficient funds
This project is licensed under the MIT License - see the LICENSE file for details.