โมเดลมัลติโมดัลที่คุ้มค่าที่สุดของเรา ซึ่งให้ประสิทธิภาพที่เร็วที่สุดสำหรับ งานที่มีความถี่สูงและมีขนาดเล็ก Gemini 3.1 Flash-Lite เหมาะที่สุดสำหรับงานที่ต้องใช้เอเจนต์จำนวนมาก การดึงข้อมูลอย่างง่าย และแอปพลิเคชันที่มีเวลาในการตอบสนองต่ำมาก ซึ่งมีข้อจำกัดหลักด้านงบประมาณและความเร็ว
gemini-3.1-flash-lite-preview
| พร็อพเพอร์ตี้ | คำอธิบาย |
|---|---|
| รหัสโมเดล | gemini-3.1-flash-lite-preview |
| ประเภทข้อมูลที่รองรับ |
อินพุต ข้อความ รูปภาพ วิดีโอ เสียง และ PDF เอาต์พุต ข้อความ |
| ขีดจำกัดของโทเค็น[*] |
ขีดจำกัดโทเค็นอินพุต 1,048,576 ขีดจำกัดโทเค็นเอาต์พุต 65,536 |
| ความสามารถ |
การสร้างเสียง สิ่งที่ทำไม่ได้ Batch API สิ่งที่ทำได้ การแคช สิ่งที่ทำได้ การรันโค้ด สิ่งที่ทำได้ การใช้คอมพิวเตอร์ สิ่งที่ทำไม่ได้ ค้นหาไฟล์ สิ่งที่ทำได้ การเรียกใช้ฟังก์ชัน สิ่งที่ทำได้ การเชื่อมต่อแหล่งข้อมูลกับ Google Maps สิ่งที่ทำไม่ได้ การสร้างรูปภาพ สิ่งที่ทำไม่ได้ Live API สิ่งที่ทำไม่ได้ การเชื่อมต่อแหล่งข้อมูลของ Search สิ่งที่ทำได้ เอาต์พุตที่มีโครงสร้าง สิ่งที่ทำได้ การคิด สิ่งที่ทำได้ บริบทของ URL สิ่งที่ทำได้ |
| เวอร์ชัน |
|
| การอัปเดตล่าสุด | มีนาคม 2026 |
| การตัดข้อมูล | มกราคม 2025 |
คู่มือนักพัฒนาซอฟต์แวร์
Gemini 3.1 Flash-Lite เหมาะที่สุดสำหรับการจัดการงานที่ไม่ซับซ้อนในปริมาณมาก ต่อไปนี้คือกรณีการใช้งานที่เหมาะกับ Gemini 3.1 Flash-Lite มากที่สุด
การแปล: การแปลจำนวนมากที่รวดเร็วและราคาถูก เช่น การประมวลผล ข้อความแชท รีวิว และคำขอรับการสนับสนุนในวงกว้าง คุณใช้คำสั่งของระบบเพื่อจำกัดเอาต์พุตให้มีเฉพาะข้อความที่แปลโดยไม่มีคำอธิบายเพิ่มเติมได้โดยทำดังนี้
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)การถอดเสียงเป็นคำ: ประมวลผลไฟล์บันทึก เสียงบันทึก หรือเนื้อหาเสียงใดๆ ที่คุณต้องการข้อความถอดเสียงโดยไม่ต้องสร้าง ไปป์ไลน์การแปลงเสียงพูดเป็นข้อความแยกต่างหาก รองรับอินพุตหลายรูปแบบ คุณจึงส่งไฟล์เสียง เพื่อถอดเสียงเป็นคำได้โดยตรง
# 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)งานแบบเอเจนต์น้ำหนักเบาและการแยกข้อมูล: การแยกเอนทิตี การจัดประเภท และไปป์ไลน์การประมวลผลข้อมูลน้ำหนักเบาที่รองรับเอาต์พุต JSON ที่มีโครงสร้าง เช่น การแยก Structured Data จากรีวิวลูกค้าอีคอมเมิร์ซ
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)การประมวลผลและสรุปเอกสาร: แยกวิเคราะห์ PDF และแสดงข้อมูลสรุปที่กระชับ เช่น สำหรับการสร้างไปป์ไลน์การประมวลผลเอกสารหรือการจัดลำดับความสำคัญของไฟล์ที่เข้ามาอย่างรวดเร็ว
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)การกำหนดเส้นทางโมเดล: ใช้โมเดลที่มีเวลาในการตอบสนองต่ำและต้นทุนต่ำเป็นตัวแยกประเภทที่ กำหนดเส้นทางการค้นหาไปยังโมเดลที่เหมาะสมตามความซับซ้อนของงาน นี่คือรูปแบบจริงในเวอร์ชันที่ใช้งานจริง ซึ่ง Gemini CLI แบบโอเพนซอร์สใช้ Flash-Lite เพื่อ จัดประเภทความซับซ้อนของงานและกำหนดเส้นทางไปยัง Flash หรือ Pro ตามนั้น
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)การคิด: เพื่อให้ได้ความแม่นยำมากขึ้นสำหรับงานที่ได้รับประโยชน์จากการให้เหตุผลแบบทีละขั้นตอน ให้กำหนดค่าการคิดเพื่อให้โมเดลใช้การคำนวณเพิ่มเติมกับการให้เหตุผลภายใน ก่อนที่จะสร้างเอาต์พุตสุดท้าย
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)