Gemini 3.1 Flash-Lite là một mô hình đa phương thức có độ trễ thấp, tiết kiệm chi phí và được tối ưu hoá cho các nhiệm vụ nhẹ, tần suất cao. Mô hình này hỗ trợ dữ liệu đầu vào dạng văn bản, hình ảnh, video, âm thanh và PDF, đồng thời được thiết kế cho các quy trình làm việc có khối lượng lớn, trích xuất dữ liệu đơn giản và các ứng dụng mà độ trễ và chi phí API là những hạn chế chính.
gemini-3.1-flash-lite
| Thuộc tính | Mô tả |
|---|---|
| Mã kiểu máy | gemini-3.1-flash-lite |
| Các loại dữ liệu được hỗ trợ |
Thông tin đầu vào Văn bản, hình ảnh, video, âm thanh và PDF Kết quả Văn bản |
| Giới hạn về mã thông báo[*] |
Giới hạn số token đầu vào 1.048.576 Giới hạn mã thông báo đầu ra 65.536 |
| Tính năng |
Không được hỗ trợ Được hỗ trợ Được hỗ trợ Không được hỗ trợ Được hỗ trợ Được hỗ trợ Được hỗ trợ Không được hỗ trợ Không được hỗ trợ Được hỗ trợ Được hỗ trợ Được hỗ trợ Được hỗ trợ |
| Lựa chọn sử dụng |
Được hỗ trợ Được hỗ trợ Được hỗ trợ |
| phiên bản |
|
| Thông tin cập nhật mới nhất | Tháng 5 năm 2026 |
| Thẻ mô hình | Thẻ thông tin về mô hình |
Hướng dẫn cho nhà phát triển
Gemini 3.1 Flash-Lite là mô hình phù hợp nhất để xử lý các nhiệm vụ đơn giản trên quy mô lớn. Sau đây là một số trường hợp sử dụng phù hợp nhất với Gemini 3.1 Flash-Lite:
Dịch thuật: Dịch nhanh, rẻ, số lượng lớn, chẳng hạn như xử lý tin nhắn trò chuyện, bài đánh giá và phiếu yêu cầu hỗ trợ trên quy mô lớn. Bạn có thể sử dụng chỉ dẫn hệ thống để giới hạn kết quả đầu ra chỉ ở dạng văn bản đã dịch mà không có thêm bình luận:
from google import genai client = genai.Client() text = "Hey, are you down to grab some pizza later? I'm starving!" response = client.models.generate_content( model="gemini-3.1-flash-lite", config={ "system_instruction": "Only output the translated text" }, contents=f"Translate the following text to German: {text}" ) print(response.text)Chép lời: Xử lý bản ghi âm, ghi chú thoại hoặc bất kỳ nội dung âm thanh nào mà bạn cần bản chép lời mà không cần tạo một quy trình chuyển lời nói thành văn bản riêng biệt. Hỗ trợ dữ liệu đầu vào đa phương thức, vì vậy, bạn có thể truyền tệp âm thanh trực tiếp để chép lời:
from google import genai client = genai.Client() # URL = "https://storage.googleapis.com/generativeai-downloads/data/State_of_the_Union_Address_30_January_1961.mp3" # Upload the audio file to the GenAI File API uploaded_file = client.files.upload(file='sample.mp3') prompt = 'Generate a transcript of the audio.' response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[prompt, uploaded_file] ) print(response.text)Tác vụ tác nhân nhẹ nhàng và trích xuất dữ liệu: Trích xuất thực thể, phân loại và quy trình xử lý dữ liệu nhẹ nhàng được hỗ trợ bằng kết quả JSON có cấu trúc. Ví dụ: trích xuất dữ liệu có cấu trúc từ một bài đánh giá của khách hàng trên trang thương mại điện tử:
from google import genai from pydantic import BaseModel, Field client = genai.Client() prompt = "Analyze the user review and determine the aspect, sentiment score, summary quote, and return risk" input_text = "The boots look amazing and the leather is high quality, but they run way too small. I'm sending them back." class ReviewAnalysis(BaseModel): aspect: str = Field(description="The feature mentioned (e.g., Price, Comfort, Style, Shipping)") summary_quote: str = Field(description="The specific phrase from the review about this aspect") sentiment_score: int = Field(description="1 to 5 (1=worst, 5=best)") is_return_risk: bool = Field(description="True if the user mentions returning the item") response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[prompt, input_text], config={ "response_mime_type": "application/json", "response_json_schema": ReviewAnalysis.model_json_schema(), }, ) print(response.text)Xử lý và tóm tắt tài liệu: Phân tích cú pháp tệp PDF và trả về bản tóm tắt ngắn gọn, chẳng hạn như để xây dựng quy trình xử lý tài liệu hoặc nhanh chóng phân loại tệp đến:
from google import genai from google.genai import types import httpx client = genai.Client() # Download a sample PDF document doc_url = "https://storage.googleapis.com/generativeai-downloads/data/med_gemini.pdf" doc_data = httpx.get(doc_url).content prompt = "Summarize this document" response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[ types.Part.from_bytes( data=doc_data, mime_type='application/pdf', ), prompt ] ) print(response.text)Định tuyến mô hình: Sử dụng một mô hình có độ trễ thấp và chi phí thấp làm bộ phân loại để định tuyến các truy vấn đến mô hình thích hợp dựa trên độ phức tạp của nhiệm vụ. Đây là một mô hình thực tế trong môi trường thực tế — Gemini CLI nguồn mở sử dụng Flash-Lite để phân loại độ phức tạp của nhiệm vụ và định tuyến đến Flash hoặc Pro cho phù hợp.
from google import genai client = genai.Client() FLASH_MODEL = 'flash' PRO_MODEL = 'pro' CLASSIFIER_SYSTEM_PROMPT = f""" You are a specialized Task Routing AI. Your sole function is to analyze the user's request and classify its complexity. Choose between `{FLASH_MODEL}` (SIMPLE) or `{PRO_MODEL}` (COMPLEX). 1. `{FLASH_MODEL}`: A fast, efficient model for simple, well-defined tasks. 2. `{PRO_MODEL}`: A powerful, advanced model for complex, open-ended, or multi-step tasks. A task is COMPLEX if it meets ONE OR MORE of the following criteria: 1. High Operational Complexity (Est. 4+ Steps/Tool Calls) 2. Strategic Planning and Conceptual Design 3. High Ambiguity or Large Scope 4. Deep Debugging and Root Cause Analysis A task is SIMPLE if it is highly specific, bounded, and has Low Operational Complexity (Est. 1-3 tool calls). """ user_input = "I'm getting an error 'Cannot read property 'map' of undefined' when I click the save button. Can you fix it?" response_schema = { "type": "object", "properties": { "reasoning": { "type": "string", "description": "A brief, step-by-step explanation for the model choice, referencing the rubric." }, "model_choice": { "type": "string", "enum": [FLASH_MODEL, PRO_MODEL] } }, "required": ["reasoning", "model_choice"] } response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=user_input, config={ "system_instruction": CLASSIFIER_SYSTEM_PROMPT, "response_mime_type": "application/json", "response_json_schema": response_schema }, ) print(response.text)Tư duy: Để có độ chính xác cao hơn cho những nhiệm vụ cần suy luận từng bước, hãy định cấu hình tư duy để mô hình dành thêm tài nguyên điện toán cho việc suy luận nội bộ trước khi đưa ra kết quả cuối cùng:
from google import genai from google.genai import types client = genai.Client() response = client.models.generate_content( model="gemini-3.1-flash-lite", contents="How does AI work?", config=types.GenerateContentConfig( thinking_config=types.ThinkingConfig(thinking_level="high") ), ) print(response.text)