|
| 1 | +# DrunkenBot LLM-IDE Documentation |
| 2 | + |
| 3 | +Welcome to the official documentation portal for **DrunkenBot LLM-IDE**—the desktop foundry for creating, training, fine-tuning, and deploying custom generative language models entirely on local hardware. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <img src="ref/03_model_training.png" width="49%" alt="Neural Forge - Model Architecture & Training" /> |
| 9 | + <img src="ref/04_fine_tuning.png" width="49%" alt="Fine-Tuning Lab - LoRA & PEFT" /> |
| 10 | +</p> |
| 11 | +<p align="center"> |
| 12 | + <img src="ref/01_dataset_blueprint.png" width="49%" alt="Dataset Blueprint & Ingestion" /> |
| 13 | + <img src="ref/09_chat_interface.png" width="49%" alt="Interactive Streamed Chat with Reasoning Controls" /> |
| 14 | +</p> |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 📚 Documentation Guides |
| 19 | + |
| 20 | +Explore the comprehensive guides tailored to your workflow: |
| 21 | + |
| 22 | +<div class="grid cards" markdown> |
| 23 | + |
| 24 | +- :material-school:{ .lg .middle } **[How to Train Your LLM](how_to_train_your_llm.md)** |
| 25 | + |
| 26 | + --- |
| 27 | + |
| 28 | + A step-by-step practical handbook for developers and researchers building custom models: |
| 29 | + - Understanding tokens, context windows, and loss dynamics |
| 30 | + - Gathering and preparing pretraining and fine-tuning datasets |
| 31 | + - Pretraining base models from scratch across hardware presets |
| 32 | + - Fine-tuning with LoRA (Instruction, Code, Conversation, Tool-Calling) |
| 33 | + - Benchmarking, GGUF quantization, and local chat deployment |
| 34 | + |
| 35 | +- :material-cogs:{ .lg .middle } **[Technical Documentation](technical_documentation.md)** |
| 36 | + |
| 37 | + --- |
| 38 | + |
| 39 | + In-depth architectural and algorithmic specification: |
| 40 | + - Decoupled `engine/` computational core vs. PySide6 desktop layer |
| 41 | + - Tokenization & prompt loss masking (`IGNORE_INDEX = -100`) algorithms |
| 42 | + - Neural architecture (RoPE, GQA/MQA, RMSNorm, SwiGLU, SDPA) |
| 43 | + - Detached background process supervision and SQLite telemetry |
| 44 | + - Machine-bound two-layer encrypted licensing (DPAPI + Fernet) |
| 45 | + - Export and quantization pipelines (GGUF, SafeTensors, HuggingFace) |
| 46 | + |
| 47 | +</div> |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 🚀 Quickstart Overview |
| 52 | + |
| 53 | +### 1. Installation |
| 54 | +Clone the repository and install the runtime dependencies in a virtual environment: |
| 55 | + |
| 56 | +```bash |
| 57 | +git clone https://github.com/drunkenbot-ai/LLM-IDE.git |
| 58 | +cd LLM-IDE |
| 59 | + |
| 60 | +# Create virtual environment |
| 61 | +python -m venv .venv |
| 62 | +source .venv/bin/activate # On Windows: .\.venv\Scripts\Activate.ps1 |
| 63 | + |
| 64 | +# Install requirements |
| 65 | +pip install -r requirements.txt |
| 66 | +``` |
| 67 | + |
| 68 | +### 2. Launching the IDE |
| 69 | +```bash |
| 70 | +python run_app.py |
| 71 | +``` |
| 72 | + |
| 73 | +### 3. Headless CLI Engine |
| 74 | +For headless servers or automated CI/CD pipelines, use the pure Python CLI: |
| 75 | + |
| 76 | +```bash |
| 77 | +# Ingest and prepare data with prompt loss masking |
| 78 | +python -m engine.cli prepare --input_dir ./data --output_dir ./runs/data --context_length 512 |
| 79 | + |
| 80 | +# Launch pretraining headless |
| 81 | +python -m engine.cli train --data_dir ./runs/data --output_dir ./runs/model --epochs 3 --batch_size 16 |
| 82 | +``` |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## 🏗️ Core Feature Matrix |
| 87 | + |
| 88 | +| Feature Area | Key Capabilities | |
| 89 | +| :--- | :--- | |
| 90 | +| **Data Ingestion** | Ingest `.txt`, `.md`, `.pdf`, and `.jsonl`; syntax-preserving `clean_code` indentation pipeline; adaptive repetition/diversity filtering (`MAX_REPETITIVE_UNIT_RATIO = 0.80`, `MIN_UNIQUE_UNITS = 100`). | |
| 91 | +| **Tokenization & Masking** | BPE tokenizer training; binary NumPy memory maps (`train_tokens.npy`, `train_targets.npy`); automated prompt loss masking (`IGNORE_INDEX = -100`) for instruction and dialogue alignment. | |
| 92 | +| **Neural Forge** | Modern LLaMA-style blocks; Rotary Position Embeddings (RoPE); Multi-Head (MHA), Grouped-Query (GQA), and Multi-Query (MQA) attention; PyTorch SDPA / FlashAttention; RMSNorm; SwiGLU activations. | |
| 93 | +| **Fine-Tuning Lab** | Multi-stage adaptation (Instruction, Conversation, Code, Tool-Call); Parameter-Efficient Fine-Tuning (LoRA) with customizable rank, alpha, and Attention + MLP projection targeting. | |
| 94 | +| **Execution & Telemetry** | Hardware-adaptive VRAM batch scaling; detached background worker process (GUI closure does not stop training); batched SQLite telemetry (`runs/telemetry.db`) with smooth 30fps real-time loss tracking. | |
| 95 | +| **Export Bay** | Export to HuggingFace Transformers format (`model.safetensors`, `config.json`), FP16 quantized checkpoints, and compiled GGUF binaries (`Q4_K_M`, `Q8_0`, `f16`) for `llama.cpp`. | |
| 96 | +| **Chat Studio** | Embedded local GGUF inference via `llama-cpp-python`; streamed Markdown rendering with code highlighting; customizable temperature, top-p, and reasoning/thinking effort controls. | |
| 97 | +| **Licensing** | Local-first launch validation in ~1ms; machine-bound two-layer encryption (PBKDF2-HMAC-SHA256 Fernet + Windows DPAPI `CryptProtectData`). | |
0 commit comments