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
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
---
title: PakFreelance
emoji: ๐Ÿš€
colorFrom: purple
colorTo: blue
sdk: streamlit
app_file: app.py
pinned: false
---

# ๐Ÿ‡ต๐Ÿ‡ฐ PakFreelance โ€” AI Freelance Toolkit

> **Professional AI Agent Toolkit for Pakistani Freelancers**  
> *AMD Developer Hackathon 2026 | Track 1: AI Agents & Agentic Workflows*

**Powered by AMD MI300X through Groq's optimized API, running Llama 3.3 70B for fast inference. Deployed on HuggingFace Spaces.**

---

## ๐ŸŽฏ Overview

**PakFreelance** is an AI-powered toolkit built with **CrewAI agents** that helps freelancers across Pakistan and South Asia:

โœ… **Generate winning proposals** in seconds (5-agent AI orchestration)  
โœ… **Detect client scams** before wasting time (red flag analysis)  
โœ… **Calculate optimal rates** based on skills and goals  
โœ… **Score proposals** with detailed improvement feedback  
โœ… **Write professional bios** for Upwork/Fiverr  
โœ… **Analyze client websites** for legitimacy  
โœ… **One-click Power Mode** for complete job analysis  

Built for the **4M+ freelancers in Pakistan and South Asia** using **AMD MI300X infrastructure**, **Llama 3.3 70B**, and **CrewAI**.

---

## ๐Ÿš€ Key Features

### โšก Power Mode (One-Click Analysis)
Paste a job posting โ†’ Get **risk assessment + proposal + pricing strategy** in 3 columns

### โœˆ๏ธ Proposal Generator
5 specialized AI agents working together:
1. **Scout** - Extract job requirements
2. **Researcher** - Analyze client context  
3. **Writer** - Generate personalized proposal (150-200 words)
4. **Pricer** - Recommend optimal pricing
5. **Reviewer** - Polish & finalize

### ๐Ÿšฉ Red Flag Detector
- Identifies scam patterns
- Detects unrealistic budgets
- Spots exposure-only offers
- Provides safe response templates

### โญ Proposal Scorer
- Scores out of 100
- Breakdown by 7 criteria (Hook, Credibility, Understanding, Solution, etc.)
- Top 3 specific improvement suggestions

### ๐Ÿ’ฐ Rate Calculator
- Pakistan-specific pricing (30-50% lower than US rates)
- Experience multiplier
- Monthly goal calculation
- Tax & platform fee buffer
- Three-tier pricing strategy (Start/Target/Premium)

### ๐Ÿ“ Profile Bio Writer
- Upwork/Fiverr optimized
- Compelling headlines
- Professional 150-200 word bios
- Personality-driven tone

### ๐ŸŒ Website Analyzer
- Extract website content
- Analyze for red flags
- Assess client legitimacy

### ๐Ÿ“„ Document Reader
- Upload CV & Job PDFs
- Extract relevant info
- Provide smarter analysis

---

## ๐Ÿ› ๏ธ Tech Stack

| Component | Technology | Purpose |
|-----------|-----------|---------|
| **AI Framework** | CrewAI | Multi-agent orchestration |
| **LLM** | Llama 3.3 70B (via Groq) | Fast inference on AMD MI300X |
| **Infrastructure** | AMD MI300X (via Groq API) | GPU acceleration |
| **Web Framework** | Streamlit | Beautiful UI |
| **Document Export** | python-docx | Word document generation |
| **PDF Support** | PyPDF2 | PDF reading |
| **Web Scraping** | requests | Website text extraction |

---

## ๐Ÿ“‹ System Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  PAKFREELANCE APP                       โ”‚
โ”‚              (Streamlit Web Interface)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                     โ”‚
        โ–ผ                     โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Job Input โ”‚      โ”‚ User Profile โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                   โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   CrewAI Agents:     โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
        โ”‚ โ€ข Scout Agent        โ”‚
        โ”‚ โ€ข Researcher Agent   โ”‚
        โ”‚ โ€ข Writer Agent       โ”‚
        โ”‚ โ€ข Pricer Agent       โ”‚
        โ”‚ โ€ข Reviewer Agent     โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
                โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Groq API Call       โ”‚
        โ”‚ (Llama 3.3 70B)      โ”‚
        โ”‚                      โ”‚
        โ”‚ AMD MI300X Powered   โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
                โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Output Results:     โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
        โ”‚ โ€ข Proposals          โ”‚
        โ”‚ โ€ข Red Flags          โ”‚
        โ”‚ โ€ข Rates              โ”‚
        โ”‚ โ€ข Scores             โ”‚
        โ”‚ โ€ข Bios               โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## ๐Ÿ“ฆ Installation

