होम / गाइड / LlamaIndex के लिए मुफ़्त LLM

LlamaIndex के लिए मुफ़्त LLM

LlamaIndex में OpenAI-compatible APIs के लिए दो classes हैं: chat के लिए OpenAILike और embeddings के लिए OpenAILikeEmbedding। यह guide दोनों को FreeLLMAPI की ओर इंगित करती है, जो एक key के पीछे 47 मुफ़्त provider tiers इकट्ठा करता है। आप retrieval-augmented generation (RAG) index बनाते हैं, उसे query करते हैं और एक agent जोड़ते हैं। Code rate limits को संभालता है।

कोड, मॉडल नाम और लाइव कैटलॉग लेबल अंग्रेज़ी में दिखाए गए हैं।

Packages इंस्टॉल करें

FreeLLMAPI इंस्टॉल करें और dashboard के Keys page पर दो या अधिक providers की मुफ़्त keys जोड़ें। Unified key कॉपी करें। फिर LlamaIndex packages इंस्टॉल करें।

इंस्टॉल करें

curl -fsSL https://freellmapi.co/install.sh | bash

pip install -U llama-index-core \
  llama-index-llms-openai-like \
  llama-index-embeddings-openai-like

export FREELLMAPI_BASE_URL=http://localhost:3001/v1
export FREELLMAPI_API_KEY=<unified-key>

सादी OpenAI class को, जो llama-index-llms-openai से आती है, ऐसे model नामों के साथ इस्तेमाल न करें जिन्हें OpenAI नहीं जानता। वह class model नाम और context size को OpenAI models की सूची से जाँचती है। OpenAILike ऐसा नहीं करती, इसलिए ये मान आप खुद सेट करते हैं।

LLM और embedding model कॉन्फ़िगर करें

settings.py

import os
from llama_index.core import Settings
from llama_index.llms.openai_like import OpenAILike
from llama_index.embeddings.openai_like import OpenAILikeEmbedding

BASE = os.environ["FREELLMAPI_BASE_URL"]
KEY = os.environ["FREELLMAPI_API_KEY"]

Settings.llm = OpenAILike(
    model="auto",
    api_base=BASE,
    api_key=KEY,
    is_chat_model=True,              # use /v1/chat/completions
    is_function_calling_model=True,  # needed for FunctionAgent
    context_window=32000,            # the smallest window in your chain
    max_retries=5,
    timeout=90,
)

Settings.embed_model = OpenAILikeEmbedding(
    model_name="bge-m3",  # one family, 1024 dimensions
    api_base=BASE,
    api_key=KEY,
    embed_batch_size=16,
    max_retries=10,
)
  • is_chat_model=True: इसके बिना LlamaIndex requests को पुराने completions endpoint पर भेजता है।
  • context_window: LlamaIndex इस मान से तय करता है कि prompt में कितने retrieved chunks आ सकते हैं। auto के साथ router अलग-अलग models चुन सकता है। अपनी chain की सबसे छोटी context window इस्तेमाल करें।
  • is_function_calling_model=True: इसे तभी सेट करें जब आपकी chain में tool-calling models हों।
  • embed_batch_size: हर batch एक request है। बड़े batches प्रति मिनट कम requests लेते हैं।

RAG prompt में कई retrieved chunks होते हैं, इसलिए chat model को उनके लिए जगह चाहिए। RAG के लिए लंबे context वाले models के साथ एक fallback chain profile बनाएँ। फिर model="auto:<profile>" सेट करें और context_window को उस profile की सबसे छोटी window तक बढ़ाएँ। आज इन मुफ़्त models की context windows सबसे बड़ी हैं:

सबसे बड़ी context windows वाले मुफ़्त models
मॉडलमुफ़्त उपलब्धकॉन्टेक्स्टमुफ़्त सीमाएँ (सबसे अच्छा विकल्प)टूलविज़न
OpenAI: GPT-6 LunaElectronHub1.1M$0.25/week shared free creditsनहींनहीं
GLM 5.3Router9, UnoRouter1M1 अनुरोध/मिनट
1 req/min per model
हाँनहीं
Gemini 3.8 FlashGoogle AI Studio1MRecurring provider quotaहाँहाँ
Gemini 3.7 FlashGoogle AI Studio1M10 अनुरोध/मिनट
20 अनुरोध/दिन
250,000 टोकन/मिनट
~3M
हाँहाँ
DeepSeek V4 FlashAMD Radeon Cloud, BazaarLink, ElectronHub1M10 अनुरोध/मिनट
50 अनुरोध/दिन
Shared rate limit
हाँनहीं
DeepSeek V4 Flash 0731ElectronHub, Router91M10,000 credits/month (~$1), shared; account-anniversary resetनहींनहीं
Gemini 3.6 FlashGoogle AI Studio1M10 अनुरोध/मिनट
20 अनुरोध/दिन
250,000 टोकन/मिनट
~3M
हाँहाँ
GLM-5.2ModelScope, Router91M100 अनुरोध/दिन
Daily login: 200 credits + 50 for linked Alibaba Cloud; 24h expiry; shared; noncommercial experience
नहींनहीं

