How jddd-hy/jlm works
JLM is a local, style-tuned conversational model. Its main user workflow accepts a chat turn, generates multiple replies, judges and ranks them, then returns a selectable response while maintaining session history; GPU and CPU/llama.cpp backends are documented. Its model-building workflow collects and curates attributed quotes, prepares leakage-aware dialogue/training data, trains a QLoRA adapter, and evaluates generations. The README documents review and offline packaging capabilities; only relationships supported by excerpts or README statements are connected, so unsampled links are omitted.
Main entry points: train.py QLoRA training · chat.py Candidate generation and judging · clean.py Text cleaning · evaluate.py Model evaluation
Components 22
Collection and curation
- Quote collection
src/collection/collectors.py - Source parsing
src/collection/parsers.py - Collection review
scripts/build_collection_review.py
Data and training
- Record validation
src/data/validate.py - Text cleaning
src/data/clean.py - Deduplication
src/data/deduplicate.py - Leakage-aware splits
src/data/prepare.py - Training data gate
src/training/data_gate.py - QLoRA training
src/training/train.py
Chat and inference
- GPU chat engine
src/app/engine.py - Candidate generation and judging
scripts/chat.py - Model generation
src/inference/generate.py - Candidate judge
src/inference/judge.py - Reply selection
src/inference/selection.py - Terminal chat
src/app/tui.py - CPU llama.cpp backend
src/app/llama_engine.py
Evaluation
- Model evaluation
src/evaluation/evaluate.py - Novelty metrics
src/evaluation/novelty.py - Evaluation reports
src/evaluation/report.py
Other components
- Chat user
- Qwen base model
- llama-server
Connections 24
- Chat user → Terminal chat: sends turns
- Terminal chat → GPU chat engine: routes chat
src/app/tui.py - GPU chat engine → Candidate generation and judging: requests replies
src/app/engine.py - Candidate generation and judging → Model generation: generates candidates
scripts/chat.py - Candidate generation and judging → Candidate judge: judges candidates
scripts/chat.py - Candidate generation and judging → Reply selection: ranks replies
scripts/chat.py - GPU chat engine → Qwen base model: loads adapted model
src/app/engine.py - Terminal chat → CPU llama.cpp backend: uses CPU backend
src/app/llama_engine.py - CPU llama.cpp backend → llama-server: starts server
src/app/llama_engine.py - CPU llama.cpp backend → Reply selection: ranks replies
src/app/llama_engine.py - Quote collection → Source parsing: parses sources
- Source parsing → Text cleaning: normalizes text
src/collection/parsers.py - Collection review → Record validation: validates records
scripts/build_collection_review.py - Record validation → Text cleaning: normalizes records
src/data/validate.py - Deduplication → Text cleaning: canonicalizes text
src/data/deduplicate.py - Leakage-aware splits → Deduplication: finds duplicates
src/data/prepare.py - QLoRA training → Leakage-aware splits: prepares splits
src/training/train.py - QLoRA training → Training data gate: checks inputs
src/training/train.py - QLoRA training → Qwen base model: adapts base model
src/training/train.py - QLoRA training → Model generation: saves adapter for inference
- Model evaluation → Model generation: samples generations
src/evaluation/evaluate.py - Model evaluation → Novelty metrics: measures novelty
src/evaluation/evaluate.py - Novelty metrics → Text cleaning: canonicalizes quotes
src/evaluation/novelty.py - Model evaluation → Evaluation reports: renders report