Bản xem trước Gemini 3.1 Flash-Lite

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 nhẹ. Gemini 3.1 Flash-Lite phù hợp nhất cho các tác vụ đại diện có khối 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 ràng buộc chính.

gemini-3.1-flash-lite-preview

Thuộc tính Mô tả
Mã mô hình 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, Â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

Khả năng

Tạo âm thanh

Không được hỗ trợ

API hàng loạt

Đượ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ợ

Suy luận linh hoạt

Được hỗ trợ

Gọi hàm

Được hỗ trợ

Kết nối với Google Maps

Được hỗ trợ

Tạo hình ảnh

Không được hỗ trợ

API trực tiếp

Không được hỗ trợ

Suy luận mức độ ưu tiên

Đượ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ợ

Ngữ cảnh URL

Được hỗ trợ

Phiên bản
Đọc các mẫu phiên bản mô hình để biết thêm thông tin.
  • Preview: gemini-3.1-flash-lite-preview
Nội dung 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 cho Gemini 3.1 Flash-Lite:

  • Dịch: Dịch nhanh, rẻ, khối 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 hướng dẫn hệ thống để giới hạn đầu ra chỉ ở văn bản đã dịch mà không có bình luận bổ sung:

    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 bất kỳ nội dung âm thanh nào mà bạn cần bản chép lời văn bản 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ợ thông tin đầu vào đa phương thức, vì vậy, bạn có thể truyền trực tiếp tệp âm thanh để chuyển ghi âm thành văn bản:

    # 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)
    
  • Tác vụ đại diện dung lượng nhẹ 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 dung lượng 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 về 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ư để xây dựng 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 bộ phân loại để định tuyến các truy vấn đến mô hình phù hợp dựa trên mức độ 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 mức độ 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: Để tăng độ chính xác cho các tác vụ được hưởng lợi từ quá 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 quá trình suy luận nội bộ trước khi tạo ra đầu ra 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)