# Bitcoin AI Assistant

The ultimate small form factor Bitcoin AI assistant, designed to run on Intel NUC hardware.

## Overview

A specialized AI assistant trained on comprehensive Bitcoin documentation, including:
- All BIPs (Bitcoin Improvement Proposals)
- Lightning Network protocol specifications (BOLTs)
- LND (Lightning Network Daemon) documentation
- CLN (Core Lightning) documentation
- Bitcoin Core documentation
- Mining guides and technical documentation
- Wallet security best practices
- Bitcoin scripting and protocol details

## System Requirements

**Training Machine:**
- CPU: Ryzen 9 9900X (12C/24T)
- RAM: 60GB
- Storage: 500GB+ free space

**Deployment (NUC):**
- CPU: Intel i5-7260U
- RAM: 31GB
- Storage: 50GB+ free space
- Network: Public IPv4/IPv6 + Tailscale

## Quick Start

1. **Collect Documentation**
```bash
cd data
python3 bitcoin_doc_collector.py
```

2. **Process for Training**
```bash
cd data
python3 process_for_training.py
```

3. **Fine-Tune Model**
```bash
cd training
python3 finetune_cpu.py
```

4. **Deploy to NUC**
```bash
cd nuc_deployment
bash deploy_nuc.sh
```

## Architecture

- **Base Model:** Qwen2.5-7B-Instruct
- **Fine-Tuning:** QLoRA with 4-bit quantization
- **Inference:** llama.cpp with GGUF format
- **Interface:** Flask web server with REST API

## API Endpoints

- `GET /health` - Health check
- `POST /chat` - Bitcoin operations chat
- `POST /complete` - Raw text completion

## Development Status

- [x] Data collection pipeline
- [x] Training script
- [x] NUC deployment setup
- [ ] Model conversion utilities
- [ ] Web interface frontend
- [ ] Production testing

## License

MIT
