Gemini 3.1 Flash-Lite

Gemini 3.1 Flash-Lite เป็นโมเดลหลายรูปแบบที่มีเวลาในการตอบสนองต่ำและคุ้มค่า ซึ่งได้รับการเพิ่มประสิทธิภาพสำหรับงานที่มีความถี่สูงและใช้ทรัพยากรน้อย โมเดลนี้รองรับอินพุตข้อความ รูปภาพ วิดีโอ เสียง และ PDF และออกแบบมาสำหรับเวิร์กโฟลว์แบบ Agentic ที่มีปริมาณมาก การดึงข้อมูลแบบง่าย และแอปพลิเคชันที่เวลาในการตอบสนองและค่าใช้จ่าย API เป็นข้อจำกัดหลัก

gemini-3.1-flash-lite

พร็อพเพอร์ตี้ คำอธิบาย
รหัสรุ่น gemini-3.1-flash-lite
ประเภทข้อมูลที่รองรับ

อินพุต

ข้อความ รูปภาพ วิดีโอ เสียง และ PDF

เอาต์พุต

ข้อความ

ขีดจำกัดโทเค็น[*]

ขีดจำกัดโทเค็นอินพุต

1,048,576

ขีดจำกัดโทเค็นเอาต์พุต

65,536

ความสามารถ

การสร้างเสียง

สิ่งที่ทำไม่ได้

การแคช

สิ่งที่ทำได้

การเรียกใช้โค้ด

สิ่งที่ทำได้

การใช้คอมพิวเตอร์

สิ่งที่ทำไม่ได้

การค้นหาไฟล์

สิ่งที่ทำได้

การเรียกใช้ฟังก์ชัน

สิ่งที่ทำได้

การเชื่อมต่อแหล่งข้อมูลกับ Google Maps

สิ่งที่ทำได้

การสร้างรูปภาพ

สิ่งที่ทำไม่ได้

Live API

สิ่งที่ทำไม่ได้

การเชื่อมต่อแหล่งข้อมูลของ Search

สิ่งที่ทำได้

เอาต์พุตที่มีโครงสร้าง

สิ่งที่ทำได้

กำลังคิด

สิ่งที่ทำได้

บริบท URL

สิ่งที่ทำได้

ตัวเลือกการรับชม

Batch API

สิ่งที่ทำได้

Flex Inference

สิ่งที่ทำได้

การอนุมานลำดับความสำคัญ

สิ่งที่ทำได้

เวอร์ชัน
อ่านรายละเอียดเพิ่มเติมได้ที่รูปแบบเวอร์ชันโมเดล
  • Stable: gemini-3.1-flash-lite
อัปเดตล่าสุด พฤษภาคม 2026
Model card การ์ดโมเดล

คู่มือนักพัฒนาซอฟต์แวร์

Gemini 3.1 Flash-Lite เหมาะที่สุดสำหรับการจัดการงานที่ตรงไปตรงมาในปริมาณมาก ต่อไปนี้คือกรณีการใช้งานบางส่วนที่เหมาะกับ Gemini 3.1 Flash-Lite มากที่สุด

  • การแปลภาษา: การแปลภาษาที่รวดเร็ว ราคาประหยัด และมีปริมาณมาก เช่น การประมวลผลข้อความแชท รีวิว และคำขอแจ้งปัญหาจำนวนมาก คุณสามารถใช้คำสั่งของระบบเพื่อจำกัดเอาต์พุตให้เป็นเฉพาะข้อความที่แปลโดยไม่มีความคิดเห็นเพิ่มเติมได้ ดังนี้

    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)
    
  • การถอดเสียงเป็นคำ: ประมวลผลไฟล์บันทึกเสียง บันทึกเสียง หรือเนื้อหาเสียงใดๆ ที่คุณต้องการข้อความถอดเสียงโดยไม่ต้องสร้างไปป์ไลน์การแปลงเสียงพูดเป็นข้อความแยกต่างหาก รองรับอินพุตแบบหลายโมดัล คุณจึงส่งไฟล์เสียงเพื่อถอดเสียงเป็นคำได้โดยตรง

    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)
    
  • งาน Agentic และการดึงข้อมูลแบบไม่ซับซ้อน: การดึงข้อมูลเอนทิตี การแยกประเภท และไปป์ไลน์การประมวลผลข้อมูลแบบไม่ซับซ้อนที่รองรับเอาต์พุต JSON ที่มีโครงสร้าง ตัวอย่างเช่น การดึงข้อมูลที่มีโครงสร้างจากรีวิวของลูกค้าอีคอมเมิร์ซ

    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)
    
  • การประมวลผลและการสรุปเอกสาร: แยกวิเคราะห์ PDF และแสดงผลสรุปที่กระชับ เช่น สำหรับการสร้างไปป์ไลน์การประมวลผลเอกสารหรือการคัดแยกไฟล์ขาเข้าอย่างรวดเร็ว

    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)
    
  • การกำหนดเส้นทางโมเดล: ใช้โมเดลที่มีเวลาในการตอบสนองต่ำและต้นทุนต่ำเป็นตัวแยกประเภทที่กำหนดเส้นทางการค้นหาไปยังโมเดลที่เหมาะสมตามความซับซ้อนของงาน นี่คือรูปแบบที่ใช้จริงในเวอร์ชันที่ใช้งานจริง โดย Gemini CLI แบบโอเพนซอร์สจะใช้ Flash-Lite เพื่อจำแนกความซับซ้อนของงานและกำหนดเส้นทางไปยัง Flash หรือ Pro ตามความเหมาะสม

    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)
    
  • การคิด: เพื่อความแม่นยำที่ดียิ่งขึ้นสำหรับงานที่ได้ประโยชน์จากการให้เหตุผลทีละขั้นตอน ให้กำหนดค่าการคิดเพื่อให้โมเดลใช้การประมวลผลเพิ่มเติมในการให้เหตุผลภายในก่อนที่จะสร้างเอาต์พุตสุดท้าย ดังนี้

    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)