123 मिलते-जुलते मुफ़्त मॉडल में से 8 दिखाए जा रहे हैं। सभी मॉडल देखें.

FreeLLMAPI कैटलॉग से लाइव डेटा (संस्करण 2026.12.04.516bad, जाँच 2026-12-04)। मुफ़्त सीमाएँ अक्सर बदलती हैं। कैटलॉग की हर दिन जाँच होती है।

एक उपयोगकर्ता को एक ही model पर रखने के लिए X-Session-Id header भेजें। OpenAILike default_headers स्वीकार करता है, उदाहरण के लिए default_headers={"X-Session-Id": "user-42"}। FreeLLMAPI एक session को 30 मिनट तक एक ही model पर रखता है। इससे एक chat में जवाब एक ही शैली में मिलते हैं।

RAG index बनाएँ और query करें

Script एक folder से फ़ाइलें पढ़ती है, embeddings बनाती है, index सेव करती है और एक सवाल का जवाब देती है। Index बनाने के लिए इसे एक बार चलाएँ। बाद के runs सेव किया गया index लोड करते हैं और फ़ाइलों को फिर से embed नहीं करते।

rag.py

import os
import settings  # noqa: F401  (sets Settings.llm and Settings.embed_model)
from llama_index.core import (
    SimpleDirectoryReader,
    StorageContext,
    VectorStoreIndex,
    load_index_from_storage,
)

PERSIST = "./storage"


def load_index() -> VectorStoreIndex:
    if os.path.isdir(PERSIST):
        return load_index_from_storage(StorageContext.from_defaults(persist_dir=PERSIST))
    docs = SimpleDirectoryReader("./docs").load_data()
    index = VectorStoreIndex.from_documents(docs, show_progress=True)
    index.storage_context.persist(persist_dir=PERSIST)
    return index


if __name__ == "__main__":
    query_engine = load_index().as_query_engine(similarity_top_k=4, streaming=True)
    response = query_engine.query("How do I rotate the API keys?")
    response.print_response_stream()
    for node in response.source_nodes:
        print("\nSource:", node.metadata.get("file_name"), round(node.score or 0, 3))
ज़रूरी: पूरे index के लिए एक embedding family रखें। FreeLLMAPI failover के दौरान embedding model कभी नहीं बदलता। वह सिर्फ उन providers के बीच जाता है जो एक ही family देते हैं। अगर आप family बदलते हैं, तो ./storage हटाएँ और index फिर से बनाएँ।

आज के catalog में ये embedding models मुफ़्त हैं। Dimensions column हर family का vector size दिखाता है।

