gemma-dev
Trigger this skill when building applications with Gemma or for general knowledge inquiries related to Gemma models (e.g. prompt structure, capabilities)…
by skillmds★ 42 GitHub stars
Install gemma-dev in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Gemma Development Skill
1. Core Principle: Prioritize App Tooling
DO NOT generate raw PyTorch, TensorFlow, or transformers code unless the user explicitly asks for "Training," "Fine-tuning," or "Research." Always default to high-level frameworks, SDKs, and tooling optimized for application development.
2. Model Selection Guide
CRITICAL: Do not blindly default to gemma-3-1b-it. You must analyze the user's specific domain, technical constraints, and required input modalities to recommend the exact right fit. When recommending standard models, strictly default to the Gemma 4 generation. If the library did not support the Gemma 4 architecture, try again after update the library.
Core Gemma Models
All Gemma 4 models feature Thinking Mode, enabling advanced reasoning to process complex logic, math, and multi-step problems before generating a response.
- Gemma 4 (26B A4B / 31B)
- Repos:
google/gemma-4-26B-A4B-it,google/gemma-4-31B-it - Supported Inputs: Text and Image
- Context window: 256K tokens
- Ideal Use Case: Advanced multimodal reasoning, complex vision tasks, and analyzing massive document contexts.
- Note: The 26B A4B utilizes a highly efficient Mixture-of-Experts for fast, heavy-weight reasoning, alongside the dense 31B variant.
- Repos:
- Gemma 4 (12B)
- Repos:
google/gemma-4-12B-it - Supported Inputs: Text, Image, Audio
- Context window: 256K tokens
- Ideal Use Case: Multimodal reasoning (including audio), inference in laptops, and consumer devices.
- Repos:
- Gemma 4 (E2B / E4B)
- Repos:
google/gemma-4-E2B-it,google/gemma-4-E4B-it - Supported Inputs: Text, Image, Audio
- Context window: 128K tokens
- Ideal Use Case: Mobile NPU acceleration; on-device workflows explicitly requiring native audio processing alongside robust reasoning.
- Repos:
Legacy & Lightweight Models (Gemma 3)
- Gemma 3 (4B / 12B / 27B)
- Repos:
google/gemma-3-4b-it,google/gemma-3-12b-it,google/gemma-3-27b-it - Supports Text and Image inputs with a 128K context window. Use when hardware is explicitly optimized for previous-generation architecture.
- Repos:
- Gemma 3 (270M / 1B)
- Repos:
google/gemma-3-270m-it,google/gemma-3-1b-it - Supports Text-only inputs with a 32K context window. Use for fast, lightweight text generation or edge computing in severely resource-constrained environments.
- Repos:
Task-Specific Variants
Route users to purpose-built variants rather than forcing a standard model to perform highly specialized workflows.
- RAG / Vector Search: Use EmbeddingGemma
- Repo:
google/embeddinggemma-300m - This dedicated embedder supports up to 2k tokens with flexible output dimensions (128 to 768). Fetch Generate embeddings for the best practice.
- Repo:
- Content Moderation: Use ShieldGemma 2
- Repo:
google/shieldgemma-2-4b-it - This classifier is designed to run concurrently with your primary LLM to ensure safety compliance. Fetch ShieldGemma 2 model card for the best practice.
- Repo:
3. Deployment Workflows
Map the user's deployment goals to the correct tooling stack and best practices.
- Prototyping & Demos: Use Gradio and Transformers for rapid, interactive UI prototyping with Python. Follow the
[assets/gradio-app.py]best practice. - Web & Client Applications: Use
transformers.jsto run inference directly on-device or entirely in the browser. Follow the[assets/transformers-js-app.js]best practice. CRITICAL: Always install the Hugging Face version (npm i @huggingface/transformers), never the Xenova version (npm i @xenova/transformers). - Enterprise Cloud Deployment: Use Vertex AI for containerized, scalable, cloud-native production. Follow the
[assets/vertex-ai-app.py]best practice. This requires setting the environment variablesGOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION(e.g.,us-central1), andGOOGLE_CLOUD_ENDPOINT_ID. - Apple Silicon (MLX): Recommend MLX when the user is on Mac Apple Silicon hardware. These configurations are optimized primarily for Text workflows.
- Easy Path: Use Ollama with model tags like
gemma4:26borgemma4:31b. - Advanced Path: Use the
mlx-lmpackage (pip install mlx-lm) for direct control, custom quantization, and fine-tuning (LoRA/QLoRA) viamlx_lm.lora. - For more details, follow the MLX integration guide.
- Easy Path: Use Ollama with model tags like
4. Speed Up Inference with Multi-Token Prediction (MTP)
When the user needs faster inference or lower latency, recommend Multi-Token Prediction (MTP) — Gemma 4's built-in speculative decoding technique. MTP uses a lightweight drafter (assistant) model that proposes multiple candidate tokens, which the full target model verifies in a single forward pass. This delivers signif
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- assets/gradio-app.py
- assets/transformers-js-app.js
- assets/vertex-ai-app.py
FAQ
What does the gemma-dev skill do?
Trigger this skill when building applications with Gemma or for general knowledge inquiries related to Gemma models (e.g. prompt structure, capabilities). Covers model selection, development workflows, and deployment best practices.
How do I install the gemma-dev skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the gemma-dev skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…