> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/language-models/gemini-3-1-flash-lite.md).

# जेमिनी 3.1 फ्लैश लाइट

> **Gemini 3.1 Flash Lite** मार्च 2026 तक यह Google का सबसे सस्ता और तेज़ प्रोडक्शन मॉडल है, जिसे 3 मार्च 2026 को जारी किया गया। यह Gemini 3.1 परिवार का API-अनुकूलित टियर है — जिसे रीयल-टाइम चैटबॉट, वर्गीकरण पाइपलाइन, और RAG पुनर्प्राप्ति परतों जैसे उच्च-थ्रूपुट, लागत-संवेदनशील वर्कलोड के लिए डिज़ाइन किया गया है। अधिकतम लागत नियंत्रण के लिए इसे Clore.ai GPU पर Ollama या vLLM के माध्यम से स्व-होस्ट करें।

## Gemini 3.1 Flash Lite क्या है?

Gemini 3.1 परिवार में हल्के प्रवेश के रूप में 3 मार्च 2026 को जारी किया गया (जिसमें 19 फ़रवरी 2026 का Gemini 3.1 Pro भी शामिल है), Flash Lite कुछ तर्क-गहराई को बहुत कम लेटेंसी और लागत के बदले ट्रेड करता है। यह Google का "तेज़ और सस्ता" टियर के लिए जवाब है — जो कीमत-प्रदर्शन में GPT-5.4 के mini वेरिएंट्स और Claude Sonnet से सीधे प्रतिस्पर्धा करता है।

**मुख्य स्पेक्स:**

* **मल्टीमोडल**: टेक्स्ट, इमेज, ऑडियो, वीडियो इनपुट
* **संदर्भ विंडो**: 1M टोकन (Gemini 3.1 Pro के समान)
* **आउटपुट**: प्रति अनुरोध अधिकतम 8K टोकन
* **लेटेंसी**: छोटे प्रॉम्प्ट के लिए पहले टोकन तक का लगभग 120ms समय (API)
* **आर्किटेक्चर**: speculative decoding के साथ Gemini 3.1 Pro से डिस्टिल्ड किया गया

> **ध्यान दें:** Gemini 3.1 Flash Lite एक **केवल Google API** मॉडल है — इसके वेट्स सार्वजनिक रूप से जारी नहीं किए गए हैं। यह गाइड (a) Clore.ai इन्फ्रास्ट्रक्चर पर Google Gemini API का उपयोग, और (b) तुलनीय ओपन-सोर्स विकल्प जिन्हें आप पूरी तरह स्व-होस्ट कर सकते हैं, को कवर करती है।

## विकल्प A: Clore.ai सर्वर पर Gemini 3.1 Flash Lite API का उपयोग करें

भले ही आप वेट्स को स्थानीय रूप से नहीं चला सकते, फिर भी लंबे समय तक चलने वाली प्रक्रियाओं, ऑटोमेशन पाइपलाइनों, और बैच जॉब्स के लिए Clore.ai के सस्ते सर्वरों पर अपना API-उपयोग करने वाला एप्लिकेशन होस्ट करना समझदारी है।

### सेटअप: Clore.ai पर API प्रॉक्सी + FastAPI

```bash
# Clore.ai पर एक CPU या हल्का GPU सर्वर किराए पर लें
# API प्रॉक्सी वर्कलोड के लिए RTX 3060 ($0.03–0.07/घंटा) पर्याप्त से भी अधिक है

pip install google-generativeai fastapi uvicorn

cat > gemini_proxy.py << 'EOF'
import google.generativeai as genai
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import os

genai.configure(api_key=os.environ["GOOGLE_API_KEY"])

model = genai.GenerativeModel("gemini-3.1-flash-lite")

app = FastAPI(title="Gemini 3.1 Flash Lite Proxy")

class ChatRequest(BaseModel):
    message: str
    system_prompt: str = "आप एक मददगार सहायक हैं."
    max_tokens: int = 2048

@app.post("/chat")
async def chat(req: ChatRequest):
    try:
        response = model.generate_content(
            [req.system_prompt, req.message],
            generation_config=genai.GenerationConfig(
                max_output_tokens=req.max_tokens,
                temperature=0.7
            )
        )
        return {"response": response.text, "model": "gemini-3.1-flash-lite"}
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))

@app.post("/vision")
async def vision_chat(image_url: str, prompt: str):
    import httpx
    async with httpx.AsyncClient() as client:
        img_data = await client.get(image_url)
    
    import PIL.Image
    import io
    image = PIL.Image.open(io.BytesIO(img_data.content))
    response = model.generate_content([prompt, image])
    return {"response": response.text}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8080)
EOF

GOOGLE_API_KEY=your-key uvicorn gemini_proxy:app --host 0.0.0.0 --port 8080
```