मॉडलप्रदाताआयामअधिकतम इनपुटमुफ़्त सीमा
Gemini Embedding
gemini-embedding-001
Google AI Studio30722048100 rpm · 1K req/day
SEA-LION E5 Embedding 600M
aisingapore/SEA-LION-E5-Embedding-600M
SEA-LION10248192free · 10 rpm
SEA-LION ModernBERT Embedding 300M
aisingapore/SEA-LION-ModernBERT-Embedding-300M
SEA-LION10248192free · 10 rpm
SEA-LION ModernBERT Embedding 600M
aisingapore/SEA-LION-ModernBERT-Embedding-600M
SEA-LION10248192free · 10 rpm
BGE-M3
@cf/baai/bge-m3
Cloudflare Workers AI1024819210K neurons/day (shared)
EmbeddingGemma 300M
@cf/google/embeddinggemma-300m
Cloudflare Workers AI768204810K neurons/day (shared)
Qwen3 Embedding 0.6B
@cf/qwen/qwen3-embedding-0.6b
Cloudflare Workers AI1024819210K neurons/day (shared)
Cohere Embed v4
embed-v4.0
Cohere15361280001K calls/mo (shared w/ chat)
Gemini Embedding 2
gemini-embedding-2
Google AI Studio30728192free-tier rate limited
Nemotron 3 Embed 1B
nvidia/nemotron-3-embed-1b
NVIDIA NIM20484096~40 rpm
PLaMo Embedding 1B (CF)
@cf/pfnet/plamo-embedding-1b
Cloudflare Workers AI2048409610K neurons/day (shared)
BGE Small EN v1.5 (CF)
@cf/baai/bge-small-en-v1.5
Cloudflare Workers AI38451210K neurons/day (shared)
BGE Base EN v1.5 (CF)
@cf/baai/bge-base-en-v1.5
Cloudflare Workers AI76851210K neurons/day (shared)
BGE Large EN v1.5 (CF)
@cf/baai/bge-large-en-v1.5
Cloudflare Workers AI102451210K neurons/day (shared)
Mistral Embed
mistral-embed
Mistral10248192free mode · monthly cap (shared)
Codestral Embed
codestral-embed
Mistral15368192free mode · monthly cap (shared)
Llama Text Embed v2 (Pinecone)
llama-text-embed-v2
Pinecone102420485M tokens/mo per model
Multilingual E5 Large (Pinecone)
multilingual-e5-large
Pinecone10245075M tokens/mo per model
OpenAI: Text Embedding 3 Small (ElectronHub)
text-embedding-3-small
ElectronHub15368192$0.25/week shared free credits
OpenAI: Text Embedding 3 Large (ElectronHub)
text-embedding-3-large
ElectronHub30728192$0.25/week shared free credits
Nemotron 3 Embed 8B (Inferbase)
nvidia-nemotron-3-embed-8b
Inferbase409681925,000 requests/month; 100 requests and $0.50 usage/day shared
Qwen 3 Embedding 0.6B (Inferbase)
qwen3-embedding-0-6b
Inferbase102481925,000 requests/month; 100 requests and $0.50 usage/day shared
Qwen 3 Embedding 4B (Inferbase)
qwen3-embedding-4b
Inferbase256081925,000 requests/month; 100 requests and $0.50 usage/day shared
Qwen 3 Embedding 8B (Inferbase)
qwen3-embedding-8b
Inferbase409681925,000 requests/month; 100 requests and $0.50 usage/day shared
Nemotron 3.5 Embed 1B (openrouter)
nvidia/nemotron-3.5-embed-1b:free
OpenRouter204832768Zero-priced routes; standard no-purchase free quota is 50 requests/day shared.
Nemotron 3.5 Embed 8B (openrouter)
nvidia/nemotron-3.5-embed-8b:free
OpenRouter409632768Zero-priced routes; standard no-purchase free quota is 50 requests/day shared.
Nemotron 3.5 Embed 1B (nvidia)
nvidia/nemotron-3.5-embed-1b
NVIDIA NIM204832768Free NVIDIA-hosted API prototyping; not a fixed monthly credit allocation or unrestricted production offer.
Nemotron 3.5 Embed 1B (inferbase)
nvidia-nemotron-3-5-embed-1b
Inferbase204881925,000 requests/month; managed chat, embeddings and rerank share 100 requests and $0.50 of model usage/day; no card.
Nemotron 3.5 Embed 8B (inferbase)
nvidia-nemotron-3-5-embed-8b
Inferbase409681925,000 requests/month; managed chat, embeddings and rerank share 100 requests and $0.50 of model usage/day; no card.
Nemotron 3.5 Embed 8B (NVIDIA)
nvidia/nemotron-3.5-embed-8b
NVIDIA NIM409632768Free NVIDIA-hosted API prototyping; development/testing only, not unrestricted production hosting or a fixed monthly credit allocation.
BGE-M3 (SEA-LION)
BAAI/bge-m3
SEA-LION10248192free · 10 rpm
Cohere Embed English v3
embed-english-v3.0
Cohere10245121K calls/mo (shared w/ chat)
Qwen3 Embedding 8B (OVH)
Qwen3-Embedding-8B
OVH AI Endpoints409632768free · anonymous 2 req/min per IP
BGE-M3 (OVH)
bge-m3
OVH AI Endpoints10248192free · anonymous 2 req/min per IP
BGE Multilingual Gemma2 (OVH)
bge-multilingual-gemma2
OVH AI Endpoints35848192free · anonymous 2 req/min per IP
Google: Gemini Embedding 2 (ElectronHub)
gemini-embedding-2
ElectronHub30728192$0.25/week shared free credits
Google: Gemini Embedding 001 (ElectronHub)
gemini-embedding-001
ElectronHub30722048$0.25/week shared free credits
OpenAI: Text Embedding Ada 002 (ElectronHub)
text-embedding-ada-002
ElectronHub15368192$0.25/week shared free credits
Cohere Embed English Light v3
embed-english-light-v3.0
Cohere3845121K calls/mo (shared w/ chat)
Cohere Embed Multilingual v3
embed-multilingual-v3.0
Cohere10245121K calls/mo (shared w/ chat)
Cohere Embed Multilingual Light v3
embed-multilingual-light-v3.0
Cohere3845121K calls/mo (shared w/ chat)
Cohere Embed v5.0-fast
embed-v5.0-fast
Cohere20481280001,000 API calls/month shared trial/evaluation key; production is paid
Cohere Embed v5.0-pro
embed-v5.0-pro
Cohere20481280001,000 API calls/month shared trial/evaluation key; production is paid
ELLM BGE M3 (JamAI)
ellm/BAAI/bge-m3
JamAI Base102481924M ELLM embedding tokens/month shared per organization

