Model multimodal kami yang paling hemat biaya, yang menawarkan performa tercepat untuk tugas ringan dengan frekuensi tinggi. Gemini 3.1 Flash-Lite paling cocok untuk tugas agentik bervolume tinggi, ekstraksi data sederhana, dan aplikasi berlatensi sangat rendah dengan anggaran dan kecepatan sebagai batasan utamanya.
gemini-3.1-flash-lite-preview
| Properti | Deskripsi |
|---|---|
| Kode model | gemini-3.1-flash-lite-preview |
| Jenis data yang didukung |
Input Teks, Gambar, Video, Audio, dan PDF Output Teks |
| Batas token[*] |
Batas token input 1.048.576 Batas token output 65.536 |
| Kemampuan |
Pembuatan audio Tidak didukung Batch API Didukung Menyimpan ke cache Didukung Eksekusi kode Didukung Penggunaan komputer Tidak didukung Penelusuran file Didukung Panggilan fungsi Didukung Melakukan grounding dengan Google Maps Tidak didukung Pembuatan gambar Tidak didukung Live API Tidak didukung Grounding penelusuran Didukung Output terstruktur Didukung Berpikir Didukung Konteks URL Didukung |
| Versi |
|
| Pembaruan terbaru | Maret 2026 |
| Batas informasi | Januari 2025 |
Panduan developer
Gemini 3.1 Flash-Lite paling baik dalam menangani tugas sederhana dalam skala yang signifikan. Berikut beberapa kasus penggunaan yang paling cocok untuk Gemini 3.1 Flash-Lite:
Terjemahan: Terjemahan cepat, murah, dan bervolume tinggi, seperti memproses pesan chat, ulasan, dan tiket dukungan dalam skala besar. Anda dapat menggunakan petunjuk sistem untuk membatasi output hanya pada teks yang diterjemahkan tanpa komentar tambahan:
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)Transkripsi: Memproses rekaman, catatan suara, atau konten audio apa pun yang memerlukan transkrip teks tanpa memulai pipeline speech-to-text terpisah. Mendukung input multimodal, sehingga Anda dapat meneruskan file audio secara langsung untuk transkripsi:
# 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)Ekstraksi data dan tugas agentik ringan: Ekstraksi entitas, klasifikasi, dan pipeline pemrosesan data ringan yang didukung dengan output JSON terstruktur. Misalnya, mengekstrak data terstruktur dari ulasan pelanggan e-commerce:
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)Pemrosesan dan ringkasan dokumen: Mengurai PDF dan menampilkan ringkasan singkat, seperti untuk membangun pipeline pemrosesan dokumen atau dengan cepat memilah file yang masuk:
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)Perutean model: Gunakan model latensi rendah dan berbiaya rendah sebagai pengklasifikasi yang merutekan kueri ke model yang sesuai berdasarkan kompleksitas tugas. Ini adalah pola nyata dalam produksi — Gemini CLI open source menggunakan Flash-Lite untuk mengklasifikasikan kompleksitas tugas dan merutekan ke Flash atau Pro dengan tepat.
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)Pemikiran: Untuk akurasi yang lebih baik untuk tugas yang diuntungkan dari penalaran langkah demi langkah, konfigurasikan pemikiran sehingga model menggunakan komputasi tambahan untuk penalaran internal sebelum menghasilkan output akhir:
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)