### उच्च-थ्रूपुट बैच प्रोसेसिंग

```python
import google.generativeai as genai
import asyncio
from typing import List

genai.configure(api_key="YOUR_API_KEY")

async def batch_classify(texts: List[str], batch_size: int = 50) -> List[str]:
    """टेक्स्ट को समानांतर बैचों में वर्गीकृत करें — लगभग $0.001 प्रति 1K टेक्स्ट लागत."""
    model = genai.GenerativeModel("gemini-3.1-flash-lite")
    
    results = []
    for i in range(0, len(texts), batch_size):
        batch = texts[i:i + batch_size]
        tasks = [
            model.generate_content_async(
                f"इस टेक्स्ट को POSITIVE, NEGATIVE, या NEUTRAL के रूप में वर्गीकृत करें। केवल एक शब्द में उत्तर दें.\n\nटेक्स्ट: {text}"
            )
            for text in batch
        ]
        responses = await asyncio.gather(*tasks, return_exceptions=True)
        results.extend([
            r.text.strip() if not isinstance(r, Exception) else "ERROR"
            for r in responses
        ])
    return results

# उदाहरण
texts = ["बहुत बढ़िया उत्पाद!", "बहुत खराब सेवा.", "शायद यह ठीक है."]
labels = asyncio.run(batch_classify(texts))
print(list(zip(texts, labels)))
```

## विकल्प B: ओपन-सोर्स विकल्प (Clore.ai पर स्व-होस्ट)

यदि आप बिना किसी API लागत के पूरी तरह स्थानीय inference चाहते हैं, तो ये मॉडल Gemini 3.1 Flash Lite के "तेज़/सस्ते" टियर से मेल खाते हैं:

### Gemma 3 4B (Google का ओपन हल्का मॉडल)

```bash
# 6GB+ VRAM वाले किसी भी GPU पर चलता है — यहाँ तक कि RTX 3060 पर भी
docker run --gpus all -d \
  -p 11434:11434 \
  -v ollama_data:/root/.ollama \
  ollama/ollama

docker exec -it $(docker ps -q) ollama pull gemma3:4b
docker exec -it $(docker ps -q) ollama run gemma3:4b "क्वांटम एंटैंगलमेंट को सरल शब्दों में समझाइए."
```

### Qwen3.5 7B (आकार के हिसाब से तेज़, बेहतर गुणवत्ता)

```bash
docker exec -it $(docker ps -q) ollama pull qwen3.5:7b
# ~3.8GB VRAM, RTX 3080 पर ~45 tok/s
```

### Clore.ai हार्डवेयर पर गति तुलना

| मॉडल                        | VRAM        | टोकन/सेकंड (RTX 4090, एकल स्ट्रीम) | 1M आउटपुट टोकन की लागत                        |
| --------------------------- | ----------- | ---------------------------------- | --------------------------------------------- |
| Gemini 3.1 Flash Lite (API) | उपलब्ध नहीं | \~200 (API)                        | प्रति 1M टोकन लगभग $0.25 इनपुट / $1.50 आउटपुट |
| Gemma 3 4B (local)          | 4GB         | 95 tok/s                           | लगभग $0.58 (RTX 4090 $0.20/घंटा पर)           |
| Qwen3.5 7B (local)          | 8GB         | 78 tok/s                           | \~$0.71                                       |
| Gemma 3 12B (local)         | 12GB        | 55 tok/s                           | \~$1.01                                       |
| Gemma 3 27B (local)         | 20GB        | 32 tok/s                           | \~$1.74                                       |

> **निष्कर्ष:** एक समय में एक अनुरोध पर, स्व-होस्टिंग की लागत लगभग API के बराबर होती है। लाभ आता है **बैचिंग**: vLLM या SGLang के साथ समकालीन अनुरोधों को सर्व करने पर, उसी 4090 पर कुल थ्रूपुट कई गुना बढ़ जाता है और प्रति मिलियन टोकन लागत भी उसी के साथ घटती है। जब आपके पास स्थिर, समानांतर वॉल्यूम हो तब स्व-होस्ट करें; जब ट्रैफ़िक अचानक और कम मात्रा में हो, तब API का उपयोग करें।

## Clore.ai पर डिप्लॉय करें

### Flash Lite-स्तर के वर्कलोड के लिए अनुशंसित GPU

