翻篇收录说明
翻篇网页快照

Get started with Gemma - Gemma Docs

https://gemma.ai/get-started/

最近抓取:2026-12-03 11:09:59(北京时间)

最近内容变化:2026-11-30 08:52:31(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Run your first Gemma 4 generation in one command, then pick the engine, model size and checkpoint that fit your hardware.

正文摘录

Quickstart¶ Models Gemma 4 Uses Transformers llama.cpp Ollama MLX vLLM LM Studio View as markdown Gemma is a family of lightweight, state-of-the-art open models built from the same research and technology used to create the Gemini models. Developed by Google DeepMind and other teams across Google, Gemma is named after the Latin gemma, meaning precious stone. The Gemma model weights are supported by developer tools that promote innovation, collaboration, and the responsible use of artificial intelligence (AI). The latest in the Gemma family is Gemma 4 featuring multimodal (text, image, audio) inputs. New to Gemma? To learn more about the Gemma family of models, visit the model family page for a tour or explore the illustrated architecture guides. Choose a model¶ Gemma 4 ships in five sizes. They share a tokenizer and prompt format, so you can start small and move up without rewriting anything. Size Input ➔ Output Context Intended Platform E2B Text, Image, Audio, Video ➔ Text 128K Mobile devices E4B Text, Image, Audio, Video ➔ Text 128K Mobile devices and laptops 12B Text, Image, Audio, Video ➔ Text 256K Laptops, desktop computers and small servers 26B A4B Text, Image, Video ➔ Text 256K Desktop computers and small servers 31B Text, Image, Video ➔ Text 256K Large servers or server clusters Run your first inference¶ Hugging Face Transformersllama.cppOllamaApple MLXvLLMLMStudio Install transformers, then run: from transformers import pipeline pipe = pipeline( "text-generation", model="google/gemma-4-E2B-it", device_map="auto" ) output = pipe("Explain quantum computing simply:", max_new_tokens=150) print(output[0]["generated_text"]) Install llama.cpp, then run: llama cli -hf google/gemma-4-E2B-it-qat-q4_0-gguf --prompt "Write a poem about the Kraken." Install ollama, then run: ollama run gemma4:e2b "Explain quantum computing simply:" Install MLX LM, then run: mlx_lm.generate --model mlx-community/gemma-4-E2B-it-qat-4bit \ --prompt "Explain quantum computing simply:" Install vLLM, then run: vllm serve google/gemma-4-E2B-it Install LMStudio, then run: lms chat google/gemma-4-e2b Using a coding agent? Install the gemma-dev skill so your agent stays current with the latest models: npx skills add google-gemma/gemma-skills --skill gemma-dev --global Providers¶ If you want to run Gemma 4 on a different stack, you can choose from the following: Ollama llama.cpp LM Studio MLX LiteRT Transformers Keras Unsloth vLLM SGLang Gemini API Google Cloud All ways to run → Get the weights¶ Every size ships full-precision weights plus Quantization-Aware Training (QAT) checkpoints, which hold up far better at 4-bit than a generic post-training quant. Where What's there Hugging Face Safetensors, GGUF and QAT collections Kaggle The same checkpoints, mirrored Ollama Prebuilt tags, pulled on first run Checkpoint names follow google/gemma-4-{SIZE}-it{SUFFIX} — pick the suffix your engine wants: Running on Suffix llama.cpp, LM Studio, Ollama -qat-q4_0-gguf vLLM, SGLang -qat-w4a16-ct Mobile -qat-mobile-transformers, -qat-mobile-ct What's next¶ Best practices Sampling parameters, thinking-mode tokens, modality order and image token budgets. Capabilities Text, reasoning, tool calling, vision, video and audio — each with runnable code. The model family Every generation and variant, and which base model each one came from.