function calling తో ఉచిత LLM API
Function calling, లేదా tool calling, ఒక LLM మీ కోడ్ను ఒక function నడపమని అడగడానికి అనుమతిస్తుంది. ఏజెంట్లు, లైవ్ డేటాతో చాట్ బాట్లు మరియు నిర్మాణాత్మక extraction అన్నీ దీనిని ఉపయోగిస్తాయి. FreeLLMAPI కేటలాగ్లో tool calling తో 190 ఉచిత మోడల్ ఆఫర్లు ఉన్నాయి. మీరు OpenAI-శైలి tools పంపుతారు, మరియు గేట్వే వాటిని ప్రతి ప్రొవైడర్ కోసం అనువదిస్తుంది.
కోడ్, మోడల్ పేర్లు మరియు ప్రత్యక్ష కేటలాగ్ లేబుల్లు ఇంగ్లీషులోనే చూపబడతాయి.
FreeLLMAPI ద్వారా tool calling ఎలా పనిచేస్తుంది
- మీరు messages మరియు
toolsజాబితాను పంపుతారు. ప్రతి tool కు పేరు, వివరణ మరియు దాని పరామితుల కోసం JSON Schema ఉంటాయి. - మోడల్
tool_callsమరియుfinish_reason: "tool_calls"తో సమాధానం ఇస్తుంది. అది స్వయంగా దేనినీ నడపదు. - మీ కోడ్ function ను నడుపుతుంది, మరియు ఫలితాన్ని
role: "tool"తో ఒక message గా జోడిస్తుంది. - మీరు సంభాషణను మళ్లీ పంపుతారు. మోడల్ ఫలితాన్ని ఉపయోగించి తుది సమాధానం వ్రాస్తుంది.
Groq, Cerebras, Mistral, OpenRouter మరియు Cloudflare వంటి OpenAI-అనుకూల ప్రొవైడర్లు అభ్యర్థనను అలాగే పొందుతాయి. Gemini కోసం, FreeLLMAPI tools ను Google’s functionDeclarations ఫార్మాట్లోకి అనువదిస్తుంది మరియు సమాధానాన్ని తిరిగి అనువదిస్తుంది. ప్రతి ప్రొవైడర్కు మీ కోడ్ ఒకటే.
కొన్ని మోడల్లు tool call ను నిజమైన tool call కు బదులుగా సాధారణ వచనంగా వ్రాస్తాయి. FreeLLMAPI వీటిని గుర్తించి నిజమైన tool_calls గా మారుస్తుంది.
ఈ రోజు tool calling ఉన్న ఉచిత మోడల్లు
పట్టిక అత్యంత శక్తివంతమైన tool calling ఉచిత మోడల్లను చూపుతుంది. డేటా ప్రత్యక్ష కేటలాగ్ నుండి వస్తుంది. ఏజెంట్ల కోసం, context పరిమాణాన్ని కూడా తనిఖీ చేయండి, ఎందుకంటే tool definitions మరియు ఫలితాలు చాలా tokens ఉపయోగిస్తాయి.
| మోడల్ | ఉచితంగా లభ్యం | కాంటెక్స్ట్ | ఉచిత పరిమితులు (ఉత్తమ ఆఫర్) | సాధనాలు | విజన్ |
|---|---|---|---|---|---|
| GLM 5.3 | UnoRouter | 1M | 1 అభ్యర్థనలు/నిమిషం 1 req/min per model | అవును | లేదు |
| Qwen3.8 Max | ACLIDE | - | €20/month shared internal usage credits · no card | అవును | లేదు |
| GLM 5.3 Flash | NVIDIA NIM, UnoRouter | 1M | 40 అభ్యర్థనలు/నిమిషం 40 RPM | అవును | అవును |
| Gemini 3.8 Flash | Google AI Studio | 1M | Recurring provider quota | అవును | అవును |
| Gemini Flash (latest alias) | Google AI Studio | - | 10 అభ్యర్థనలు/నిమిషం 20 అభ్యర్థనలు/రోజు 250,000 టోకెన్లు/నిమిషం ~3M | అవును | అవును |
| 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 | అవును | అవును |
| Gemini 3.6 Flash | Google AI Studio | 1M | 10 అభ్యర్థనలు/నిమిషం 20 అభ్యర్థనలు/రోజు 250,000 టోకెన్లు/నిమిషం ~3M | అవును | అవును |
| Qwen 3.8 27B | Cloudflare Workers AI | 262K | Shared 10k neurons/day | అవును | అవును |
| Gemini 3.5 Flash | Google AI Studio | 1M | 10 అభ్యర్థనలు/నిమిషం 20 అభ్యర్థనలు/రోజు 250,000 టోకెన్లు/నిమిషం ~3M | అవును | అవును |
సరిపోలే 146 ఉచిత మోడల్లలో 15 చూపబడుతున్నాయి. అన్ని మోడల్లను చూడండి.
FreeLLMAPI కేటలాగ్ నుండి ప్రత్యక్ష డేటా (వెర్షన్ 2026.11.19, 2026-11-19 న తనిఖీ చేయబడింది). ఉచిత పరిమితులు తరచుగా మారుతాయి. కేటలాగ్ ప్రతి రోజు తనిఖీ చేయబడుతుంది.
దశ 1: FreeLLMAPI ఇన్స్టాల్ చేసి కీలను జోడించండి
FreeLLMAPI ఓపెన్ సోర్స్. ఇది మీ కంప్యూటర్లో Docker లో నడుస్తుంది. మీ ప్రొవైడర్ కీలు మీ కంప్యూటర్లోనే ఉంటాయి.
ఇన్స్టాల్ చేయండి (macOS లేదా Linux)
curl -fsSL https://freellmapi.co/install.sh | bashhttp://localhost:3001 వద్ద డాష్బోర్డ్ తెరవండి. Keys పేజీలో మూడు లేదా ఎక్కువ ప్రొవైడర్ల కీలను జోడించండి. ఒక tool loop ఒక టాస్క్ కోసం అనేక అభ్యర్థనలు పంపుతుంది, కాబట్టి ఎక్కువ కీలు ఎక్కువ స్థలం ఇస్తాయి. అదే పేజీ నుండి మీ ఏకీకృత కీని కాపీ చేయండి.
దశ 2: పూర్తి tool loop నడపండి
curl: మొదటి అభ్యర్థన
curl http://localhost:3001/v1/chat/completions \
-H "Authorization: Bearer <unified-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [{"role": "user", "content": "What is the weather in Karachi?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}]
}'Python: మోడల్ తుది సమాధానం ఇచ్చే వరకు loop చేయండి
import json
from openai import OpenAI
client = OpenAI(base_url="http://localhost:3001/v1", api_key="<unified-key>")
def get_weather(city: str) -> dict:
return {"city": city, "temp_c": 32, "condition": "sunny"} # call a real API here
FUNCS = {"get_weather": get_weather}
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}]
messages = [{"role": "user", "content": "What is the weather in Karachi and Lahore?"}]
for _ in range(5): # stop after 5 rounds
msg = client.chat.completions.create(model="auto", messages=messages, tools=tools).choices[0].message
if not msg.tool_calls:
print(msg.content)
break
messages.append(msg)
for call in msg.tool_calls:
try:
args = json.loads(call.function.arguments or "{}")
result = FUNCS[call.function.name](**args)
except Exception as exc: # bad JSON, unknown tool or wrong arguments
result = {"error": str(exc)}
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})Tool calling stream=True తో కూడా పనిచేస్తుంది. మీకు delta.tool_calls chunks వస్తాయి, తర్వాత finish_reason: "tool_calls" తో ఒక తుది chunk వస్తుంది. JSON ను పార్స్ చేసే ముందు argument chunks ను కలపండి.
నిర్మాణాత్మక డేటా కోసం tool ఉపయోగించండి
Tool calling స్థిర ఆకారంలో డేటా పొందడానికి కూడా ఒక మంచి మార్గం. మీకు కావలసిన ఫీల్డ్లు పరామితులుగా ఉన్న ఒక tool ను నిర్వచించండి. tool_choice ను "required" కు సెట్ చేయండి, తద్వారా మోడల్ ఒక tool ను కాల్ చేయాలి. తర్వాత arguments ను చదవండి. మీరు ఏ function ను నడపాల్సిన అవసరం లేదు.
Python: required tool call తో ఫీల్డ్లను extract చేయండి
import json
from openai import OpenAI
client = OpenAI(base_url="http://localhost:3001/v1", api_key="<unified-key>")
schema = {
"type": "function",
"function": {
"name": "save_contact",
"description": "Save one contact found in the text.",
"parameters": {
"type": "object",
"properties": {"name": {"type": "string"}, "email": {"type": "string"}},
"required": ["name", "email"],
},
},
}
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Reach Sara Khan at [email protected]."}],
tools=[schema],
tool_choice="required",
)
print(json.loads(resp.choices[0].message.tool_calls[0].function.arguments))మీ స్వంత కోడ్తో arguments ను ధృవీకరించండి. మోడల్ ఒక అవసరమైన ఫీల్డ్ను వదిలివేయవచ్చు లేదా తప్పు రకాన్ని పంపవచ్చు. తనిఖీ విఫలమైతే, ఎర్రర్ను తిరిగి పంపి మళ్లీ అడగండి.
ఆపదలు
- Arguments ఒక string:
function.argumentsఒక JSON string. దానిని పార్స్ చేయండి, మరియు ఎర్రర్లను పట్టుకోండి. చిన్న మోడల్లు కొన్నిసార్లు చెల్లని JSON పంపుతాయి. - IDలను సరిపోల్చండి: ప్రతి tool message కు దాని call యొక్క
tool_call_idఅవసరం. tool messages కంటే ముందుtool_callsఉన్న assistant message ను జోడించండి. - ఒకేసారి అనేక calls: ఒక మోడల్ ఒకే సమాధానంలో ఒకటి కంటే ఎక్కువ tool calls ను తిరిగి ఇవ్వవచ్చు. అన్నింటినీ నడపండి, తర్వాత అన్ని ఫలితాలను పంపండి.
- Token ఖర్చు: ప్రతి tool definition ప్రతి అభ్యర్థనతో పంపబడుతుంది. ఇరవై పెద్ద tools వేల tokens ఉపయోగించవచ్చు, మరియు త్వరగా తక్కువ tokens-per-minute పరిమితిని చేరవచ్చు. టాస్క్కు అవసరమైన tools మాత్రమే పంపండి.
- స్పష్టమైన వివరణలు: మోడల్ tool ను దాని పేరు మరియు వివరణ నుండి ఎంచుకుంటుంది. tool ఏమి చేస్తుందో మరియు ఎప్పుడు ఉపయోగించాలో చెప్పే ఒక చిన్న వాక్యం వ్రాయండి.
- Loop ను ఆపండి: గరిష్ట rounds సంఖ్యను సెట్ చేయండి. బలహీనమైన మోడల్ అదే tool ను మళ్లీ మళ్లీ కాల్ చేయవచ్చు.
- tools లేని మోడల్లు: కొన్ని ఉచిత ప్రొవైడర్లు tools కు మద్దతు ఇవ్వరు. ఉదాహరణకు, AI Horde tools ను తొలగించి సాధారణ చాట్గా సమాధానం ఇస్తుంది.
సమస్య పరిష్కారం
| సమస్య | కారణం | పరిష్కారం |
|---|---|---|
| మోడల్ వచనంలో సమాధానం ఇస్తుంది, ఏ tool ను కాల్ చేయదు | మోడల్ tools లో బలహీనంగా ఉంది, లేదా వివరణ స్పష్టంగా లేదు | పట్టిక నుండి బలమైన మోడల్ను స్థిరంగా ఉంచండి, లేదా tool వివరణను మెరుగుపరచండి |
arguments పై json.JSONDecodeError | మోడల్ చెల్లని JSON పంపింది | ఎర్రర్ను పట్టుకుని tool ఫలితంగా తిరిగి పంపండి, తద్వారా మోడల్ మళ్లీ ప్రయత్నించగలదు |
| tool message గురించి Error 400 | tool_call_id సరిపోలడం లేదు, లేదా assistant message లేదు | ముందుగా assistant message జోడించండి, తర్వాత ప్రతి call కు ఒక tool message జోడించండి |
| ఏజెంట్ టాస్క్ సమయంలో Error 429 | loop అనేక పెద్ద అభ్యర్థనలు పంపుతుంది | మరిన్ని ప్రొవైడర్ కీలను జోడించండి, మరియు తక్కువ tools పంపండి |
| loop ఆగడం లేదు | మోడల్ అదే tool ను మళ్లీ కాల్ చేస్తుంది | round పరిమితిని సెట్ చేయండి, మరియు స్పష్టమైన ఫలితాలను తిరిగి ఇవ్వండి |
తరచుగా అడిగే ప్రశ్నలు
ఏ ఉచిత LLM APIలు function calling కు మద్దతు ఇస్తాయి?
Gemini, Groq, Cerebras, Mistral, OpenRouter, Cloudflare మరియు ఇతర ప్రొవైడర్లకు tool calling ఉన్న ఉచిత మోడల్లు ఉన్నాయి. FreeLLMAPI కేటలాగ్లో ఈ రోజు tools తో 190 ఉచిత మోడల్ ఆఫర్లు ఉన్నాయి.
tool calling మరియు function calling ఒకటేనా?
అవును. OpenAI మొదట function calling అనే పేరును ఉపయోగించింది. ప్రస్తుత API tools మరియు tool_calls ను ఉపయోగిస్తుంది. రెండు పేర్లు అంటే మోడల్ మీ కోడ్ను ఒక function నడపమని అడుగుతుంది.
OpenAI ఫార్మాట్తో Gemini tool calling పనిచేస్తుందా?
అవును, FreeLLMAPI ద్వారా. గేట్వే OpenAI tools ను Gemini functionDeclarations లోకి అనువదిస్తుంది, మరియు సమాధానాన్ని తిరిగి OpenAI tool_calls లోకి అనువదిస్తుంది.
tool calls ను స్ట్రీమ్ చేయవచ్చా?
అవును. stream=True తో మీకు delta.tool_calls chunks, మరియు tool_calls యొక్క తుది finish_reason వస్తాయి. వాటిని పార్స్ చేసే ముందు argument chunks ను కలపండి.
సంబంధిత గైడ్లు
- AI ఏజెంట్ల కోసం ఉచిత LLM API
- AI ఏజెంట్ల కోసం ఉచిత వెబ్ శోధన API
- ఉత్తమ ఉచిత కోడింగ్ మోడల్ APIలు
- LangChain కోసం ఉచిత LLM API
- Pythonలో ఉచిత LLM API
మూలాలు
- FreeLLMAPI docs: Tool calling (20 November 2026 న తనిఖీ చేయబడింది)
- FreeLLMAPI README: features (20 November 2026 న తనిఖీ చేయబడింది)
- OpenAI API reference: Chat Completions tools (20 November 2026 న తనిఖీ చేయబడింది)