FreeLLMAPI कैटलॉग से लाइव डेटा (संस्करण 2026.12.04.516bad, जाँच 2026-12-04)। मुफ़्त सीमाएँ अक्सर बदलती हैं। कैटलॉग की हर दिन जाँच होती है।

FunctionAgent के साथ agent जोड़ें

FunctionAgent tool calling इस्तेमाल करता है। आप इसे query engine को एक tool के रूप में दे सकते हैं और अपने Python functions जोड़ सकते हैं।

agent.py

import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.core.tools import QueryEngineTool
from llama_index.core import Settings
from rag import load_index

docs_tool = QueryEngineTool.from_defaults(
    query_engine=load_index().as_query_engine(similarity_top_k=4),
    name="project_docs",
    description="Answers questions about the project documentation.",
)

def open_tickets(team: str) -> int:
    """Return the number of open tickets for a team."""
    return {"billing": 4, "platform": 11}.get(team, 0)

agent = FunctionAgent(
    tools=[docs_tool, open_tickets],
    llm=Settings.llm,
    system_prompt="Use the tools. Cite the document name in each answer.",
)

async def main():
    result = await agent.run("How many platform tickets are open, and how do we rotate keys?")
    print(result)

asyncio.run(main())

Agent काम के लिए tool calling वाले models चुनें। सिर्फ इन models के साथ एक fallback chain profile बनाएँ, और model नाम के रूप में auto:<profile> इस्तेमाल करें।

Tool calling और 128K+ context वाले मुफ़्त models
मॉडलमुफ़्त उपलब्धकॉन्टेक्स्टमुफ़्त सीमाएँ (सबसे अच्छा विकल्प)टूलविज़न
GLM 5.3UnoRouter1M1 अनुरोध/मिनट
1 req/min per model
हाँनहीं
GLM 5.3 FlashNVIDIA NIM, UnoRouter1M40 अनुरोध/मिनट
40 RPM
हाँहाँ
Gemini 3.8 FlashGoogle AI Studio1MRecurring provider quotaहाँहाँ
Qwen3.8 Flash NextAMD Radeon Cloud262KRecurring daily account allowanceहाँनहीं
Qwen3.8 FlashElectronHub1M$0.25/week shared recurring creditहाँहाँ
Gemini 3.7 FlashGoogle AI Studio1M10 अनुरोध/मिनट
20 अनुरोध/दिन
250,000 टोकन/मिनट
~3M
हाँहाँ
GPT-5.6 LunaElectronHub1M$0.25/week shared recurring creditहाँहाँ
DeepSeek V4 FlashAMD Radeon Cloud, BazaarLink, ElectronHub1M10 अनुरोध/मिनट
50 अनुरोध/दिन
Shared rate limit
हाँनहीं
Qwen3.8 27BElectronHub, Groq, OVH AI Endpoints262K30 अनुरोध/मिनट
250 अनुरोध/दिन
70,000 टोकन/मिनट
~6M
हाँहाँ
Gemini 3.6 FlashGoogle AI Studio1M10 अनुरोध/मिनट
20 अनुरोध/दिन
250,000 टोकन/मिनट
~3M
हाँहाँ

109 मिलते-जुलते मुफ़्त मॉडल में से 10 दिखाए जा रहे हैं। सभी मॉडल देखें.

FreeLLMAPI कैटलॉग से लाइव डेटा (संस्करण 2026.12.04.516bad, जाँच 2026-12-04)। मुफ़्त सीमाएँ अक्सर बदलती हैं। कैटलॉग की हर दिन जाँच होती है।

Ingestion को मुफ़्त limits के भीतर रखें

