File size: 7,220 Bytes
66b5280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f89337
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9aedfc1
9f89337
 
 
9aedfc1
9f89337
 
 
9aedfc1
9f89337
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
---
language:
- en
license: mit
tags:
- conversational
- emotional-intelligence
- brello-ei
- epic-systems
- ai-assistant
- empathy
- mental-health
- support
pipeline_tag: text-generation
---

# Brello EI 0 - Emotional Intelligence AI Model

**Created by Epic Systems | Engineered by Rehan Temkar**

A locally-run emotional intelligence AI model designed to provide empathetic, emotionally-aware responses with natural conversation flow.

## Features

- **Emotional Intelligence**: Designed to provide empathetic, understanding responses
- **Local Operation**: Runs completely locally without external dependencies
- **Memory Efficient**: 4-bit quantization for optimal performance on limited hardware
- **Advanced Architecture**: Based on Llama 3.2 3B foundation model
- **Easy Integration**: Simple API for quick integration
- **Flexible Configuration**: Customizable generation parameters

## Installation

### Prerequisites

- Python 3.8+
- CUDA-compatible GPU (recommended) or CPU
- At least 8GB RAM (16GB recommended)

### Install Dependencies

```bash
pip install -r requirements.txt
```

### Model Options

**Option 1: Use Public Model (Recommended for quick start)**
The default configuration uses `microsoft/DialoGPT-medium` which is publicly available and doesn't require authentication.

**Option 2: Use Llama 3.2 3B (Requires authentication)**
To use the actual Llama 3.2 3B model:
1. Create a Hugging Face account
2. Accept the model license at: https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct
3. Login with: `huggingface-cli login` or `hf auth login`
4. Update the model_path in your code to: `"meta-llama/Llama-3.2-3B-Instruct"`

**Option 3: Use Other Public Models**
- `microsoft/DialoGPT-large` (larger, better responses)
- `microsoft/DialoGPT-small` (faster, smaller)
- `HuggingFaceTB/SmolLM3-3B` (3B parameter model)

## Quick Start

### Basic Usage

```python
from brello_ei_0 import BrelloEI0

# Load the model
model = BrelloEI0(
    model_path="microsoft/DialoGPT-medium",  # Public model, no auth required
    load_in_4bit=False  # Set to True if you have CUDA
)

# Generate an emotionally intelligent response
response = model.generate_response("I'm feeling really stressed about my job interview.")
print(response)
```

### Alternative Loading

```python
from brello_ei_0 import load_brello_ei_0

# Load model using convenience function
model = load_brello_ei_0("microsoft/DialoGPT-medium")

# Direct call
response = model("I'm really happy about my recent success!")
print(response)
```

### Chat Interface

```python
# Simple chat
response = model.chat("How are you feeling today?")
print(response)
```

## Example Conversations

```python
# Example 1: Anxiety Support
response = model.generate_response("I'm feeling really anxious about my presentation tomorrow.")
# Output: "I can understand how nerve-wracking presentations can be. It's completely natural to feel anxious..."

# Example 2: Celebrating Success
response = model.generate_response("I just got promoted at work!")
# Output: "That's wonderful! I can feel your excitement and it's absolutely contagious..."

# Example 3: Emotional Support
response = model.generate_response("I'm feeling lonely and isolated.")
# Output: "I'm so sorry you're feeling this way. Loneliness can be really painful..."

# Example 4: Career Guidance
response = model.generate_response("I'm confused about what I want to do with my life.")
# Output: "That's a really common and natural feeling, especially when we're at crossroads..."
```

## Configuration

### Model Parameters

- `model_path`: Path to Llama 3.2 3B model (default: "meta-llama/Meta-Llama-3.2-3B-Instruct")
- `device`: Device to load model on ('cuda', 'cpu', etc.)
- `load_in_4bit`: Enable 4-bit quantization for memory efficiency (recommended)
- `load_in_8bit`: Enable 8-bit quantization for memory efficiency
- `torch_dtype`: Torch data type for model weights

### Generation Parameters

- `temperature`: Sampling temperature (default: 0.7)
- `top_p`: Top-p sampling parameter (default: 0.9)
- `max_length`: Maximum response length (default: 4096)
- `min_length`: Minimum response length (default: 30)
- `max_new_tokens`: Maximum new tokens to generate (default: 256)
- `repetition_penalty`: Penalty for repetition (default: 1.1)

## Performance

### Model Specifications

- **Foundation**: Microsoft DialoGPT-medium
- **Parameters**: 345 Million
- **Context Length**: 1024 tokens
- **Training**: Conversational dialogue data
- **Optimization**: Emotional intelligence focus

### Memory Requirements

- **Full Precision**: ~1GB VRAM
- **8-bit Quantization**: ~500MB VRAM
- **4-bit Quantization**: ~250MB VRAM (recommended)

## Advanced Usage

### Custom Generation Parameters

```python
response = model.generate_response(
    "I'm feeling overwhelmed with my responsibilities.",
    temperature=0.8,
    top_p=0.95,
    max_new_tokens=300,
    repetition_penalty=1.05
)
```

### Batch Processing

```python
messages = [
    "I'm really proud of my accomplishments.",
    "I'm feeling uncertain about my future.",
    "I'm grateful for my support system."
]

responses = []
for message in messages:
    response = model.generate_response(message)
    responses.append(response)
```

## 🎯 Training

### Fine-tune for Emotional Intelligence

```bash
python train_brello_ei_0.py
```

The training script will:
- Load Llama 3.2 3B with 4-bit quantization
- Apply LoRA for efficient fine-tuning
- Train on emotional intelligence data
- Save the fine-tuned model

### Training Data

The model is fine-tuned on emotional intelligence scenarios:
- Anxiety and stress support
- Celebrating success and achievements
- Dealing with loneliness and isolation
- Career guidance and life decisions
- Gratitude and appreciation
- Overwhelm and responsibility management

## Architecture

Brello EI 0 is built on advanced language model architecture with the following key components:

- **Base Model**: Microsoft DialoGPT-medium
- **Tokenizer**: Optimized for conversational data
- **Generation**: Emotionally intelligent response patterns
- **Post-processing**: Response cleaning and enhancement
- **Quantization**: 4-bit for memory efficiency (optional)

## 🎯 Use Cases

### Emotional Support
- Providing empathetic responses to stress and anxiety
- Supporting users through difficult life transitions
- Celebrating achievements and successes

### Personal Development
- Career guidance and decision-making support
- Life goal exploration and planning
- Self-reflection and emotional awareness

### Mental Health Support
- Stress management and coping strategies
- Emotional validation and understanding
- Positive reinforcement and encouragement

## Contributing

This model is part of the Epic Systems AI initiative. For questions or contributions, please contact the development team.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Acknowledgments

- **Epic Systems** for the vision and support
- **Rehan Temkar** for engineering and development
- **Microsoft** for the DialoGPT foundation model
- **Hugging Face** for the transformers library

---

**Brello EI 0** - Bringing emotional intelligence to AI conversations 💙✨