Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions models/gemma3n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Gemma 3n

Google's Gemma 3n for on-device inference via Core AI.

## Supported Models

| Model | Parameters | Context | macOS | iOS |
| --------------- | ------------------- | ------- | ----- | --- |
| gemma-3n-E2B-it | ~5B (E2B effective) | 32768 | Yes | No |

## Export

```bash
uv run coreai.llm.export google/gemma-3n-E2B-it
```

## Run
Comment thread
stikves marked this conversation as resolved.

```bash
swift run -c release llm-runner --model path/to/exported_model --prompt "Hello"
```

## Benchmark

```bash
swift run -c release llm-benchmark --model path/to/exported_model -p 512 -g 1024 -n 5
```

## Evaluation

Perplexity on WikiText-2 and accuracy on tinyMMLU, computed with the Core AI PyTorch models (4K context).

| Compression | Wikitext PPL | tinyMMLU acc |
| ---------------- | ------------ | ------------ |
| none (float16) | 61.53 | 58.75% |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's align this table with other models (I don't think we include tinyMMLU numbers for others).

Table columns/names also needs to be aligned

| 4-bit quantized | 72.13 | 59.27% |

High wikitext PPL is expected for instruction-tuned models — the probability distribution is optimized for dialogue, not raw text. tinyMMLU accuracy is the appropriate quality metric.
9 changes: 9 additions & 0 deletions python/src/coreai_models/export/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ class AIModelMetadataFields:
"Source: https://huggingface.co/google/gemma-3-12b-it"
),
),
"google/gemma-3n-E2B-it": AIModelMetadataFields(
author="Gemma Team",
license="Gemma Terms of Use",
model_description=(
"Gemma 3n E2B is a ~5B-parameter on-device language model from Google's "
"Gemma 3n family using AltUp for efficient inference. "
"Source: https://huggingface.co/google/gemma-3n-E2B-it"
),
),
"mistralai/Mistral-7B-Instruct-v0.3": AIModelMetadataFields(
author="Mistral AI",
license="Apache-2.0",
Expand Down
10 changes: 10 additions & 0 deletions python/src/coreai_models/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ class UtilityModel:
"float16",
131072,
),
ModelPreset(
Comment thread
stikves marked this conversation as resolved.
"gemma-3n-e2b-it",
"google/gemma-3n-E2B-it",
"gemma3n",
"llm",
"macOS",
"4bit",
"float16",
32768,
),
# --- iOS (compression = palettized) ---
ModelPreset(
"qwen3-0.6b",
Expand Down
Loading