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.1.tar.gz (3.1 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.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file edgegemma_8gb-0.1.1.tar.gz.

File metadata

  • Download URL: edgegemma_8gb-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 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.1.tar.gz
Algorithm Hash digest
SHA256 b2b70cab2f8a465b4c6b414e9fa8f0c261244c5bf56c197ba31d478b7c2ef332
MD5 640bb871cac38143d936189b52b11a9b
BLAKE2b-256 8048b13c26461f8d0508e73d0b2dafcee2426a4ca98583c60299cfcca37f8602

See more details on using hashes here.

File details

Details for the file edgegemma_8gb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: edgegemma_8gb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13d8b89818a7394f40b37fed9dcb96260a603904c46664d910defccee6f04b09
MD5 26a09da1025835d2f8df163524342afc
BLAKE2b-256 1b9492a223617c05e27550d5d96cb71869cff467a31f90892ff03c7b336c0347

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