Skip to main content

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 bitsandbytes to 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=0 with gradient tracking disabled (torch.no_grad()) to ensure absolute consistency and speed during zero-shot and few-shot classification benchmarking.

Setup

  1. Clone the repository.
  2. Install dependencies: pip install -r requirements.txt
  3. Run the evaluation pipeline via notebooks/Task1_Prompting.ipynb. Data caching and API inference are handled entirely locally.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edgegemma_8gb-0.1.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgegemma_8gb-0.1.0-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

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

Hashes for edgegemma_8gb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5d7e53b3c162efc40ee23e5ef54c2a3bf6d5f3f1ff747ff025aee2d8fab00b0
MD5 df6f05b80c2f93c7d4e0c44dac4ed19e
BLAKE2b-256 a4cee8bb25d276538d54ee627e09182c7613a202f471a6b79905998ff593f6e3

See more details on using hashes here.

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

Hashes for edgegemma_8gb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2b82343e49bd9c0d3a596c3057154e47104ca9f7845ca7a93b46f3e9edaa55a
MD5 a8362d0eb67a8c0e51ea937f802eb141
BLAKE2b-256 80f7e30a515776fa36eeb80a404bc2c1a60c2d6dd9cddd677b5abb678f3181c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page