# How to Configure ODS to Use Google Gemma 4 Models: A Complete Guide

> Learn how to configure Osmantic ODS to use Google Gemma 4 models by setting the MODEL_PROFILE environment variable. Follow this guide for a seamless setup.

- Repository: [Osmantic/ODS](https://github.com/Osmantic/ODS)
- Tags: how-to-guide
- Published: 2026-08-30

---

**Set the `MODEL_PROFILE` environment variable to `gemma4` before running the installer to configure Osmantic ODS (Open-Source AI Stack) to use Google Gemma 4 models instead of the default Qwen family.**

ODS is an open-source AI stack that automatically selects optimized local LLMs based on your hardware capabilities. When you configure ODS to use Google Gemma 4 models, the installer downloads quantized GGUF variants specifically tuned for your GPU tier, from the lightweight E2B IT model for entry-level cards to the full 31B parameter model for enterprise hardware.

## Understanding ODS Model Selection Architecture

ODS determines which Gemma 4 variant to install using two core mechanisms defined in [`ods/installers/lib/tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/ods/installers/lib/tier-map.sh): hardware tier detection and model profile resolution.

### The Hardware Tier Detection System

The [`ods/scripts/detect-hardware.sh`](https://github.com/Osmantic/ODS/blob/main/ods/scripts/detect-hardware.sh) script analyzes your GPU and CPU to assign a numeric **hardware tier** (1-4) or named tier (e.g., `NV_ULTRA`, `SH_LARGE`). This value is stored in the `TIER` environment variable and determines the specific Gemma 4 model variant your system can efficiently run.

### The Model Profile System

The **model profile** is a logical name that tells ODS which model family to deploy. According to the `normalize_model_profile()` function in [`tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/tier-map.sh), ODS accepts `gemma4`, `gemma`, or `gemma-4` as valid identifiers, normalizing them all to the canonical `gemma4` string. The `effective_model_profile()` function then determines the final profile, defaulting to `gemma4` for all non-cloud tiers when `MODEL_PROFILE` is set to `auto`.

## Step-by-Step Configuration for Gemma 4

### Export the Model Profile Environment Variable

Before invoking the installer, export `MODEL_PROFILE` to target the Gemma 4 family. This variable is read during the `01-preflight` phase of installation.

```bash
export MODEL_PROFILE=gemma4

```

Valid values include `gemma4`, `gemma`, or `gemma-4`—all are normalized to the same internal profile by `normalize_model_profile()` in [`ods/installers/lib/tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/ods/installers/lib/tier-map.sh).

### Override Hardware Tier Detection (Optional)

To force a specific Gemma 4 variant rather than accepting the auto-detected tier, set `ODS_TIER`:

```bash
export ODS_TIER=2

```

If omitted, [`ods/scripts/detect-hardware.sh`](https://github.com/Osmantic/ODS/blob/main/ods/scripts/detect-hardware.sh) populates `TIER` based on detected hardware (e.g., an NVIDIA RTX 4090 maps to tier 4, an Intel Arc A770 maps to tier `ARC`).

### Run the Installer and Verify Selection

Execute the top-level installer entry point:

```bash
./ods/install-core.sh

```

During the preflight phase, the `resolve_tier_config()` function checks the effective profile. When it resolves to `gemma4`, it calls `set_gemma4_tier_config()` to assign the appropriate model. The installer logs the selection:

```

→ resolve_tier_config: MODEL_PROFILE_EFFECTIVE=gemma4
→ set_gemma4_tier_config: TIER=2 → LLM_MODEL=gemma-4-e4b-it

```

Post-installation, verify the selection by checking the environment variables written by the installer:

```bash
echo "$LLM_MODEL $GGUF_FILE"

# Output: gemma-4-e4b-it gemma-4-E4B-it-Q4_K_M.gguf

```

## How Tier Mapping Assigns Gemma 4 Models

The `set_gemma4_tier_config()` function in [`tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/tier-map.sh) uses a `case $TIER` block to map hardware tiers to specific Google Gemma 4 quantized models hosted on Hugging Face:

- **Tier 1 (Entry Level)**: `gemma-4-e2b-it` with `gemma-4-E2B-it-Q4_K_M.gguf`
- **Tier 2 (Prosumer)**: `gemma-4-e4b-it` with `gemma-4-E4B-it-Q4_K_M.gguf`
- **Tier 3 (Pro)**: `gemma-4-26b-a4b-it` with `gemma-4-26B-A4B-it-Q4_K_M.gguf`
- **Tier 4 (Enterprise)**: `gemma-4-31b-it` with `gemma-4-31B-it-Q4_K_M.gguf`

Each tier receives a context window and download URL appropriate for the hardware capabilities detected or specified.

## Validating Your Gemma 4 Configuration

You can preview the model selection without running the full installer by using the catalog selector CLI:

```bash
python ods/scripts/select-model.py \
  --catalog ods/config/model-library.json \
  --profile gemma4 \
  --tier 2 \
  --backend nvidia \
  --vram-mb $((24*1024)) \
  --ram-gb 64

```

This command mirrors the installer's logic and outputs a JSON payload confirming the selected Gemma 4 model, GGUF filename, and download URL. The test suite in [`ods/tests/test-tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/ods/tests/test-tier-map.sh) (lines 194-197) validates this behavior by asserting that `LLM_MODEL` equals `gemma-4-e4b-it` when `MODEL_PROFILE=gemma4` and `TIER=2`.

## Platform-Specific Configuration Notes

### Linux and macOS

On Unix-like systems, set environment variables using `export` before executing [`install-core.sh`](https://github.com/Osmantic/ODS/blob/main/install-core.sh). The test file [`ods/tests/test-tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/ods/tests/test-tier-map.sh) validates the Bash implementation of `set_gemma4_tier_config()`, confirming correct variable assignment for tiers 1 through 4.

### Windows PowerShell

For Windows deployments, use the `$env:` syntax:

```powershell
$env:MODEL_PROFILE = "gemma4"
$env:ODS_TIER = "1"
.\ods\install-core.ps1
Write-Host "Selected model: $env:LLM_MODEL"

# Output: Selected model: gemma-4-e2b-it

```

The `ods/tests/test-windows-model-activation.ps1` script validates this flow using `ConvertTo-ModelFromTier -Tier "T1" -ModelProfile "gemma4"` and asserts that the resulting `LLM_MODEL` matches the expected Gemma 4 variant.

## Summary

- **Set `MODEL_PROFILE=gemma4`** (or `gemma`, `gemma-4`) before installation to switch from the default Qwen family to Google Gemma 4 models.
- **Hardware tiers 1-4** map to specific Gemma 4 variants (E2B, E4B, 26B A4B, and 31B) via `set_gemma4_tier_config()` in [`tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/tier-map.sh).
- **Override auto-detection** by setting `ODS_TIER` if you need to force a specific model variant.
- **Validate selections** using [`ods/scripts/select-model.py`](https://github.com/Osmantic/ODS/blob/main/ods/scripts/select-model.py) or by inspecting the `LLM_MODEL` and `GGUF_FILE` environment variables post-installation.
- **Cross-platform support** is verified by test suites for both Bash ([`test-tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/test-tier-map.sh)) and PowerShell (`test-windows-model-activation.ps1`) environments.

## Frequently Asked Questions

### What happens if I leave MODEL_PROFILE unset or set it to "auto"?

When `MODEL_PROFILE` is unset or set to `auto`, the `effective_model_profile()` function in [`ods/installers/lib/tier-map.sh`](https://github.com/Osmantic/ODS/blob/main/ods/installers/lib/tier-map.sh) defaults to `gemma4` for any non-cloud tier (lines 30-34). This means ODS will automatically configure Gemma 4 models for local hardware installations without requiring explicit configuration, while cloud tiers may use different defaults.

### Can I force a specific Gemma 4 model variant regardless of my hardware?

Yes. While ODS auto-detects your hardware tier in [`ods/scripts/detect-hardware.sh`](https://github.com/Osmantic/ODS/blob/main/ods/scripts/detect-hardware.sh), you can override this by exporting `ODS_TIER` with your desired tier number (1-4) before running [`install-core.sh`](https://github.com/Osmantic/ODS/blob/main/install-core.sh). This forces `set_gemma4_tier_config()` to select the corresponding model variant, though running a tier 4 model on tier 1 hardware will result in poor performance or failure.

### How do I verify the integrity of the downloaded Gemma 4 GGUF files?

ODS includes [`ods/tests/test-gemma4-artifact-pins.py`](https://github.com/Osmantic/ODS/blob/main/ods/tests/test-gemma4-artifact-pins.py), which validates the SHA-256 hashes and download URLs for all Gemma 4 model variants. You can run this test to confirm that your downloaded `gemma-4-*.gguf` files match the official Hugging Face repository checksums and have not been corrupted during transfer.

### Does ODS support Gemma 4 on Apple Silicon or AMD GPUs?

The [`ods/scripts/select-model.py`](https://github.com/Osmantic/ODS/blob/main/ods/scripts/select-model.py) script accepts a `--backend` flag (e.g., `nvidia`, `amd`, `apple`) and `--host-arch` flag (e.g., `arm64`, `x86_64`) to filter the model catalog. While the tier map primarily targets NVIDIA CUDA tiers, you can use the selector CLI with `--backend apple` and `--profile gemma4` to check for compatible Metal-optimized Gemma 4 variants in the [`ods/config/model-library.json`](https://github.com/Osmantic/ODS/blob/main/ods/config/model-library.json) catalog.