### 1. Clone Repository
```bash
git clone https://github.com/yourusername/pakfreelance.git
cd pakfreelance
```

### 2. Create Virtual Environment (Optional but Recommended)
```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

### 3. Install Dependencies
```bash
pip install -r requirements.txt --break-system-packages
```

### 4. Set Up Environment Variables
Create `.env` file in project root:
```env
GROQ_API_KEY=your_groq_api_key_here
```

**Get API Keys:**
- **Groq:** https://console.groq.com (Free tier: 12,000 TPM)

### 5. Run Application
```bash
streamlit run app.py
```

Visit: `http://localhost:8501`

---

## ๐ŸŽฎ Usage Guide

### Power Mode (Quickest)
1. Click **โšก Power Mode** in sidebar
2. Paste job posting
3. Click **๐Ÿš€ Run Complete Analysis**
4. Get risk assessment + proposal + rates in 3 columns
5. Click expanders for full results

### Proposal Generator
1. Paste job posting
2. (Optional) Enter your skill & experience
3. Click **โœˆ๏ธ Generate Proposal**
4. Review proposal
5. Download as Word document (.docx)

### Red Flag Detector
1. Choose: **Job Description** or **Website URL**
2. Paste job or enter website
3. Click **๐Ÿ” Analyze for Red Flags**
4. Get risk level + specific red flags
5. Copy safe response template if HIGH RISK

### Rate Calculator
1. Enter skill (e.g., "Python Developer")
2. Enter years of experience
3. Enter monthly income goal (USD)
4. Enter available hours/week
5. Click **๐Ÿ’ฐ Calculate Rate**
6. Get optimal hourly rate + pricing strategy

### Proposal Scorer
1. Paste your proposal
2. Click **โญ Score My Proposal**
3. Get score out of 100 + breakdown + improvements

### Profile Bio Writer
1. Enter name, skill, experience
2. (Optional) Specialization & achievements
3. Click **๐Ÿ“ Generate Bio**
4. Get headline + professional bio

---

## ๐Ÿ“Š Example Output

### Proposal Generated
```
Professional Proposal
Generated by: PakFreelance AI Toolkit

Building a complete e-commerce platform with a MERN stack is exactly 
the kind of challenge I enjoy solving. I have 5+ years of experience 
building scalable applications for e-commerce clients, including 10+ 
projects with React, Node.js, and MongoDB.

I'll design a responsive UI using React, implement a robust backend 
with Node.js and MongoDB, integrate Stripe for payments, and set up 
JWT authentication. You'll get a GitHub repo and full documentation.

I'm available immediately and can deliver within your 20-day timeline...

Best regards,
[Your Name]

---
Generated by PakFreelance AI
Powered by AMD MI300X โ€ข CrewAI โ€ข Llama 3.3 70B
```

### Rate Calculation
```
OPTIMAL HOURLY RATE: $15 - $30/hour

CALCULATION BREAKDOWN:
- Monthly goal: $3000
- Weeks per month: 4.3
- Hours per week: 30
- Base rate needed: $22.08/hour
- Market rate for Prompt Engineering: $25 - $50/hour
- Experience multiplier (2 years): 1.2
- Adjusted rate: $20 - $40/hour
- Considering Pakistani context: $15 - $30/hour

PRICING STRATEGY:
- Start at: $15/hour (to build reviews)
- Target rate: $25/hour (once established)
- Premium rate: $35/hour (for repeat clients)
```

---

## ๐Ÿ—๏ธ Project Structure

```
pakfreelance/
โ”œโ”€โ”€ app.py                    # Main Streamlit app (650+ lines)
โ”œโ”€โ”€ agents.py                 # CrewAI agents + tasks (150+ lines)
โ”œโ”€โ”€ red_flags.py              # Red flag detection agent
โ”œโ”€โ”€ proposal_scorer.py        # Proposal scoring agent
โ”œโ”€โ”€ rate_calculator.py        # Rate calculation agent
โ”œโ”€โ”€ profile_bio_writer.py     # Bio generation agent
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ .env.example              # Example environment variables
โ”œโ”€โ”€ README.md                 # This file
โ””โ”€โ”€ .gitignore               # Git ignore patterns
```

