OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Gemma3Moe Builder

Gemma3Moe Builder is a Python toolkit that sparse-upcycles dense Gemma-3-270m checkpoints into routed mixture-of-experts models, supports training and routing inspection, and provides a llama.cpp CPU-serving path using GGUF.

Independent OpenViST project profile, based on linked sources.

Gemma3Moe Builder — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when building a routed MoE variant from Gemma-3-270m and you need a documented path from checkpoint conversion through optional training and routing analysis to llama.cpp CPU serving.

Who it is for

  • Researchers and developers experimenting with sparse-upcycled Gemma models.
  • Model builders who want to train or fine-tune routed experts and inspect their routing behavior.
  • Teams preparing a converted model for local CPU inference through llama.cpp.

Documented uses

  • Convert a dense Gemma-3-270m checkpoint into a model with a router and configurable expert count and top-k selection.
  • Initialize experts from one checkpoint or from different Gemma-3-270m variants.
  • Continue-train or fine-tune the resulting MoE with Transformers Trainer.
  • Inspect load balance, dead experts, routing entropy and task specialization.
  • Convert and quantize a model for llama.cpp CPU inference.
Before you choose

Requirements & limits

The repository documents local installation as a Python package and requires Python 3.10 or later. Training and routing tools require the optional `datasets` dependency.

  • The supported base family documented here is Gemma-3-270m; both full-vocabulary and trimmed checkpoints are accepted.
  • Expert count and top-k determine the active expert path; the project describes CPU latency and memory as scaling with active rather than total parameters.
  • Vocabulary trimming is optional and requires a separate trimmer plus an extra converter patch for the llama.cpp path.
  • CPU serving requires work in a fresh llama.cpp checkout: patch, build, convert to GGUF and quantize.
  • The repository describes a published 16-expert, top-4 full-vocabulary starter checkpoint as untrained and intended for further training or fine-tuning.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Convert a Gemma-3-270m checkpoint into an MoE

Create a copy-initialized routed MoE checkpoint from a Gemma-3-270m source.

Before you start

  • Python 3.10 or later.
  • A Gemma-3-270m checkpoint accessible as the source.
  • The gemma3moe-builder repository and its Python package installed.

Steps

  1. Install the package from the repository with the command below.

    Documented command
    pip install -e .
  2. Run the command below.

    Documented command
    python -m gemma3moe.upcycle --src google/gemma-3-270m --out ./my-moe --num-experts 8 --top-k 2

Expected outcome

A converted MoE checkpoint is written to `./my-moe` with eight experts and top-2 routing.

Guide limitations

  • This covers conversion only, not training or CPU serving.
  • The repository documents a separate correctness-check command, but this recipe does not run it.
Source-based practical guide

Prepare the training and routing-inspection stage

Install the optional training dependency and use the documented commands to train and inspect a converted checkpoint.

Before you start

  • Python 3.10 or later.
  • An initial MoE checkpoint.
  • Training data in JSONL files and validation data in JSONL format.
  • A prompts file for the routing-diversity inspection.

Steps

  1. Install the package with training dependencies using the command below.

    Documented command
    pip install -e .[train]
  2. Run the documented training command with the checkpoint, train and validation files, and output path.

  3. Run the command below on the resulting checkpoint and validation file.

    Documented command
    python -m gemma3moe.eval.router_health
  4. Run the command below with the checkpoint and prompts file.

    Documented command
    python -m gemma3moe.eval.router_diversity

Expected outcome

The training command writes a fine-tuned checkpoint; the inspection commands report routing health and diversity measures.

Guide limitations

  • The README’s example uses three epochs and an auxiliary coefficient of 0.003; those are example arguments, not stated requirements.
  • This recipe does not cover llama.cpp conversion or serving.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
tardellirs/gemma3moe-builder · Official homepage title · retained in its source language