| उपयोग-प्रकरण           | अनुशंसित GPU                     | Clore.ai पर कीमत        |
| ---------------------- | -------------------------------- | ----------------------- |
| API प्रॉक्सी / ऑटोमेशन | GPU की आवश्यकता नहीं (CPU सर्वर) | \~$0.05/घंटा            |
| स्थानीय 4B मॉडल        | RTX 3060 12GB                    | $0.03–0.07/घंटा         |
| स्थानीय 7B मॉडल        | RTX 3080 10GB                    | $0.05–0.19/घंटा         |
| स्थानीय 27B मॉडल       | RTX 4090 24GB                    | $0.14–0.42/घंटा (स्पॉट) |

### Clore.ai पर एक-क्लिक Ollama लॉन्च

Clore.ai डैशबोर्ड में, चुनें **Ollama** टेम्पलेट्स में से:

```bash
# या SSH के माध्यम से मैन्युअल रूप से:
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
ollama pull gemma3:4b
ollama run gemma3:4b
```

## Flash Lite-स्तर के लिए सबसे उपयुक्त उपयोग-केस

1. **RAG पुनर्प्राप्ति परत** — तेज़ संदर्भ रैंकिंग, अंतिम जनरेशन नहीं
2. **रीयल-टाइम चैटबॉट प्रतिक्रियाएँ** — छोटी क्वेरियों के लिए 200ms से कम
3. **दस्तावेज़ वर्गीकरण** — प्रति मिनट हज़ारों दस्तावेज़ संसाधित करें
4. **कोड ऑटोकम्प्लीट** — कम-लेटेंसी सुझाव जनरेशन
5. **अनुवाद पाइपलाइन** — कम लागत पर सामग्री का बैच अनुवाद करें
6. **सामग्री मॉडरेशन** — उपयोगकर्ता सामग्री को बड़े पैमाने पर वर्गीकृत करें

## लागत अनुमानक

| मासिक मात्रा | Google API लागत | Clore.ai (Gemma 3 4B)                   |
| ------------ | --------------- | --------------------------------------- |
| 10M टोकन     | \~$8.75         | लगभग $3.60 (महीने में 50 घंटे RTX 3060) |
| 100M टोकन    | \~$7.00         | लगभग $3.60 (निरंतर)                     |
| 1B टोकन      | \~$70.00        | लगभग $26 (निरंतर RTX 3060)              |

> लगभग 200M टोकन/माह से अधिक मात्रा के लिए, Clore.ai पर स्व-होस्टिंग Gemini API लागत से बेहतर है।

## API उपयोग की निगरानी

```python
# Gemini API उपयोग और लागत को ट्रैक करें
import google.generativeai as genai
import json
from datetime import datetime

genai.configure(api_key="YOUR_API_KEY")

def tracked_generate(prompt: str, log_file: str = "usage.jsonl"):
    model = genai.GenerativeModel("gemini-3.1-flash-lite")
    response = model.generate_content(prompt)
    
    # उपयोग लॉग करें
    usage = {
        "timestamp": datetime.utcnow().isoformat(),
        "prompt_tokens": response.usage_metadata.prompt_token_count,
        "output_tokens": response.usage_metadata.candidates_token_count,
        "total_tokens": response.usage_metadata.total_token_count,
        "estimated_cost_usd": response.usage_metadata.total_token_count / 1_000_000 * 0.07
    }
    
    with open(log_file, "a") as f:
        f.write(json.dumps(usage) + "\n")
    
    return response.text

# उपयोग
result = tracked_generate("फ़्रांस की राजधानी क्या है?")
print(result)
```

## संबंधित गाइड

* [Clore.ai पर Gemma 3](/guides/guides_v2-hi/language-models/gemma3.md) — Google का ओपन-सोर्स मॉडल परिवार
* [Ollama गाइड](/guides/guides_v2-hi/language-models/ollama.md) — एक कमांड से किसी भी LLM को स्थानीय रूप से चलाएँ
* [RAGFlow](/guides/guides_v2-hi/rag/ragflow.md) — तेज़ मॉडलों के साथ अच्छी तरह काम करने वाली RAG पाइपलाइन
* [vLLM सर्विंग](/guides/guides_v2-hi/language-models/vllm.md) — उच्च-थ्रूपुट OpenAI-संगत सर्वर
* [जीपीयू तुलना](/guides/guides_v2-hi/getting-started/gpu-comparison.md) — अपनी ज़रूरतों के लिए सबसे सस्ता GPU खोजें

***

*अंतिम अद्यतन: 16 मार्च 2026 | Gemini 3.1 Flash Lite जारी: 3 मार्च 2026 | वेट्स: केवल API (Google)*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.clore.ai/guides/guides_v2-hi/language-models/gemini-3-1-flash-lite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
