Portfolio & knowledge base for Michail Berjaoui, Lead ML/LLM Engineer. Built with Flask, Qdrant, BGE-M3, and Phi-4.
- Portfolio Landing - Dark cyber-violet showcase of CV, skills, experience
- AI Chat (RAG) - Ask questions about uploaded documents with source citations
- Web Scraper - Input a URL, scrape it, ask questions about the content
- Document Upload - Drag & drop PDF, DOCX, TXT, MD files for indexing
- Articles - Markdown-based technical blog
- Model Manager - Load/unload/switch LLM models at runtime
- Technical Choices - Full documentation of architecture decisions
| Component | Technology |
|---|---|
| Backend | Flask 3.1, Python 3.11+ |
| LLM | Phi-4 14B Q4_K_M via llama-cpp-python |
| Embedding | BGE-M3 via sentence-transformers |
| Vector DB | Qdrant (Docker, HNSW + INT8 quantization) |
| PDF Parser | PyMuPDF |
| Scraper | trafilatura + BeautifulSoup |
docker run -d -p 6333:6333 -p 6334:6334 \
-v qdrant_data:/qdrant/storage \
qdrant/qdrant:v1.12.4Place a .gguf model in the ./models/ directory:
mkdir -p models
# Example: download Phi-4 Q4_K_M
# huggingface-cli download microsoft/phi-4-gguf phi-4-Q4_K_M.gguf --local-dir ./models/pip install -r requirements.txtpython run.pyClick the ⚙ button in the top-right corner to:
- Connect to Qdrant
- Load the embedding model (BGE-M3)
- Load the LLM (select a .gguf file)
docker compose up -dThis starts both Qdrant and the Flask app.
Optimized for 64 GB RAM, 12 CPU cores, no GPU:
- LLM: 10 threads, ~9 GB RAM
- Embedding: 2 threads, ~2 GB RAM
- Qdrant: 2 CPUs, ~4 GB RAM
- Remaining: OS + headroom
See docs/choix_techniques.md for full technical documentation.
MIRROR/
├── app/
│ ├── __init__.py # Flask app factory
│ ├── config.py # All configuration dataclasses
│ ├── routes/ # Flask blueprints
│ │ ├── main.py # Landing page
│ │ ├── chat.py # RAG chat API
│ │ ├── documents.py # Document upload/management
│ │ ├── scraper.py # Web scraping API
│ │ ├── articles.py # Articles API
│ │ └── models_route.py # Model management API
│ ├── services/ # Business logic
│ │ ├── embedding.py # BGE-M3 embedding service
│ │ ├── llm.py # Phi-4 LLM service
│ │ ├── qdrant_store.py # Qdrant vector store
│ │ ├── rag.py # RAG pipeline with citations
│ │ ├── scraper.py # Web scraping
│ │ └── pdf_parser.py # Document parsing + chunking
│ ├── static/css/style.css # Dark cyber-violet theme
│ ├── static/js/app.js # Global JS (model manager, toasts)
│ └── templates/ # Jinja2 templates
├── articles/ # Markdown articles
├── docs/choix_techniques.md # Technical choices document
├── models/ # GGUF model files
├── uploads/ # Uploaded documents
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
└── run.py
Private portfolio project by Michail Berjaoui.