A 4-bit quantized local inference wrapper for Gemma-2B optimized for 8GB VRAM.
Project description
EdgeGemma-8GB: Local LLM Inference & Evaluation Pipeline
An automated testing pipeline engineered to evaluate the classification capabilities of open-source Large Language Models running entirely locally within highly constrained hardware environments (8GB VRAM).
Overview
Deploying AI in edge computing environments requires bypassing external cloud APIs due to latency, privacy, or network connectivity constraints. This project demonstrates a robust pipeline for loading, quantizing, and evaluating google/gemma-2b-it on consumer-grade hardware.
Architecture & Optimizations
- Memory Management: Utilizes NF4 (4-bit) quantization via
bitsandbytesto aggressively compress the model weights, allowing a 2B parameter model to run comfortably inside 8GB of VRAM alongside the OS overhead. - Singleton Inference Engine: The LLM loader is modularized to prevent double-allocation in Jupyter environments, protecting against GPU out-of-memory (OOM) crashes.
- Deterministic Evaluation: Inference is locked to
temperature=0with gradient tracking disabled (torch.no_grad()) to ensure absolute consistency and speed during zero-shot and few-shot classification benchmarking.
Setup
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt - Run the evaluation pipeline via
notebooks/Task1_Prompting.ipynb. Data caching and API inference are handled entirely locally.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edgegemma_8gb-0.1.0.tar.gz.
File metadata
- Download URL: edgegemma_8gb-0.1.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d7e53b3c162efc40ee23e5ef54c2a3bf6d5f3f1ff747ff025aee2d8fab00b0
|
|
| MD5 |
df6f05b80c2f93c7d4e0c44dac4ed19e
|
|
| BLAKE2b-256 |
a4cee8bb25d276538d54ee627e09182c7613a202f471a6b79905998ff593f6e3
|
File details
Details for the file edgegemma_8gb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: edgegemma_8gb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b82343e49bd9c0d3a596c3057154e47104ca9f7845ca7a93b46f3e9edaa55a
|
|
| MD5 |
a8362d0eb67a8c0e51ea937f802eb141
|
|
| BLAKE2b-256 |
80f7e30a515776fa36eeb80a404bc2c1a60c2d6dd9cddd677b5abb678f3181c8
|