Ingestion थोड़े समय में कई embedding requests भेजता है। मुफ़्त embedding tiers की limits कम होती हैं। उदाहरण के लिए, कुछ हर मिनट 10 requests देते हैं, और कुछ calls महीने के हिसाब से गिनते हैं। पहला ingestion शुरू करने से पहले उसकी योजना बनाएँ।

  • बड़े chunks इस्तेमाल करें। कम chunks का मतलब कम vectors और कम requests है। लगभग 1,024 tokens का chunk size अच्छी शुरुआत है।
  • Batches इस्तेमाल करें। embed_batch_size को 16 या उससे ज़्यादा सेट करें। तब एक request में कई chunks जाते हैं।
  • Index सेव करें। पहले run के बाद index को सेव करें। वही फ़ाइलें फिर से embed न करें।
  • Retries चालू रखें। OpenAILikeEmbedding डिफ़ॉल्ट रूप से 10 बार तक retry करता है। लंबे ingestion jobs के लिए यह मान रखें।
  • हिस्सों में ingest करें। हज़ारों फ़ाइलों के लिए एक समय में एक folder ingest करें।

Queries, ingestion से सस्ती हैं। हर query एक embedding request और एक chat request इस्तेमाल करती है। 1,024 tokens वाले चार chunks के साथ एक chat request लगभग 5,000 tokens भेजती है। कम tokens-per-minute limits वाले मुफ़्त tiers इसे अस्वीकार कर सकते हैं। तब FreeLLMAPI अगला provider आज़माता है।

समस्या निवारण

समस्याकारणसमाधान
Unknown model 'auto'आपने OpenAI class इस्तेमाल कीOpenAILike इस्तेमाल करें
Requests /v1/completions पर जाती हैंis_chat_model सेट नहीं हैis_chat_model=True सेट करें
Agent tools call नहीं करताis_function_calling_model बंद है, या model में tool calling नहीं हैइसे True पर सेट करें और एक tools profile इस्तेमाल करें
Ingestion के दौरान error 429Embedding family सभी providers पर अपनी limit पर हैबड़े batches इस्तेमाल करें, Retry-After का इंतज़ार करें और फिर चलाएँ
Embedding model बदलने के बाद गलत जवाबएक index में दो families के vectorsसेव किया गया index हटाएँ और उसे फिर से बनाएँ
Context length errorcontext_window उस model से बड़ी है जिसने जवाब दियाछोटा मान सेट करें, या लंबे context वाला profile इस्तेमाल करें

देखने के लिए कि किस provider ने request का जवाब दिया, FreeLLMAPI dashboard इस्तेमाल करें। Analytics page हर provider और model के लिए requests, latency और errors दिखाता है। हर response में X-Routed-Via header भी होता है। अगर router ने provider बदला, तो X-Fallback-Trail header हर विफल प्रयास और उसका कारण बताता है।

इनमें से हर एक का उपयोग एक ही कुंजी से करें। FreeLLMAPI एक ओपन-सोर्स, सेल्फ़-होस्टेड राउटर है। यह इन सभी मुफ़्त टियर को एक OpenAI-संगत एंडपॉइंट के पीछे रखता है। जब कोई एक सीमा पर पहुँचता है, तो यह अगले प्रदाता पर स्विच कर देता है। कैटलॉग देखें या शुरू करें.

अक्सर पूछे जाने वाले प्रश्न

क्या LlamaIndex के साथ मुफ़्त LLM इस्तेमाल किया जा सकता है?

हाँ। OpenAILike इस्तेमाल करें, जिसमें api_base एक OpenAI-compatible URL पर सेट हो। FreeLLMAPI कई मुफ़्त provider tiers के लिए एक URL देता है। हर tier की अपनी limits होती हैं।

LlamaIndex में OpenAI और OpenAILike में क्या अंतर है?

OpenAI class model नामों को OpenAI models से जाँचती है। OpenAILike कोई भी model नाम स्वीकार करती है। Context window और chat व function-calling flags आप खुद सेट करते हैं।

LlamaIndex के लिए कौन सा मुफ़्त embedding model सबसे अच्छा है?

ऐसी family चुनें जिसमें आपकी ingestion के लिए पर्याप्त मुफ़्त requests हों, और उसे पूरे index के लिए रखें। bge-m3 family कई providers पर मुफ़्त है, इसलिए failover उनके बीच जा सकता है।

क्या FunctionAgent मुफ़्त models के साथ काम करता है?

हाँ, अगर model tool calling सपोर्ट करता है और आपने is_function_calling_model=True सेट किया है। ऐसा fallback chain profile इस्तेमाल करें जिसमें सिर्फ tool-calling models हों।

LlamaIndex index बनाते समय rate limits से कैसे बचें?

बड़े chunks इस्तेमाल करें, embed_batch_size को 16 या उससे ज़्यादा सेट करें, index सेव करें और बड़े folders को हिस्सों में ingest करें।

संबंधित गाइड

स्रोत

सभी गाइड · सभी मुफ़्त मॉडल देखें