A comprehensive collection of Jupyter notebooks and basic utilities for running large language models (LLMs) and diffusion models efficiently on local hardware. This project provides practical recipes and best practices for developers and researchers who want to harness the power of generative AI without relying on cloud services.
- GPU Evaluation: Tools to assess your hardware capabilities
- Text Generation: Comprehensive examples using Hugging Face models
- Chat Interfaces: Build conversational AI systems locally
- Model Quantization: Optimize models for resource-constrained environments
- Image Generation: Stable Diffusion and Flux model implementations
- LoRA Fine-tuning: Advanced model customization techniques
- Text-to-Video: Cutting-edge video generation capabilities
- Utilities: Helper functions for model management and evaluation
-
Clone the repository
git clone https://github.com/your-username/gen-ai-local-recipes.git cd gen-ai-local-recipes -
Set up the environment
# Create virtual environment uv venv --seed # Activate environment (Windows) .venv\Scripts\activate # Activate environment (Linux/macOS) source .venv/bin/activate # Install dependencies uv sync
-
Launch Jupyter Lab (optional: Jupyter is also supported by some IDEs)
jupyter lab
-
Start with the setup notebook Open
notebooks/01 - Environment Setup.ipynbto install initial dependencies and authenticate with Hugging Face.
The project includes hands-on tutorials covering various aspects of local AI deployment:
| Notebook | Description | Difficulty |
|---|---|---|
01 - Environment Setup.ipynb |
Initial setup and Hugging Face authentication | Beginner |
02 - GPU Evaluation.ipynb |
Hardware assessment and memory profiling | Beginner |
03 - Text Generation - HF.ipynb |
Text generation with Hugging Face models | Intermediate |
04 - Chat - HF.ipynb |
Building chat interfaces with local models | Intermediate |
05 - Quantization - HF.ipynb |
Model optimization and quantization techniques | Advanced |
08.1 - Diffusion Models - sd.ipynb |
Stable Diffusion image generation | Intermediate |
08.2 - Diffusion Models - flux.ipynb |
Flux model implementations | Advanced |
09 - Diffusion with LoRA.ipynb |
Custom model training with LoRA | Advanced |
10 - Text2Video Diffusion.ipynb |
Video generation from text prompts | Advanced |
gen-ai-local-recipes/
├── notebooks/ # Jupyter notebooks with tutorials
├── src/ # Source code and utilities
│ ├── __init__.py
│ └── utils.py # Helper functions for model management
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Dependency lock file
├── LICENSE # Apache License 2.0
└── README.md # This file
- GPU: NVIDIA RTX 3080/4080 or better (12GB+ VRAM)
Use the Hugging Face Model Size Estimator to determine VRAM requirements for different models and quantization levels.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Hugging Face for their excellent model hub and libraries
Made with ❤️ for the local AI community