LangChain-നായി സൗജന്യ LLM API
LangChain ChatOpenAI, OpenAIEmbeddings എന്നിവ വഴി OpenAI-അനുയോജ്യ API-കളുമായി ബന്ധപ്പെടുന്നു. നിങ്ങൾ ബേസ് URLഉം കീയും മാറ്റുന്നു. ഈ ഗൈഡ് രണ്ട് ക്ലാസുകളെയും FreeLLMAPI-യിലേക്ക് നയിക്കുന്നു. FreeLLMAPI ഒരൊറ്റ കീയ്ക്കു പിന്നിൽ 45 സൗജന്യ ദാതാവ് ടയറുകൾ ഒരുമിപ്പിക്കുന്നു. താഴെയുള്ള കോഡ് Python, JavaScript എന്നിവയിൽ പ്രവർത്തിക്കുകയും നിരക്ക് പരിധികൾ കൈകാര്യം ചെയ്യുകയും ചെയ്യുന്നു.
കോഡ്, മോഡൽ പേരുകളും തത്സമയ കാറ്റലോഗ് ലേബലുകളും ഇംഗ്ലീഷിൽ കാണിക്കുന്നു.
ഗേറ്റ്വേയും പാക്കേജുകളും സജ്ജമാക്കുക
FreeLLMAPI ഇൻസ്റ്റാൾ ചെയ്ത്, ഡാഷ്ബോർഡിലെ Keys പേജിൽ രണ്ടോ അതിലധികമോ ദാതാക്കളിൽ നിന്നുള്ള സൗജന്യ കീകൾ ചേർക്കുക. ഏകീകൃത കീ പകർത്തുക. നിങ്ങളുടെ കോഡ് ഈ കീ മാത്രം ഉപയോഗിക്കുന്നു. ദാതാവിന്റെ കീകൾ FreeLLMAPI-യിൽ തന്നെ തുടരുന്നു.
FreeLLMAPI-യും LangChain പാക്കേജുകളും ഇൻസ്റ്റാൾ ചെയ്യുക
curl -fsSL https://freellmapi.co/install.sh | bash
# Python
pip install -U langchain langchain-openai
# JavaScript
npm install @langchain/openai @langchain/core zodഎൻവയോൺമെന്റ് വേരിയബിളുകൾ
export FREELLMAPI_BASE_URL=http://localhost:3001/v1
export FREELLMAPI_API_KEY=<unified-key>റൂട്ടർ മോഡൽ തിരഞ്ഞെടുക്കാൻ model="auto" ഉപയോഗിക്കുക. auto:fast അല്ലെങ്കിൽ auto:smart പോലുള്ള ഒരു റൂട്ടിംഗ് തന്ത്രവും ഉപയോഗിക്കാം. auto:coding പോലുള്ള പേരുള്ള പ്രൊഫൈലും കാറ്റലോഗിൽ നിന്നുള്ള ഒരു നിശ്ചിത മോഡൽ ID-യും പ്രവർത്തിക്കുന്നു.
നിങ്ങളുടെ കീകൾക്ക് ഇപ്പോൾ വിളിക്കാൻ കഴിയുന്ന മോഡലുകൾ കാണാൻ, GET /v1/models?execution_status=ready അഭ്യർഥിക്കുക. മുഴുവൻ പട്ടികയിൽ കീ ഇല്ലാത്ത മോഡലുകളും ഉൾപ്പെടുന്നു. exhausted എന്ന നിലയുള്ള മോഡലിന് കീകളുണ്ട്, പക്ഷേ ഈ നിമിഷം അവയെല്ലാം പരിധിയിലാണ്. കൂൾഡൗൺ കഴിയുമ്പോൾ ആ നില മാറുന്നു.
ഇപ്പോൾ ഉത്തരം നൽകാൻ കഴിയുന്ന മോഡലുകൾ പട്ടികപ്പെടുത്തുക
curl "http://localhost:3001/v1/models?execution_status=ready" \
-H "Authorization: Bearer <unified-key>"ChatOpenAI ഉപയോഗിച്ച് ചാറ്റ് ചെയ്യുക
Python-ൽ base_url, api_key സജ്ജമാക്കുക. max_retries മൂല്യം OpenAI ക്ലയന്റിലേക്ക് പോകുന്നു. ക്ലയന്റ് 429, 5xx പിശകുകൾ എക്സ്പോണൻഷ്യൽ ബാക്ക്ഓഫോടെ വീണ്ടും ശ്രമിക്കുന്നു.
Python: ചാറ്റും സ്ട്രീമിംഗും
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="auto",
base_url=os.environ["FREELLMAPI_BASE_URL"],
api_key=os.environ["FREELLMAPI_API_KEY"],
temperature=0.2,
max_retries=3,
timeout=60,
include_response_headers=True,
)
msg = llm.invoke("Explain retrieval-augmented generation in two sentences.")
print(msg.content)
print("Served by:", msg.response_metadata["headers"].get("x-routed-via"))
for chunk in llm.stream("Write a haiku about SQLite."):
print(chunk.content, end="", flush=True)JavaScript-ൽ ബേസ് URL configuration.baseURL-ൽ ഇടുക. configuration ഓബ്ജക്റ്റ് ഔദ്യോഗിക OpenAI SDK ക്ലയന്റിലേക്ക് പോകുന്നു.
JavaScript: ചാറ്റും സ്ട്രീമിംഗും
import { ChatOpenAI } from "@langchain/openai";
const llm = new ChatOpenAI({
model: "auto",
apiKey: process.env.FREELLMAPI_API_KEY,
temperature: 0.2,
maxRetries: 3,
configuration: { baseURL: process.env.FREELLMAPI_BASE_URL },
});
const msg = await llm.invoke("Explain retrieval-augmented generation in two sentences.");
console.log(msg.content);
for await (const chunk of await llm.stream("Write a haiku about SQLite.")) {
process.stdout.write(String(chunk.content));
}x-routed-via ഹെഡർ ഉത്തരം നൽകിയ ദാതാവിനെയും മോഡലിനെയും കാണിക്കുന്നു. റൂട്ടർ ദാതാവ് മാറ്റിയാൽ, x-fallback-trail ഓരോ പരാജയ ശ്രമവും അതിന്റെ കാരണവും കാണിക്കുന്നു.
ടൂളുകളും ഏജന്റുകളും
FreeLLMAPI OpenAI-ശൈലിയിലുള്ള tools ഓരോ ദാതാവിനും കൈമാറുകയും OpenAI ഫോർമാറ്റിൽ tool_calls തിരികെ നൽകുകയും ചെയ്യുന്നു. Gemini-ക്ക് ഇത് അഭ്യർഥനയെ Google-ന്റെ ഫോർമാറ്റിലേക്ക് മാറ്റുകയും തിരികെ മാറ്റുകയും ചെയ്യുന്നു. ഒരു കോളിന് bind_tools ഉപയോഗിക്കുക, അല്ലെങ്കിൽ ടൂളുകൾ പ്രവർത്തിപ്പിക്കുന്ന ഒരു ലൂപ്പിന് create_agent ഉപയോഗിക്കുക.
Python: bind_tools, create_agent
from langchain.agents import create_agent
from langchain_core.tools import tool
@tool
def get_weather(city: str) -> str:
"""Return the current weather for a city."""
return f"It is 18 C and cloudy in {city}."
# One call: the model returns the tool call, your code runs it
msg = llm.bind_tools([get_weather]).invoke("What is the weather in Dublin?")
print(msg.tool_calls)
# Agent loop: LangChain runs the tool and sends the result back
agent = create_agent(
model=llm,
tools=[get_weather],
system_prompt="You answer weather questions. Use the tool.",
)
result = agent.invoke({"messages": [{"role": "user", "content": "Weather in Dublin?"}]})
print(result["messages"][-1].content)JavaScript: bindTools
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const getWeather = tool(
async ({ city }) => `It is 18 C and cloudy in ${city}.`,
{
name: "get_weather",
description: "Return the current weather for a city.",
schema: z.object({ city: z.string() }),
},
);
const reply = await llm.bindTools([getWeather]).invoke("What is the weather in Dublin?");
console.log(reply.tool_calls);ചില സൗജന്യ മോഡലുകൾ മാത്രമേ ടൂൾ കോളിംഗ് പിന്തുണയ്ക്കുന്നുള്ളൂ. auto ഉപയോഗിക്കുമ്പോൾ, ടൂൾ കോളിംഗ് മോഡലുകൾ നിങ്ങളുടെ ഫോൾബാക്ക് ശൃംഖലയിൽ നിലനിർത്തുക, അല്ലെങ്കിൽ ഏജന്റുകൾക്ക് ഒരു പ്രൊഫൈൽ ഉണ്ടാക്കുക. ഇന്ന് ഈ സൗജന്യ മോഡലുകൾ ടൂളുകളെ പിന്തുണയ്ക്കുന്നു:
| മോഡൽ | സൗജന്യമായി ലഭ്യം | കോൺടെക്സ്റ്റ് | സൗജന്യ പരിധികൾ (ഏറ്റവും മികച്ച ഓഫർ) | ടൂളുകൾ | ദൃശ്യ ശേഷി |
|---|---|---|---|---|---|
| GLM 5.3 | UnoRouter | 1M | 1 അഭ്യർഥന/മിനിറ്റ് 1 req/min per model | അതെ | ഇല്ല |
| GLM 5.3 Flash | NVIDIA NIM, UnoRouter | 1M | 40 അഭ്യർഥന/മിനിറ്റ് 40 RPM | അതെ | അതെ |
| Gemini 3.8 Flash | Google AI Studio | 1M | Recurring provider quota | അതെ | അതെ |
| Qwen3.8 Flash Next | AMD Radeon Cloud | 262K | Recurring daily account allowance | അതെ | ഇല്ല |
| Qwen3.8 Flash | ElectronHub | 1M | $0.25/week shared recurring credit | അതെ | അതെ |
| Gemini 3.7 Flash | Google AI Studio | 1M | 10 അഭ്യർഥന/മിനിറ്റ് 20 അഭ്യർഥന/ദിവസം 250,000 ടോക്കൺ/മിനിറ്റ് ~3M | അതെ | അതെ |
| GPT-5.6 Luna | ElectronHub | 1M | $0.25/week shared recurring credit | അതെ | അതെ |
| Dots3 Note Preview | Kilo Gateway, OpenRouter | 512K | 20 അഭ്യർഥന/മിനിറ്റ് 50 അഭ്യർഥന/ദിവസം 50 req/day account-wide (1,000 after a $10 purchase) | അതെ | അതെ |
| DeepSeek V4 Flash | AMD Radeon Cloud, BazaarLink, ElectronHub | 1M | 10 അഭ്യർഥന/മിനിറ്റ് 50 അഭ്യർഥന/ദിവസം Shared rate limit | അതെ | ഇല്ല |
| Qwen3.8 27B | ElectronHub, Groq, OVH AI Endpoints | 262K | 30 അഭ്യർഥന/മിനിറ്റ് 250 അഭ്യർഥന/ദിവസം 70,000 ടോക്കൺ/മിനിറ്റ് ~6M | അതെ | അതെ |
പൊരുത്തപ്പെടുന്ന 109 സൗജന്യ മോഡലുകളിൽ 10 എണ്ണം കാണിക്കുന്നു. എല്ലാ മോഡലുകളും കാണുക.
FreeLLMAPI കാറ്റലോഗിൽ നിന്നുള്ള തത്സമയ ഡാറ്റ (പതിപ്പ് 2026.11.19, 2026-11-19 ൽ പരിശോധിച്ചത്). സൗജന്യ പരിധികൾ പലപ്പോഴും മാറുന്നു. കാറ്റലോഗ് എല്ലാ ദിവസവും പരിശോധിക്കുന്നു.
OpenAIEmbeddings ഉപയോഗിച്ചുള്ള എംബെഡിംഗുകൾ
സ്ഥിരസ്ഥിതിയായി, Python-ലെ OpenAIEmbeddings ടെക്സ്റ്റിനെ OpenAI ടോക്കനൈസർ ഉപയോഗിച്ച് വിഭജിച്ച് ടോക്കണുകൾ അയയ്ക്കുന്നു. മറ്റ് മിക്ക ദാതാക്കൾക്കും അസംസ്കൃത ടെക്സ്റ്റ് ആവശ്യമാണ്. ടെക്സ്റ്റ് അയയ്ക്കാൻ check_embedding_ctx_length=False സജ്ജമാക്കുക.
Python: എംബെഡിംഗുകൾ
from langchain_openai import OpenAIEmbeddings
emb = OpenAIEmbeddings(
model="bge-m3", # one embedding family, 1024 dimensions
base_url=os.environ["FREELLMAPI_BASE_URL"],
api_key=os.environ["FREELLMAPI_API_KEY"],
check_embedding_ctx_length=False,
)
vectors = emb.embed_documents(["FreeLLMAPI pools free tiers.", "LangChain builds LLM apps."])
print(len(vectors), len(vectors[0]))JavaScript: എംബെഡിംഗുകൾ
import { OpenAIEmbeddings } from "@langchain/openai";
const emb = new OpenAIEmbeddings({
model: "bge-m3",
apiKey: process.env.FREELLMAPI_API_KEY,
configuration: { baseURL: process.env.FREELLMAPI_BASE_URL },
});
const vector = await emb.embedQuery("What does FreeLLMAPI do?");
console.log(vector.length);FreeLLMAPI-യിലെ എംബെഡിംഗ് ഫെയിൽഓവർ ഒരിക്കലും മോഡൽ മാറ്റുന്നില്ല. ഒരേ കുടുംബം നൽകുന്ന ദാതാക്കൾക്കിടയിൽ മാത്രമേ അത് നീങ്ങുന്നുള്ളൂ. ഇത് ഒരു വെക്ടർ സ്റ്റോറിലെ എല്ലാ വെക്ടറുകളും പൊരുത്തപ്പെടുന്നതായി നിലനിർത്തുന്നു. ഒരു കുടുംബം തിരഞ്ഞെടുത്ത് അത് നിലനിർത്തുക. ഇന്നത്തെ സൗജന്യ എംബെഡിംഗ് മോഡലുകൾ ഇവയാണ്:
| മോഡൽ | ദാതാവ് | ഡൈമെൻഷനുകൾ | പരമാവധി ഇൻപുട്ട് | സൗജന്യ പരിധി |
|---|---|---|---|---|
Gemini Embeddinggemini-embedding-001 | Google AI Studio | 3072 | 2048 | 100 rpm · 1K req/day |
Nemotron Embed VL 1Bnvidia/llama-nemotron-embed-vl-1b-v2 | NVIDIA NIM | 2048 | 8192 | ~40 rpm |
Nemotron 3 Embed 1B (OR free)nvidia/nemotron-3-embed-1b:free | OpenRouter | 2048 | 32768 | 20 rpm · shared free daily cap |
SEA-LION E5 Embedding 600Maisingapore/SEA-LION-E5-Embedding-600M | SEA-LION | 1024 | 8192 | free · 10 rpm |
SEA-LION ModernBERT Embedding 300Maisingapore/SEA-LION-ModernBERT-Embedding-300M | SEA-LION | 1024 | 8192 | free · 10 rpm |
SEA-LION ModernBERT Embedding 600Maisingapore/SEA-LION-ModernBERT-Embedding-600M | SEA-LION | 1024 | 8192 | free · 10 rpm |
BGE-M3@cf/baai/bge-m3 | Cloudflare Workers AI | 1024 | 8192 | 10K neurons/day (shared) |
EmbeddingGemma 300M@cf/google/embeddinggemma-300m | Cloudflare Workers AI | 768 | 2048 | 10K neurons/day (shared) |
Qwen3 Embedding 0.6B@cf/qwen/qwen3-embedding-0.6b | Cloudflare Workers AI | 1024 | 8192 | 10K neurons/day (shared) |
Cohere Embed v4embed-v4.0 | Cohere | 1536 | 128000 | 1K calls/mo (shared w/ chat) |
Gemini Embedding 2gemini-embedding-2 | Google AI Studio | 3072 | 8192 | free-tier rate limited |
Nemotron 3 Embed 1Bnvidia/nemotron-3-embed-1b | NVIDIA NIM | 2048 | 4096 | ~40 rpm |
PLaMo Embedding 1B (CF)@cf/pfnet/plamo-embedding-1b | Cloudflare Workers AI | 2048 | 4096 | 10K neurons/day (shared) |
BGE Small EN v1.5 (CF)@cf/baai/bge-small-en-v1.5 | Cloudflare Workers AI | 384 | 512 | 10K neurons/day (shared) |
BGE Base EN v1.5 (CF)@cf/baai/bge-base-en-v1.5 | Cloudflare Workers AI | 768 | 512 | 10K neurons/day (shared) |
BGE Large EN v1.5 (CF)@cf/baai/bge-large-en-v1.5 | Cloudflare Workers AI | 1024 | 512 | 10K neurons/day (shared) |
Mistral Embedmistral-embed | Mistral | 1024 | 8192 | free mode · monthly cap (shared) |
Codestral Embedcodestral-embed | Mistral | 1536 | 8192 | free mode · monthly cap (shared) |
Llama Text Embed v2 (Pinecone)llama-text-embed-v2 | Pinecone | 1024 | 2048 | 5M tokens/mo per model |
Multilingual E5 Large (Pinecone)multilingual-e5-large | Pinecone | 1024 | 507 | 5M tokens/mo per model |
Nemotron 3 Embed 1B (Speka)nvidia/nemotron-3-embed-1b | Speka | 2048 | 8192 | $1/month shared across Speka models |
OpenAI: Text Embedding 3 Small (ElectronHub)text-embedding-3-small | ElectronHub | 1536 | 8192 | $0.25/week shared free credits |
OpenAI: Text Embedding 3 Large (ElectronHub)text-embedding-3-large | ElectronHub | 3072 | 8192 | $0.25/week shared free credits |
Nemotron 3 Embed 8B (Inferbase)nvidia-nemotron-3-embed-8b | Inferbase | 4096 | 8192 | 5,000 requests/month; 100 requests and $0.50 usage/day shared |
Qwen 3 Embedding 0.6B (Inferbase)qwen3-embedding-0-6b | Inferbase | 1024 | 8192 | 5,000 requests/month; 100 requests and $0.50 usage/day shared |
Qwen 3 Embedding 4B (Inferbase)qwen3-embedding-4b | Inferbase | 2560 | 8192 | 5,000 requests/month; 100 requests and $0.50 usage/day shared |
Qwen 3 Embedding 8B (Inferbase)qwen3-embedding-8b | Inferbase | 4096 | 8192 | 5,000 requests/month; 100 requests and $0.50 usage/day shared |
LFM2.5 Embedding 350M (LLMTR)liquid/lfm-2.5-embedding-350m-free | LLMTR | 1024 | 512 | Ongoing zero-price route; provider terms apply |
BGE-M3 (SEA-LION)BAAI/bge-m3 | SEA-LION | 1024 | 8192 | free · 10 rpm |
Cohere Embed English v3embed-english-v3.0 | Cohere | 1024 | 512 | 1K calls/mo (shared w/ chat) |
Qwen3 Embedding 8B (OVH)Qwen3-Embedding-8B | OVH AI Endpoints | 4096 | 32768 | free · anonymous 2 req/min per IP |
BGE-M3 (OVH)bge-m3 | OVH AI Endpoints | 1024 | 8192 | free · anonymous 2 req/min per IP |
BGE Multilingual Gemma2 (OVH)bge-multilingual-gemma2 | OVH AI Endpoints | 3584 | 8192 | free · anonymous 2 req/min per IP |
Mistral: Codestral Embed (ElectronHub)codestral-embed | ElectronHub | 1536 | 8192 | $0.25/week shared free credits |
Mistral: Mistral Embed (ElectronHub)mistral-embed | ElectronHub | 1024 | 8192 | $0.25/week shared free credits |
Google: Gemini Embedding 2 (ElectronHub)gemini-embedding-2 | ElectronHub | 3072 | 8192 | $0.25/week shared free credits |
Google: Gemini Embedding 001 (ElectronHub)gemini-embedding-001 | ElectronHub | 3072 | 2048 | $0.25/week shared free credits |
OpenAI: Text Embedding Ada 002 (ElectronHub)text-embedding-ada-002 | ElectronHub | 1536 | 8192 | $0.25/week shared free credits |
Cohere Embed English Light v3embed-english-light-v3.0 | Cohere | 384 | 512 | 1K calls/mo (shared w/ chat) |
Cohere Embed Multilingual v3embed-multilingual-v3.0 | Cohere | 1024 | 512 | 1K calls/mo (shared w/ chat) |
Cohere Embed Multilingual Light v3embed-multilingual-light-v3.0 | Cohere | 384 | 512 | 1K calls/mo (shared w/ chat) |
FreeLLMAPI കാറ്റലോഗിൽ നിന്നുള്ള തത്സമയ ഡാറ്റ (പതിപ്പ് 2026.11.19, 2026-11-19 ൽ പരിശോധിച്ചത്). സൗജന്യ പരിധികൾ പലപ്പോഴും മാറുന്നു. കാറ്റലോഗ് എല്ലാ ദിവസവും പരിശോധിക്കുന്നു.
ഘടനാപരമായ ഔട്ട്പുട്ട്, സെഷനുകൾ, മോഡൽ തിരഞ്ഞെടുപ്പ്
with_structured_output ടെക്സ്റ്റിന് പകരം ഒരു Pydantic ഓബ്ജക്റ്റ് തിരികെ നൽകുന്നു. സ്ഥിരസ്ഥിതിയായി LangChain ഇതിന് ഫംഗ്ഷൻ കോളിംഗ് ഉപയോഗിക്കുന്നു. ടൂളുകളെ പിന്തുണയ്ക്കുന്ന ഓരോ സൗജന്യ മോഡലിലും ഈ രീതി പ്രവർത്തിക്കുന്നു.
Python: ഘടനാപരമായ ഔട്ട്പുട്ട്
from pydantic import BaseModel, Field
class Ticket(BaseModel):
category: str = Field(description="billing, bug or other")
urgent: bool
classifier = llm.with_structured_output(Ticket)
ticket = classifier.invoke("The app crashes when I pay. Please fix it today.")
print(ticket.category, ticket.urgent)method="json_schema" ഉപയോഗിക്കരുത്, auto ഉപയോഗിക്കുമ്പോൾ. എല്ലാ സൗജന്യ ദാതാക്കളും കർശനമായ JSON സ്കീമ ഔട്ട്പുട്ട് പിന്തുണയ്ക്കുന്നില്ല, റൂട്ടർ ഓരോ അഭ്യർഥനയ്ക്കും വ്യത്യസ്ത ദാതാവിനെ തിരഞ്ഞെടുത്തേക്കാം.
FreeLLMAPI ഒരു സംഭാഷണം 30 മിനിറ്റ് ഒരേ മോഡലിൽ നിലനിർത്തുന്നു. X-Session-Id ഹെഡറിൽ നിന്ന് അത് സംഭാഷണത്തെ കണ്ടെത്തുന്നു. ഹെഡർ ഇല്ലെങ്കിൽ, ആദ്യത്തെ ഉപയോക്തൃ സന്ദേശത്തിന്റെ ഹാഷ് ഉപയോഗിക്കുന്നു. ധാരാളം ഉപയോക്താക്കളുള്ള ചാറ്റ് ആപ്പിന്, ഓരോ ഉപയോക്താവിനും ഒരു സെഷൻ ID അയയ്ക്കുക:
Python: ഓരോ ഉപയോക്താവിനും ഒരു സെഷൻ
def llm_for(user_id: str) -> ChatOpenAI:
return ChatOpenAI(
model="auto",
base_url=os.environ["FREELLMAPI_BASE_URL"],
api_key=os.environ["FREELLMAPI_API_KEY"],
default_headers={"X-Session-Id": f"user-{user_id}"},
max_retries=3,
)നിങ്ങളുടെ ആപ്പിന്റെ ഓരോ ഭാഗത്തിനുമുള്ള മോഡൽ സ്ട്രിംഗ് തിരഞ്ഞെടുക്കുക:
| നിങ്ങളുടെ ആപ്പിലെ ജോലി | മോഡൽ സ്ട്രിംഗ് | കാരണം |
|---|---|---|
| ഉപയോക്താക്കൾക്കുള്ള ചാറ്റ് ഉത്തരങ്ങൾ | auto | ഡാഷ്ബോർഡിൽ നിങ്ങൾ സജ്ജമാക്കിയ ശൃംഖല പിന്തുടരുന്നു |
| ടൂളുകളുള്ള ഏജന്റ് | auto:<profile> | ടൂൾ കോളിംഗ് മോഡലുകൾ മാത്രമുള്ള ഒരു പ്രൊഫൈൽ |
| വർഗ്ഗീകരണം, റൂട്ടിംഗ്, ചെറിയ സംഗ്രഹങ്ങൾ | auto:fast | അളന്ന വേഗത അനുസരിച്ച് മോഡലുകളെ റാങ്ക് ചെയ്യുന്നു |
| കഠിനമായ യുക്തി ഘട്ടങ്ങൾ | auto:smart | ബുദ്ധിശക്തി അനുസരിച്ച് മോഡലുകളെ റാങ്ക് ചെയ്യുന്നു |
| ആവർത്തിക്കാനാകണം എന്നുള്ള പരിശോധനകൾ | ഒരു നിശ്ചിത മോഡൽ ID | ഓരോ തവണയും ഒരേ മോഡൽ, പക്ഷേ ആ മോഡലിന്റെ പരിധിയിൽ അത് നിൽക്കുന്നു |
സൗജന്യ ടയറുകൾക്ക് SLA ഇല്ല. ദിവസത്തിനിടയിൽ ലേറ്റൻസി മാറുന്നു, ഏറ്റവും ശക്തമായ മോഡലുകൾ ആദ്യം പ്രതിദിന പരിധിയിലെത്തുന്നു. നിങ്ങളുടെ ശൃംഖല യഥാർത്ഥത്തിൽ ഉപയോഗിക്കുന്ന മോഡലുകളുപയോഗിച്ച് ശൃംഖലകൾ പരീക്ഷിക്കുക.
നിരക്ക് പരിധികളും റീട്രൈകളും
ഒരു ദാതാവ് 429 നൽകുമ്പോൾ FreeLLMAPI അടുത്ത ദാതാവിനെ പരീക്ഷിക്കുന്നു. ശൃംഖലയിലെ എല്ലാ കീകളും പരിധിയിലാകുമ്പോൾ മാത്രമേ നിങ്ങളുടെ കോഡ് 429 കാണുന്നുള്ളൂ. അപ്പോൾ പ്രതികരണത്തിൽ Retry-After ഹെഡർ ഉണ്ടാകും. പല പ്രതിദിന പരിധികളും UTC അർധരാത്രിയിൽ റീസെറ്റ് ചെയ്യുന്നു.
ബാച്ച് ജോലികൾക്ക്, with_retry ഉപയോഗിച്ച് രണ്ടാമതൊരു റീട്രൈ ലെയർ ചേർക്കുക. ഇത് എക്സ്പോണൻഷ്യൽ ബാക്ക്ഓഫും ജിറ്ററും ഉപയോഗിച്ച് മുഴുവൻ റണ്ണബിളും വീണ്ടും ശ്രമിക്കുന്നു.
Python: നിരക്ക് പരിധിയിൽ ഒരു ചെയിൻ വീണ്ടും ശ്രമിക്കുക
import openai
from langchain_core.prompts import ChatPromptTemplate
prompt = ChatPromptTemplate.from_messages([
("system", "Summarize the text in one sentence."),
("user", "{text}"),
])
chain = (prompt | llm).with_retry(
retry_if_exception_type=(openai.RateLimitError, openai.APITimeoutError),
wait_exponential_jitter=True,
stop_after_attempt=5,
)
# batch() runs requests in parallel; max_concurrency keeps the rate low
results = chain.batch(
[{"text": t} for t in ["First document.", "Second document."]],
config={"max_concurrency": 4},
)| പ്രശ്നം | കാരണം | പരിഹാരം |
|---|---|---|
openai.AuthenticationError | തെറ്റായ ഏകീകൃത കീ | Keys പേജിൽ നിന്ന് കീ വീണ്ടും പകർത്തുക |
എല്ലാ കോളിലും openai.NotFoundError | ബേസ് URL-ൽ /v1 ഇല്ല | http://localhost:3001/v1 ഉപയോഗിക്കുക |
openai.RateLimitError | ശൃംഖലയിലെ എല്ലാ കീകളും പരിധിയിലാണ് | ദാതാക്കളെ ചേർക്കുക, max_concurrency കുറയ്ക്കുക, അല്ലെങ്കിൽ Retry-After വരെ കാത്തിരിക്കുക |
| ടോക്കണുകളെക്കുറിച്ചോ ഇൻപുട്ട് തരത്തെക്കുറിച്ചോ ഉള്ള എംബെഡിംഗ് പിശക് | LangChain ടെക്സ്റ്റിന് പകരം ടോക്കണുകൾ അയയ്ക്കുന്നു | check_embedding_ctx_length=False സജ്ജമാക്കുക |
tool_calls ശൂന്യമാണ് | മോഡൽ ടൂളുകളെ പിന്തുണയ്ക്കുന്നില്ല | ടൂൾസ് പട്ടികയിൽ നിന്നുള്ള ഒരു മോഡലോ ടൂൾസ് പ്രൊഫൈലോ ഉപയോഗിക്കുക |
| യുക്തി ടെക്സ്റ്റ് കാണുന്നില്ല | ChatOpenAI സ്റ്റാൻഡേർഡ് OpenAI ഫീൽഡുകൾ മാത്രം സൂക്ഷിക്കുന്നു | ഉത്തരം content-ൽ വായിക്കുക; അധിക ദാതാവ് ഫീൽഡുകൾ സൂക്ഷിക്കുന്നില്ല |
പതിവ് ചോദ്യങ്ങൾ
LangChain-ൽ സൗജന്യ LLM API ഉപയോഗിക്കാമോ?
ഉപയോഗിക്കാം. ഏത് OpenAI-അനുയോജ്യ API-യും ChatOpenAI-യോടൊപ്പം പ്രവർത്തിക്കുന്നു. base_url-ഉം http://localhost:3001/v1 എന്നും api_key-ഉം നിങ്ങളുടെ FreeLLMAPI ഏകീകൃത കീയും ആയി സജ്ജമാക്കുക. റൂട്ടർ സൗജന്യ ദാതാവ് ടയറുകൾ ഉപയോഗിക്കുന്നു.
LangChain ChatOpenAI-യിൽ ഇഷ്ടാനുസൃത ബേസ് URL എങ്ങനെ സജ്ജമാക്കാം?
Python-ൽ, ChatOpenAI-ക്ക് base_url പാസ്സ് ചെയ്യുക. JavaScript-ൽ, കൺസ്ട്രക്ടറിന് configuration: { baseURL } പാസ്സ് ചെയ്യുക. Python-ൽ OPENAI_BASE_URL എൻവയോൺമെന്റ് വേരിയബിളും പ്രവർത്തിക്കുന്നു.
സൗജന്യ മോഡലുകളിൽ LangChain ഏജന്റുകൾ പ്രവർത്തിക്കുമോ?
മോഡൽ ടൂൾ കോളിംഗ് പിന്തുണയ്ക്കുന്നെങ്കിൽ പ്രവർത്തിക്കും. ChatOpenAI മോഡലിനൊപ്പം create_agent ഉപയോഗിക്കുക, ടൂൾ കോളിംഗ് മോഡലുകൾ നിങ്ങളുടെ FreeLLMAPI ശൃംഖലയിൽ നിലനിർത്തുക.
OpenAI ഇതര ദാതാവിനൊപ്പം OpenAIEmbeddings പരാജയപ്പെടുന്നത് എന്തുകൊണ്ട്?
സ്ഥിരസ്ഥിതിയായി ഇത് ടോക്കൺ ID-കൾ അയയ്ക്കുന്നു. മറ്റ് മിക്ക ദാതാക്കൾക്കും അസംസ്കൃത ടെക്സ്റ്റ് ആവശ്യമാണ്. Python-ൽ check_embedding_ctx_length=False സജ്ജമാക്കുക.
LangChain-ൽ 429 പിശകുകൾ എങ്ങനെ കൈകാര്യം ചെയ്യാം?
ChatOpenAI-ൽ max_retries സജ്ജമാക്കുക, ബാച്ച് ജോലികൾക്ക് ചെയിനിൽ with_retry ചേർക്കുക. നിങ്ങളുടെ കോഡ് 429 കാണുന്നതിന് മുമ്പ് FreeLLMAPI അടുത്ത ദാതാവിലേക്ക് മാറിക്കഴിഞ്ഞിരിക്കും.
അനുബന്ധ ഗൈഡുകൾ
- LlamaIndex-നുള്ള സൗജന്യ LLM
- Python-ൽ സൗജന്യ LLM API
- RAG-നുള്ള സൗജന്യ LLM API
- സൗജന്യ embeddings API
- Function calling ഉള്ള സൗജന്യ LLM API
- AI ഏജന്റുകൾക്കുള്ള സൗജന്യ LLM API
ഉറവിടങ്ങൾ
- LangChain docs: ChatOpenAI integration (Python) (20 November 2026 ൽ പരിശോധിച്ചത്)
- LangChain docs: ChatOpenAI integration (JavaScript) (20 November 2026 ൽ പരിശോധിച്ചത്)
- LangChain docs: agents and create_agent (20 November 2026 ൽ പരിശോധിച്ചത്)
- LangChain source: OpenAIEmbeddings note on OpenAI-compatible APIs (20 November 2026 ൽ പരിശോധിച്ചത്)
- OpenAI Python SDK: retries and errors (20 November 2026 ൽ പരിശോധിച്ചത്)
- FreeLLMAPI docs: REST API (tool calling, embeddings, response headers) (20 November 2026 ൽ പരിശോധിച്ചത്)