Skip to content

Commit fa970bc

Browse files
Merge pull request #121 from drunkenbot-ai/develop
fix licencsing issue, add doc
2 parents 77920d7 + 784bb76 commit fa970bc

48 files changed

Lines changed: 2810 additions & 203 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- '.github/workflows/docs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install documentation dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install mkdocs-material
34+
35+
- name: Configure Git credentials
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
40+
- name: Build and deploy to GitHub Pages
41+
run: mkdocs gh-deploy --force

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ __pycache__/
99
# Distribution / packaging
1010
.Python
1111
build/
12+
site/
1213
develop-eggs/
1314
dist/
1415
downloads/

How to Train your LLM.md

Lines changed: 323 additions & 0 deletions
Large diffs are not rendered by default.

HowToCreateYourLLM.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# How To Create Your LLM
22

3+
> 📘 **Note**: For the comprehensive, newly updated step-by-step guide with new UI screenshots and detailed workflows, please see **[How to Train your LLM.md](How%20to%20Train%20your%20LLM.md)**.
4+
35
## Introduction
46

57
DrunkenBot LLM-IDE is a desktop workflow for building a small local language

README.md

Lines changed: 222 additions & 180 deletions
Large diffs are not rendered by default.

Technical_Documentation.md

Lines changed: 444 additions & 0 deletions
Large diffs are not rendered by default.

docs/how_to_train_your_llm.md

Lines changed: 323 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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`). |

docs/ref/01.png

110 KB
Loading

docs/ref/01_dataset_blueprint.png

61.4 KB
Loading

0 commit comments

Comments
 (0)