Fine-tuned Llama-3.2 1B offering mental health conversations through a secure, local-first approach.
- Overview
- Key Features
- Technical Requirements
- Dataset
- Installation
- Training Process
- Usage
- Ethical Considerations
- Limitations
- Contributing
- License
This project aims to create an AI-powered therapist assistant by fine-tuning the Llama-3.2 1B model. The assistant is designed to provide initial mental health support while clearly communicating its limitations and directing users to professional help when needed. The model is optimized to run efficiently on consumer-grade GPUs while maintaining high-quality therapeutic responses.
- Empathetic responses based on CBT (Cognitive Behavioral Therapy) principles
- Privacy-focused design with local deployment options
- Clear communication of AI limitations and scope
- Professional help referral system
- Lightweight model optimized for consumer GPUs
- Quantized model support for efficient inference
- Open-source and customizable
- Regular updates and community contributions
- NVIDIA GPU with 6GB VRAM (RTX 3060 recommended)
- 32GB RAM
- Ubuntu 20.04+ or Windows 10/11 with WSL2
- Python 3.9+
- PyTorch 2.0+
- 50GB free disk space
- CUDA 11.7+
Our training utilizes a carefully curated combination of high-quality datasets:
-
Mental Health Conversations Dataset
- Source: Mental Health Conversations Dataset
- ~15,000 therapeutic conversations
- Focused on various mental health topics
- Cleaned and annotated for quality
-
Therapy Transcripts and Dialogues
- Source: PsyQA Dataset
- ~10,000 therapy conversation excerpts
- Professionally validated responses
- Privacy-compliant and anonymized
-
CBT Framework Dataset
- Custom-curated dataset of CBT techniques
- ~3,000 examples of CBT-based interventions
- Includes common therapeutic scenarios
- Validated by mental health professionals
-
Crisis Response Dataset
- Specialized dataset for crisis intervention
- ~2,000 examples of appropriate crisis responses
- Clear escalation protocols
- Professional referral guidelines
-
Clone the repository:
git clone https://github.com/yourusername/ai-therapist-assistant.git cd ai-therapist-assistant
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac # or .\venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Download the pre-trained model:
python scripts/download_model.py
-
Data Preparation
python scripts/prepare_data.py --dataset_dir data/raw --output_dir data/processed
-
Model Fine-tuning
python scripts/train.py \ --model_name "llama-3.2-1b" \ --dataset_path "data/processed" \ --output_dir "models/fine_tuned" \ --batch_size 4 \ --gradient_accumulation_steps 4 \ --learning_rate 2e-5
-
Model Quantization
python scripts/quantize.py --model_path "models/fine_tuned"
-
Start the assistant:
python run_assistant.py --model_path "models/fine_tuned"
-
Access the web interface:
http://localhost:8080
- Not a replacement for professional mental health care
- Clear disclosure of AI nature
- Regular bias monitoring and mitigation
- Privacy-first approach with local deployment options
- Transparent referral system to mental health professionals
- Regular ethical audits and updates
- Cannot provide clinical diagnosis
- Not suitable for emergency situations
- Limited context understanding
- May not understand complex trauma
- Requires professional oversight
- Not a replacement for human therapists
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.