Nhóm mô hình mở Gemma bao gồm nhiều kích thước, chức năng và biến thể chuyên biệt theo nhiệm vụ của mô hình để giúp bạn xây dựng các giải pháp tạo sinh tuỳ chỉnh. Đây là các đường dẫn chính mà bạn có thể làm theo khi sử dụng mô hình Gemma trong một ứng dụng:
Chọn một mô hình và triển khai mô hình đó nguyên trạng trong ứng dụng
Chọn một mô hình, điều chỉnh mô hình đó cho một tác vụ cụ thể, sau đó triển khai mô hình đó trong một ứng dụng hoặc chia sẻ mô hình đó với cộng đồng.
Hướng dẫn này giúp bạn bắt đầu chọn một mô hình, kiểm thử các chức năng của mô hình đó và tuỳ ý điều chỉnh mô hình bạn đã chọn cho ứng dụng của mình.
Phần này giúp bạn hiểu các biến thể chính thức của gia đình mô hình Gemma và chọn một mô hình cho ứng dụng của bạn. Các biến thể mô hình cung cấp các chức năng chung hoặc chuyên biệt cho các tác vụ cụ thể, đồng thời được cung cấp ở nhiều kích thước thông số để bạn có thể chọn một mô hình có các chức năng ưu tiên và đáp ứng các yêu cầu tính toán của bạn.
Danh sách mẫu Gemma
Bảng sau đây liệt kê các biến thể chính của gia đình mô hình Gemma và các nền tảng triển khai dự kiến của chúng:
Bạn có thể kiểm thử các mô hình Gemma bằng cách thiết lập môi trường phát triển với mô hình đã tải xuống và phần mềm hỗ trợ. Sau đó, bạn có thể nhắc mô hình và đánh giá phản hồi của mô hình. Sử dụng một trong các sổ tay Python sau đây với khung học máy mà bạn muốn để thiết lập môi trường kiểm thử và nhắc một mô hình Gemma:
Bạn có thể nhanh chóng kiểm thử Gemma mà không cần thiết lập môi trường phát triển bằng Google AI Studio. Ứng dụng web này cho phép bạn thử các câu lệnh với Gemma và đánh giá khả năng của ứng dụng.
Bạn có thể thay đổi hành vi của các mô hình Gemma bằng cách điều chỉnh các mô hình đó. Việc điều chỉnh mô hình đòi hỏi một tập dữ liệu đầu vào và phản hồi dự kiến có kích thước và độ biến thiên đủ để hướng dẫn hành vi của mô hình. Bạn cũng cần nhiều tài nguyên điện toán và bộ nhớ hơn đáng kể để hoàn tất một lần chạy điều chỉnh so với khi chạy mô hình Gemma để tạo văn bản. Sử dụng một trong các sổ tay Python sau đây để thiết lập môi trường phát triển điều chỉnh và điều chỉnh mô hình Gemma:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-03 UTC."],[],[],null,["The Gemma family of open models includes a range of model sizes, capabilities,\nand task-specialized variations to help you build custom generative solutions.\nThese are the main paths you can follow when using Gemma models in an\napplication:\n\n- Select a model and **deploy it as-is** in your application\n- Select a model, **tune it for a specific task**, and then deploy it in an application, or share it with the community.\n\nThis guide helps you get started with [picking](#pick) a model, [testing](#test)\nits capabilities, and optionally, [tuning](#tune) the model you selected for\nyour application.\n| **Tip:** As you begin implementing AI applications, make sure your are following a principled approach to AI that serves all your users with the [Responsible Generative AI Toolkit](/responsible).\n\n[Try Gemma 3](https://aistudio.google.com/prompts/new_chat?model=gemma-3-27b-it)\n[Get it on Kaggle](https://www.kaggle.com/models?query=gemma3&publisher=google)\n[Get it on Hugging Face](https://huggingface.co/models?search=google/gemma-3)\n\nPick a model\n\nThis section helps you understand the official variants of the Gemma model\nfamily and select a model for your application. The model variants provide\ngeneral capabilities or are specialized for specific tasks, and are provided\nin different parameter sizes so you can pick a model that has your preferred\ncapabilities and meets your compute requirements.\n| **Tip:** A good place to start is the [Gemma 3 4B](https://www.kaggle.com/models/google/gemma-3) model in the latest available version, which can be used for many tasks and has lower resource requirements.\n\nGemma models list\n\nThe following table lists the major variants of the Gemma model family and their\nintended deployment platforms:\n\n| **Parameter size** | **Input** | **Output** | **Variant** | **Foundation** | **Intended platforms** |\n|--------------------|--------------|------------|-------------------------------------------------------------------------|------------------------------------------|-------------------------------------------|\n| 1B | Text | Text | - [Gemma 3 (core)](/gemma/docs/core) | [Gemma 3](/gemma/docs/core/model_card_3) | Mobile devices and single board computers |\n| 2B | Text | Text | - [Gemma 2 (core)](/gemma/docs/core) | [Gemma 2](/gemma/docs/core/model_card_2) | Mobile devices and laptops |\n| 2B | Text | Text | - [Gemma (core)](/gemma/docs/core) - [CodeGemma](/gemma/docs/codegemma) | [Gemma 1](/gemma/docs/core/model_card) | Mobile devices and laptops |\n| 3B | Text, images | Text | - [PaliGemma 2](/gemma/docs/paligemma) | [Gemma 2](/gemma/docs/core/model_card_2) | Desktop computers and small servers |\n| 4B | Text, images | Text | - [Gemma 3 (core)](/gemma/docs/core) | [Gemma 3](/gemma/docs/core/model_card_3) | Desktop computers and small servers |\n| 7B | Text | Text | - [Gemma (core)](/gemma/docs/core) - [CodeGemma](/gemma/docs/codegemma) | [Gemma 1](/gemma/docs/core/model_card) | Desktop computers and small servers |\n| 9B | Text | Text | - [Gemma 2 (core)](/gemma/docs/core) | [Gemma 2](/gemma/docs/core/model_card_2) | Higher-end desktop computers and servers |\n| 10B | Text, images | Text | - [PaliGemma 2](/gemma/docs/paligemma) | [Gemma 2](/gemma/docs/core/model_card_2) | Higher-end desktop computers and servers |\n| 12B | Text, images | Text | - [Gemma 3 (core)](/gemma/docs/core) | [Gemma 3](/gemma/docs/core/model_card_3) | Higher-end desktop computers and servers |\n| 27B | Text, images | Text | - [Gemma 3 (core)](/gemma/docs/core) | [Gemma 3](/gemma/docs/core/model_card_3) | Large servers or server clusters |\n| 27B | Text | Text | - [Gemma 2 (core)](/gemma/docs/core) | [Gemma 2](/gemma/docs/core/model_card_2) | Large servers or server clusters |\n| 28B | Text, images | Text | - [PaliGemma 2](/gemma/docs/paligemma) | [Gemma 2](/gemma/docs/core/model_card_2) | Large servers or server clusters |\n\nThe Gemma family of models also includes special-purpose and research models,\nincluding\n[ShieldGemma](/gemma/docs/shieldgemma),\n[DataGemma](/gemma/docs/datagemma),\n[Gemma Scope](/gemma/docs/gemmascope),\nand\n[Gemma-APS](/gemma/docs/gemma-aps).\n| **Tip:** You can download official Google Gemma model variants and community-created variants from [Kaggle Models](https://www.kaggle.com/models?query=gemma) and [Hugging Face](https://huggingface.co/models?search=google/gemma).\n\nTest models\n\nYou can test Gemma models by setting up a development environment with a\ndownloaded model and supporting software. You can then prompt the model and\nevaluate its responses. Use one of the following Python notebooks with your\npreferred machine learning framework to set up a testing environment and prompt\na Gemma model:\n\n- [Inference with Keras](./core/keras_inference)\n- [Inference with PyTorch](./core/pytorch_gemma)\n- [Inference with Gemma library](./core/gemma_library)\n\nTest Gemma 3 in AI Studio\n\nYou can quickly test Gemma without setting up a development environment using\nGoogle AI Studio. This web application lets you try out prompts with Gemma\nand evaluate its capabilities.\n\nTo try Gemma 3 in Google AI Studio:\n\n1. Open [AI Studio](https://aistudio.google.com/prompts/new_chat?model=gemma-3-27b-it).\n\n2. In the **Run settings** panel on the right side, in the **Model** field,\n select a different size **Gemma** model.\n\n3. At the bottom of the center panel, type a prompt, and select **Run**.\n\nFor more information about using AI Studio, see the\n[Google AI Studio quickstart](/gemini-api/docs/ai-studio-quickstart).\n\nTune models\n\nYou can change the behavior of Gemma models by performing tuning on them. Tuning\na model requires a dataset of inputs and expected responses of sufficient size\nand variation to guide the behavior of the model. You also need significantly\nmore computing and memory resources to complete a tuning run compared to running\na Gemma model for text generation. Use one of the following Python notebooks to\nset up a tuning development environment and tune a Gemma model:\n\n- [Tune Gemma with Keras and LoRA tuning](./core/lora_tuning)\n- [Tune larger Gemma models with distributed training](./core/distributed_tuning)\n\nNext Steps\n\nCheck out these guides for building more solutions with Gemma:\n\n- [Create a chatbot with Gemma](./gemma_chat)\n- [Deploy Gemma to production with Vertex AI](https://cloud.google.com/vertex-ai/generative-ai/docs/open-models/use-gemma)\n- [Use Genkit with Ollama and Gemma](https://firebase.google.com/docs/genkit/plugins/ollama)"]]