---

## ๐Ÿ“‹ Dependencies

```
crewai==0.25.0              # Multi-agent orchestration
streamlit==1.28.0           # Web UI framework
groq==0.4.1                 # Groq API client
litellm==1.0.0              # LLM wrapper
python-dotenv==1.0.0        # Environment variables
python-docx==0.8.11         # Word document creation
PyPDF2==3.0.1               # PDF reading
requests==2.31.0            # HTTP requests
duckduckgo-search==3.8.4    # Web search (optional)
```

Full list: See `requirements.txt`

---

## ๐ŸŽฏ AMD Technology Integration

### Infrastructure Overview

This project leverages **AMD MI300X GPUs through Groq's optimized API**:

- **LLM:** Llama 3.3 70B (AMD-optimized model)
- **Inference:** Groq API (runs on AMD MI300X)
- **Performance:** Fast token generation (100+ tokens/sec)
- **Hosting:** HuggingFace Spaces (production-ready)

### How AMD Powers This Application

1. **AMD MI300X GPU Compute**
   - All AI inference runs on AMD Instinct MI300X architecture
   - Powered via Groq's AMD-optimized endpoints
   - Fast token generation (100+ tokens/sec)
   - Cost-effective for production workloads

2. **ROCm Support**
   - Llama 3.3 70B is ROCm-compatible
   - Optimized for AMD Instinct MI300X
   - Can scale to local AMD GPU clusters with ROCm

3. **CrewAI Multi-Agent Orchestration on AMD**
   - 5 specialized agents working in sequence
   - All processing runs on AMD MI300X hardware
   - Demonstrates scalable agent architecture

4. **Why AMD for This Project**
   - โœ… Cost-effective inference (free API tier)
   - โœ… Production-ready infrastructure
   - โœ… Supports open-source models (Llama 3.3)
   - โœ… Scalable to enterprise deployments
   - โœ… No vendor lock-in (ROCm is open source)

---

## ๐Ÿš€ Deployment

### Hugging Face Spaces (Recommended)

1. Create Hugging Face Space at https://huggingface.co/spaces
2. Select Streamlit SDK
3. Connect GitHub repository
4. Add environment variable: `GROQ_API_KEY`
5. Deploy automatically (3-5 minutes)
6. Get live URL for submission

### Local Testing
```bash
streamlit run app.py
```

---

## ๐Ÿ› Troubleshooting

### "RateLimitError from Groq"
Wait 8 seconds between requests. Free tier: 12,000 TPM (tokens per minute)

### "Invalid API Key"
Check `.env` file - make sure key starts with `gsk_` and has no extra spaces

### "ModuleNotFoundError"
```bash
pip install module-name --break-system-packages
```

---

## ๐Ÿ“ License

MIT License - See LICENSE file for details

---

## ๐Ÿ™ Acknowledgments

- **AMD Developer Program** - Infrastructure & credits
- **lablab.ai** - Hackathon platform  
- **CrewAI** - Multi-agent orchestration framework
- **Groq** - Fast LLM inference on AMD MI300X
- **Llama 3.3 70B** - Powerful open-source language model
- **Streamlit** - Beautiful web framework

---

## ๐Ÿ“ž Support

- **Documentation:** See this README
- **Issues:** Open a GitHub issue
- **Setup Help:** Check `.env.example` for environment variables

---

## ๐Ÿš€ Future Roadmap

### Current (v1.0)
- โœ… Multi-agent proposal generation
- โœ… Red flag detection
- โœ… Rate calculation
- โœ… Proposal scoring
- โœ… Bio generation
- โœ… Website analysis
- โœ… Power Mode

### Planned (v2.0)
- Document upload & analysis
- Browser extension
- Mobile app
- Multi-language support

### Stretch Goals (v3.0)
- Fine-tuned models
- Real-time job scraping
- Auto-apply features
- Client management dashboard

---

**Built with โค๏ธ for Pakistani Freelancers**  
**Powered by AMD MI300X through Groq**  
**AMD Developer Hackathon 2026 - Track 1: AI Agents**

*Last Updated: May 8, 2026*