--- license: mit --- # 🏗️ A1–A5 Upfront Embodied Carbon Calculator (Local LLM) ## Overview This repository contains a lightweight, deterministic calculator for estimating **A1–A5 upfront embodied carbon** in building materials and construction processes. It was designed as part of a sustainability engineering project to make carbon assessments more **transparent, modular, and interactive**. The tool includes: - **Rule-based carbon computation** following EN15978 and RICS conventions. - **Local LLM integration (`google/flan-t5-base`)** for generating carbon-reduction suggestions. - A **Gradio GUI** interface that allows users to input materials, quantities, and emission factors, and instantly view results and insights. --- ## ⚙️ Features - Input: A1–A5 modules, materials, quantities, units, emission factors, notes. - Output: Per-row and per-module emissions (kgCO₂e, tCO₂e) + total embodied carbon. - Integrated suggestion engine: - **Rule-based** heuristics for reduction strategies. - **LLM-generated** design insights using a small local model (no external API). - Built with strict **unit validation** to prevent inconsistent calculations. --- ## 🧠 Technical Notes This calculator runs **entirely offline** using Hugging Face’s `google/flan-t5-base` model for text generation. It does not require API keys and can run on CPU (no GPU necessary). > 💡 The local LLM is not used to compute carbon, only to suggest design improvements. --- ## 🧩 How to Run ```bash pip install -r requirements.txt python app.py