How alucek/quickb works
Project Type and Purpose
• QuicKB is an open-source, end-to-end machine learning pipeline tool for optimizing document retrieval by:
• Chunking source documents into coherent segments
• Generating synthetic QA pairs
• Fine-tuning embedding models
• It is invoked via a single CLI entrypoint (src/main.py) and driven by config.yaml.
File Structure Analysis
• Top-level files:
• config.yaml: central pipeline configuration
• requirements.txt, setup.py: packaging & dependencies
• README.md: detailed overview & usage
• src/: core implementation, broken into submodules:
• chunking/: various chunker implementations & registry
• synth_dataset/: synthetic question generator, deduplicator, rate limiter
• training/: model training orchestration
• hub_upload/: push datasets/models to Hugging Face Hub
• prompts/: prompt templates for LLM-based generation
• main.py: orchestrates stages based on pipeline.from_stage and to_stage
Key Insights from README
• Pipeline stages: CHUNK → GENERATE → TRAIN
• Each stage reads/writes JSON artifacts (knowledgebase.json, train_data.json, model outputs)
• External integrations:
• LiteLLM (any LLM/embedding provider) for chunking & QA generation
• Hugging Face Hub for dataset/model storage and retrieval
1. Config Manager (reads config.yaml)
2. Orchestrator (src/main.py)
3. Document Ingestion (filesystem or Hub)
4. Chunking Module (registry → chosen chunker)
5. Knowledgebase Output (knowledgebase.json)
6. Synthetic QA Generator (LLM + deduplicator + rate limiter)
7. Training Data Output (train_data.json)
8. Model Trainer (SentenceTransformers pipeline)
9. Model Output (trained embedding model directory)
10. External Services:
• LiteLLM API (LLM calls, embeddings)
• Hugging Face Hub (dataset/model push & pull)
• Config Manager → Orchestrator (inject settings)
• Orchestrator → Document Ingestion → Chunking Module
• Chunking Module → Knowledgebase Output
• Knowledgebase Output → Synthetic QA Generator
• Synthetic QA Generator → Training Data Output
• Training Data Output + Knowledgebase Output → Model Trainer
• Model Trainer → Model Output
• At each artifact step, optional Hub Upload/Download interactions
• Chunking & QA modules ↔ LiteLLM API
• Upload modules ↔ Hugging Face Hub
c. Architectural Patterns & Principles:
• Modular pipeline stages, pluggable strategies (Strategy Pattern for chunkers)
• Separation of concerns: data preparation vs. model training vs. I/O
• Config-driven behavior for maximum flexibility
• Parallelism in QA generation (rate-limiting & worker pool)
d. Key Technologies & Frameworks:
• Python packaging (setup.py)
• Sentence-Transformers, PyTorch (model training)
• LiteLLM (LLM/embedding abstraction)
• Hugging Face Hub SDK
• Standard CLI entrypoint with argparse or equivalent in main.py