Mô hình đa phương thức tiết kiệm chi phí nhất của chúng tôi, mang lại hiệu suất nhanh nhất cho các tác vụ tần suất cao, dung lượng thấp. Gemini 3.1 Flash-Lite phù hợp nhất với các tác vụ có số lượng lớn, trích xuất dữ liệu đơn giản và các ứng dụng có độ trễ cực thấp, trong đó ngân sách và tốc độ là những hạn chế chính.
gemini-3.1-flash-lite-preview
| Thuộc tính | Mô tả |
|---|---|
| Mã kiểu máy | gemini-3.1-flash-lite-preview |
| Các loại dữ liệu được hỗ trợ |
Thông tin đầu vào Văn bản, Hình ảnh, Video, Đoạn âm thanh và PDF Đầu ra Văn bản |
| Giới hạn mã thông báo[*] |
Giới hạn mã thông báo đầu vào 1.048.576 Giới hạn mã thông báo đầu ra 65.536 |
| Chức năng |
Tạo âm thanh Không được hỗ trợ Batch API Được hỗ trợ Lưu vào bộ nhớ đệm Được hỗ trợ Thực thi mã Được hỗ trợ Sử dụng máy tính Không được hỗ trợ Tìm kiếm tệp Được hỗ trợ Gọi hàm Được hỗ trợ Kết nối với Google Maps Không được hỗ trợ Tạo hình ảnh Không được hỗ trợ Live API Không được hỗ trợ Tìm trong phần liên kết thực tế Được hỗ trợ Đầu ra có cấu trúc Được hỗ trợ Tư duy Được hỗ trợ Bối cảnh URL Được hỗ trợ |
| Phiên bản |
|
| Thông tin cập nhật mới nhất | Tháng 3 năm 2026 |
| Điểm cắt kiến thức | Tháng 1 năm 2025 |
Hướng dẫn cho nhà phát triển
Gemini 3.1 Flash-Lite phù hợp nhất để xử lý các tác vụ đơn giả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 thuật nhanh chóng, tiết kiệm chi phí và 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ợ ở quy mô lớn. Bạn có thể sử dụng các chỉ dẫn hệ thống để giới hạn đầu ra chỉ ở văn bản đã dịch mà không có thêm bình luận:
text = "Hey, are you down to grab some pizza later? I'm starving!" response = client.models.generate_content( model="gemini-3.1-flash-lite-preview", 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ú bằng giọng nói hoặc mọi nội dung âm thanh mà bạn cần bản chép lời dạng văn bản mà không cần tạo một quy trình chuyển lời nói sang 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 trực tiếp các tệp âm thanh để chép lời:
# 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-preview", contents=[prompt, uploaded_file] ) print(response.text)Trích xuất dữ liệu và các tác vụ dựa trên tác nhân có quy mô nhỏ: Trích xuất thực thể, phân loại và các quy trình xử lý dữ liệu có quy mô nhỏ được hỗ trợ bằng đầu ra JSON có cấu trúc. Ví dụ: trích xuất dữ liệu có cấu trúc từ bài đánh giá của khách hàng trên trang thương mại điện tử:
from pydantic import BaseModel, Field 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-preview", 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ư để tạo quy trình xử lý tài liệu hoặc nhanh chóng phân loại các tệp đến:
import httpx # 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-preview", 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ô hình có độ trễ thấp và chi phí thấp làm trình phân loại để định tuyến các truy vấn đến mô hình phù hợp dựa trên độ phức tạp của tác vụ. Đây là một mẫu thực tế trong quá trình sản xuất – Gemini CLI nguồn mở sử dụng Flash-Lite để phân loại độ phức tạp của tác vụ và định tuyến đến Flash hoặc Pro cho phù hợp.
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-preview", 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 tác vụ được hưởng lợi từ quy trình suy luận từng bước, hãy định cấu hình tư duy để mô hình dành thêm thời gian tính toán cho quy trình suy luận nội bộ trước khi tạo ra kết quả cuối cùng:
response = client.models.generate_content( model="gemini-3.1-flash-lite-preview", contents="How does AI work?", config=types.GenerateContentConfig( thinking_config=types.ThinkingConfig(thinking_level="high") ), ) print(response.text)