- LLM 0.26 एक बड़ा रिलीज़ है जो CLI और Python लाइब्रेरी में OpenAI, Anthropic, Gemini और Ollama local models के साथ Python functions से बने tools को जोड़ने की सुविधा देता है
- Tools को plugin के रूप में install करके
--tool/-T name_of_tool से बुलाया जा सकता है, या --functions के जरिए अस्थायी Python functions को सीधे command line से पास करके इस्तेमाल किया जा सकता है
- Built-in tools
llm_version, llm_time के अलावा simpleeval, QuickJS, SQLite और Datasette plugins उपलब्ध हैं, और model असफल call के बाद schema lookup या अलग expression के साथ retry कर सकता है
- Python API का नया
model.chain() tool call requests को पहचानकर उन्हें चलाता है और result को फिर model को वापस भेजता है, और sync functions तथा asyncio tools दोनों को support करता है
- कई vendors के tool use और function calling तरीकों के एक-जैसा होने से यह implementation संभव हुआ, और अगली प्राथमिकताएँ plugin विस्तार, अधिक model plugins का support, और Model Context Protocol client support हैं
LLM 0.26 में tool execution support
- LLM 0.26 ने प्रोजेक्ट शुरू होने के बाद की सबसे बड़ी feature के रूप में tool support जोड़ा है
- LLM CLI और Python लाइब्रेरी में OpenAI, Anthropic, Gemini और Ollama local models को Python functions के रूप में व्यक्त किए जा सकने वाले tools का access दिया जा सकता है
- नए tool plugins install करके अभी इस्तेमाल किए जा रहे model में नई capabilities जोड़ी जा सकती हैं
- उपयोग के चार मुख्य तरीके हैं
- Plugin tool install करें और
--tool/-T name_of_tool से load करें
--functions option से Python function code सीधे command line पर pass करें
- Python API में भी
tools=[locals] जैसे तरीके से tools दिए जा सकते हैं
- Tools async और sync दोनों contexts में काम करते हैं
CLI में tools चलाना
- नवीनतम LLM को
uv tool install llm से install किया जा सकता है, और मौजूदा installation को uv tool upgrade llm से upgrade किया जा सकता है
- OpenAI इस्तेमाल करने का उदाहरण
llm keys set openai से API key सेट करने के बाद इस तरह चलाया जा सकता है
llm --tool llm_version "What version?" --td
llm_version LLM में शामिल एक सरल demo tool है, और --tool llm_version उस tool को model के सामने उपलब्ध कराता है
--tool को कई बार दिया जा सकता है, और short option -T भी इस्तेमाल किया जा सकता है
--td, --tools-debug का छोटा रूप है, जो tool calls और response information प्रिंट करके अंदरूनी behavior देखने में मदद करता है
- Default model आमतौर पर
gpt-4o-mini होता है, और उदाहरण में llm models default gpt-4.1-mini से gpt-4.1-mini को default बनाया गया है
-m option से दूसरा model चुना जा सकता है, और o4-mini को built-in llm_time tool के साथ चलाने का उदाहरण भी है
llm --tool llm_time "What time is it?" --td -m o4-mini
llm_time tool response में utc_time, utc_time_iso, local_timezone, local_time, timezone_offset, is_dst जैसे fields शामिल होते हैं
कई models और plugins में behavior
- Tool support वाले model plugins में भी वही command pattern इस्तेमाल किया जा सकता है
- Anthropic Claude Sonnet 4 का उदाहरण इस flow का उपयोग करता है
llm install llm-anthropic -U
llm keys set anthropic
llm --tool llm_version "What version?" --td -m claude-4-sonnet
- Google Gemini 2.5 Flash का उदाहरण इस flow का उपयोग करता है
llm install llm-gemini -U
llm keys set gemini
llm --tool llm_version "What version?" --td -m gemini-2.5-flash-preview-05-20
- Ollama पर चलने वाला
qwen3:4b भी सरल tools चला सकता है
qwen3:4b 2.6GB आकार का छोटा model है
ollama pull qwen3:4b
llm install 'llm-ollama>=0.11a0'
llm --tool llm_version "What version?" --td -m qwen3:4b
Math, JavaScript, SQLite, Datasette tool plugins
- LLM जिन कामों में कमजोर होता है, जैसे बड़े numbers का multiplication, उन्हें tool calls से बेहतर किया जा सकता है
- llm-tools-simpleeval Daniel Fairhead की simpleeval लाइब्रेरी को expose करता है
- simpleeval एक “Simple Safe Sandboxed Extensible Expression Evaluator for Python” लाइब्रेरी है
- यह सरल Python expressions चलाने के लिए काफ़ी मजबूत sandbox देता है
- Calculation example इस तरह चलाया जा सकता है
llm install llm-tools-simpleeval
llm -T simple_eval 'Calculate 1234 * 4346 / 32414 and square root it' --td
- उदाहरण में model पहले
1234 * 4346 / 32414 की गणना करके 165.45208860368976 पाता है, फिर sqrt(...) defined न होने के कारण fail होता है, और उसके बाद ** 0.5 में बदलकर 12.862818066181678 प्राप्त करता है
- अभी चार public tool plugins उपलब्ध हैं
Datasette toolbox और errors के बाद retry
- Datasette plugin कई tools वाले toolbox के रूप में काम करता है
- Toolbox एक ऐसा plugin है जिसे constructor से configure किया जा सकता है
- उपयोग का उदाहरण इस प्रकार है
llm install llm-tools-datasette
llm -T 'Datasette("https://datasette.io/content")' --td "What has the most stars?"
Datasette("https://datasette.io/content") plugin को इस्तेमाल की जाने वाली Datasette instance URL देता है
- यह उदाहरण Datasette वेबसाइट चलाने वाली content database को target करता है
- Model तीन calls करता है
- पहले उसने
SELECT name, stars FROM repos ORDER BY stars DESC LIMIT 1 का अनुमान लगाया, लेकिन stars column न होने से fail हो गया
- Error मिलने के बाद उसने
Datasette_schema() tool से database schema देखा
- Schema के आधार पर सही query बनाकर चलाई
- अंतिम response के अनुसार सबसे अधिक stars वाला repository
datasette है, जिसके पास 10,020 stars हैं
--functions से अस्थायी tools बनाना
--functions option plugin की तुलना में कम structured अस्थायी tools इस्तेमाल करने का तरीका देता है
- अगर command line पर सीधे Python code block pass किया जाए, तो उसके अंदर defined functions model के लिए tools बन जाते हैं
- Blog search tool का उदाहरण
httpx से search page call करता है और raw HTML model को वापस देता है
llm --functions '
import httpx
def search_blog(q):
"Search Simon Willison blog"
return httpx.get("https://simonwillison.net/search/", params={"q": q}).content
' --td 'Three features of sqlite-utils' -s 'use Simon search'
- Implementation search page का raw HTML लौटाता है, फिर भी यह काम करता है
- GPT-4.1 family 1 million tokens संभाल सकती है, इसलिए माना गया है कि वह rough HTML भी handle कर सकती है
- System prompt में
use Simon search जोड़ना ज़रूरी है ताकि model खुद जवाब न दे और दिए गए search tool का इस्तेमाल करे
- बेहतर search tool के लिए अधिक detailed instructions और search results के relevant snippets चाहिए
- Example result में
sqlite-utils की features के रूप में CLI और Python लाइब्रेरी का संयोजन, alter=True से columns का auto-add होना, और plugin support सामने आता है
Python API में tool support
- LLM एक CLI tool भी है और Python लाइब्रेरी भी, और 0.26 में Python API में भी tool support जोड़ा गया है
- उदाहरण “strawberry” में
r की गिनती करने की समस्या को function tool से हल करता है
import llm
def count_char_in_text(char: str, text: str) -> int:
"How many times does char appear in text?"
return text.count(char)
model = llm.get_model("gpt-4.1-mini")
chain_response = model.chain(
"Rs in strawberry?",
tools=[count_char_in_text],
after_call=print
)
for chunk in chain_response:
print(chunk, end="", flush=True)
after_call=print, पहले वाले --td option की तरह tool calls की पुष्टि करने का तरीका है
- नया
model.chain() method model.prompt() जैसा है, लेकिन लौटे हुए tool call requests को पहचानता है, उन्हें चलाता है, और result के साथ model को फिर से call करता है
model.chain() अंतिम उत्तर देने से पहले कई responses चला सकता है
chain_response पर iterate करने से कई responses में लौट रहे tokens को streaming output के रूप में print किया जा सकता है
- Example result में
count_char_in_text tool को char='r', text='strawberry' के साथ call किया जाता है, और result 3 के आधार पर यह जवाब दिया जाता है कि strawberry में r तीन बार है
- Python लाइब्रेरी
asyncio को भी support करती है, और tools async def functions हो सकते हैं
- अगर model एक साथ कई async tools माँगता है, तो लाइब्रेरी उन्हें
asyncio.gather() से parallel चलाती है
- Toolbox भी supported है, इसलिए
tools=[Datasette("https://datasette.io/content")] को chain() में देने से CLI के --tool 'Datasette(...)' जैसा ही effect मिलता है
Implementation background और tool usage pattern
- Tool usage pattern को 2022 के अक्टूबर में पहली बार प्रकाशित ReAcT paper देखने के बाद से ट्रैक किया जा रहा है
- Basic pattern सरल है
- Model को बताया जाता है कि उसके पास इस्तेमाल करने के लिए tools हैं
- Model JSON, XML, या
tool_name(arguments) जैसे special syntax में tool action request करता है और रुक जाता है
- Code उस output को parse करके requested tool चलाता है
- Execution result शामिल करके model को नया prompt भेजा जाता है
- यह तरीका अब लगभग सभी models में काम करता है
- कई models को tool use के लिए अलग से train किया गया है, और Berkeley Function-Calling Leaderboard जैसे leaderboards भी मौजूद हैं
- OpenAI, Anthropic, Google, Mistral और Meta ने अपने APIs में tool use या function calling शामिल किया है
- Local models की ओर भी Ollama ने पिछले साल tool support जोड़ा था, और llama.cpp server में भी यह शामिल है
- LLM ने 2025 के फरवरी में पहले schema support रिलीज़ किया था, और इसे tool support की दिशा में एक कदम बनाया
- कई models में काम करने वाली abstraction layer design करना चुनौती थी, लेकिन vendors के तरीकों के साफ़ तौर पर एक दिशा में आने से अब इसे implement करना संभव हुआ
- PyCon US में Building software on top of Large Language Models workshop alpha implementation को पूरा करने का अवसर बनी, और tutorial का tools section भी उपलब्ध है
Agents और आगे की योजना
- “agents” शब्द को लेकर अब भी झिझक है, लेकिन LLM दुनिया में चीज़ें tools in a loop की दिशा में जा रही हैं, और LLM 0.26 भी उसी रूप के क़रीब है
- अगर आप agent बनाना चाहते हैं, तो LLM 0.26 एक अच्छा शुरुआती बिंदु हो सकता है
- आगे के काम LLM tools v2 milestone में 13 issues के रूप में व्यवस्थित हैं
- इनमें ज़्यादातर tool execution logs को बेहतर दिखाना और इस रिलीज़ को न रोकने वाले छोटे issues शामिल हैं
- अतिरिक्त issues tools label में हैं
- Plugin संभावना सबसे रोमांचक क्षेत्र लगती है
- llm-plugin-tools cookiecutter template का सीधे उपयोग किया जा रहा है
- इस पर एक tutorial बनाने की योजना है
- और अधिक model plugins में tool support जोड़ने का काम भी बाकी है
- Advanced plugin docs में tool support details जोड़ी गई हैं
- Gemini tool support जोड़ने वाला commit ज़रूरी काम का एक उदाहरण दिखाता है
- Model Context Protocol support भी योजना में शामिल है
- MCP model के tools तक पहुँचने का standard तरीका बनकर तेज़ी से उभर रहा है
- दो हफ़्ते पहले तक इसे major vendor APIs में direct support नहीं मिला था, लेकिन हाल के 8 दिनों में OpenAI, Anthropic और Mistral में यह जुड़ गया
- लक्ष्य यह है कि LLM एक MCP client की तरह काम करे ताकि लोग जो MCP servers लिखते हैं, उन्हें LLM के लिए additional tool sources के रूप में आसानी से इस्तेमाल किया जा सके
1 टिप्पणियां
Hacker News की राय
इस टूल के लिए लिखा गया streaming Markdown renderer भी देखने लायक है: https://github.com/day50-dev/Streamdown
इसकी पृष्ठभूमि https://github.com/simonw/llm/issues/12 में है, और Simon के
llmके ऊपर बनाया गया tmux टूल https://github.com/day50-dev/llmehelp भी मैं रोज़ इस्तेमाल करता हूँllmके ऊपर बनाई एक और चीज़ बताना रह गया था: एक ZSH plugin, जोzleका इस्तेमाल करके एक की-प्रेस में अंग्रेज़ी को shell command में बदल देता है: https://github.com/day50-dev/Zummonerआज भी मैंने इसे
$ git find out if abcdefg is a descendent of hijklmnopजैसे तरीके से इस्तेमाल किया, और दूसरे कमेंट में दिया गयाfor i in $(seq 1 6); do printf "%${i}sh${i}\n\n-----\n" | tr " " "#"; done | pv -bqL 30भी असल में कहीं ज़्यादा natural-language जैसा input थाctrl-x xदबाने पर buffer OpenRouter को भेजा जाता है और 1 सेकंड से भी कम में सही syntax से बदल जाता हैमैंने issue खोल दिया है: https://github.com/simonw/llm/issues/1112
कुछ design विकल्प डाले हैं, लेकिन अभी पूरी तरह सही महसूस नहीं हो रहा, इसलिए feedback चाहिए
llmऔरbatकी syntax highlighting साथ में इस्तेमाल कर रहा हूँयह खुद अपने पैर पर कुल्हाड़ी मारने का जोखिम बहुत बढ़ा देता है
docs https://llm.datasette.io/en/stable/tools.html prompt injection को लेकर चेतावनी देते हैं, लेकिन मेरे हिसाब से ज़्यादा वास्तविक scenario वह नुकसान है जो आप खुद कर बैठेंगे
उदाहरण के लिए, अगर आप trading automate करने के लिए tool को brokerage account access दे दें, तो prompt injection न होने पर भी bot को बेवकूफी भरे trades करने से रोकने का कोई guard नहीं है
जब आप LLM से tools जोड़ना शुरू करते हैं, खासकर जब वे tool calls authenticated हों और आपकी ओर से actions भी कर सकें, तो चीज़ें गलत होने के बहुत सारे रास्ते खुल जाते हैं
MCP इस समय इसे बहुत तेज़ी से अनुभव कर रहा है, और कल का GitHub MCP मामला भी इसका उदाहरण है: https://news.ycombinator.com/item?id=44097390
docs में बड़ी warning डाली है, और शुरुआती tool plugins जारी करते समय भी ध्यान रखा कि केवल वे ही हों जो नुकसान न पहुँचा सकें। इसलिए QuickJS sandbox और SQLite plugin भी read-only हैं
llmको brokerage account से जोड़ते हैं, तो बेवकूफ bot नहीं बल्कि उसे जोड़ने वाला व्यक्ति हैmacOS पर यह बहुत मुश्किल नहीं है, लेकिन अभी इस्तेमाल में आसान अच्छे tools की कमी है। Claude Code ने user experience सुधारने के लिए Seatbelt का थोड़ा-थोड़ा इस्तेमाल शुरू किया है
आप खुद को नुकसान पहुँचा सकते हैं, और शायद ऐसा होगा भी, लेकिन possibilities को evaluate न करना भी जोखिम है। आम लोग पैर पर कुल्हाड़ी मारने की संभावना को कम आँकते हैं, और तकनीकी लोग नई possibilities न सीखने के जोखिम को कम आँकते हैं
एक साल पहले भी मैंने LLM को अपने laptop पर local commands चलाने दिया था, और इसे कुछ हद तक risky मानता हूँ, लेकिन कोई नुकसानदेह चीज़ नहीं हुई।
find out where I am and what weather it is going to beजैसे prompt मेंrm -rf /चलने की संभावना हो सकती है, लेकिन बहुत कम हैहालांकि LLM कैसे decide करता है यह जाने बिना उसे stock trading सौंपना मेरे हिसाब से बहुत risky है
Warp terminal का terminal-based agent idea मुझे पसंद है, लेकिन Cursor जैसा “अच्छे prompts और LLM calls हम संभाल लेंगे, बस भरोसा करो और पैसे दो” वाला model मुझे खास पसंद नहीं
इसलिए मैं shell skills की कमी पूरी करने के लिए एक सरल CLI-based terminal agent ढूँढ रहा था, और terminal tools के साथ
llmका combination हल्के solution की तरह अच्छा लगता हैबड़े self-inflicted risk से मैं अच्छी तरह वाकिफ हूँ, इसलिए जानना चाहता हूँ कि क्या हर tool call पर permission माँगने का तरीका संभव है, जैसा दूसरे agents करते हैं। जैसे “
llmrm -rf ./*call करने जा रहा है। confirm करने के लिए Y दबाएँ” — इससे LLM को terminal में अनियंत्रित भागने से कुछ हद तक रोका जा सकता है--full-autopass नहीं किया जाता, तो codex CLI default रूप से इसी तरह काम करता हैअगर आप
llmइस्तेमाल करते हैं, तो Gtk-llm-chat भी देखने लायक हैयह
llmcommand-line tool और desktop के साथ integrate होता है, और tray icon तथा देखने में अच्छा chat window देता हैहाल ही में 3.0.0 release किया गया है और तीनों प्रमुख desktop operating systems के लिए packages उपलब्ध हैं
मेरे हिसाब से यह release मौजूदा clients की limitations के बिना LLM की potential खोलने वाला core component है
0.26 alpha आने के बाद मैंने MCP server से interact करने वाला plugin बनाने की कोशिश की थी, लेकिन यह काफी मुश्किल था। अभी तक connect करने और tools को dynamically fetch करके इस्तेमाल करने तक तो हो गया है, लेकिन parameters pass करना अभी नहीं हो पा रहा
official
mcpPython library strongly मानकर चलती है कि flow मेंasyncioचलाना, server से connect करना और फिर available tools inspect करना शामिल होगाllmCLI के tab completion के लिए zsh/omz plugin को मैं लगभग पूरी तरह vibe coding से maintain कर रहा/रही हूं, लेकिन नए feature releases की रफ्तार इतनी तेज है कि साथ चलना मुश्किल हो जाता हैफिर भी
llm -f README.md -f llm.plugin.zsh -f completions/_llm -f [https://simonwillison.net/2025/May/27/llm-tools/](<https://simonwillison.net/2025/May/27/llm-tools/>) "implement tab completions for the new tool plugins feature"जैसा कुछ चलाने पर 90% काम हो जाता हैrepository https://github.com/eliyastein/llm-zsh-plugin है, और जितने हो सकें उतने options और flags डालने की कोशिश में यह थोड़ा बिखरा हुआ हो गया है, इसलिए feedback पाना चाहूंगा/चाहूंगी
आने वाली पीढ़ियां सोचेंगी कि हमने काम कैसे किया, ठीक वैसे ही जैसे हम assembly programmers को देखकर सोचते हैं, “वे काम कैसे करते थे?”
मैं उत्सुक था/थी कि Claude Code tools को कैसे जानता और इस्तेमाल करता है
LLM को tools और उन्हें इस्तेमाल करने का तरीका बताया जा सकता है और execution wrapper उसे manage कर सकता है, लेकिन मुझे लगा कि Claude Code के पास wrapper द्वारा इस्तेमाल किए जाने वाले tool-calling API को लेकर बहुत specific expectations हैं, और शायद post-training या fine-tuning से इसे मजबूती से reinforce किया गया होगा
इसलिए मैं सोच रहा/रही हूं कि Claude का इस्तेमाल करने वाले third-party tool-calling frameworks, Anthropic के अपने framework की तुलना में disadvantage में हैं या नहीं
अलग से, GitHub MCP “attack” वाले लेख में जैसा कहा गया था, LLM को credentials की पूरी permissions तक इस्तेमाल करने के लिए धोखा दिया जा सकता है। GitHub की तरह fine-grained auth credentials मौजूद हैं और हमारी कंपनी में भी हैं, इसलिए अच्छा होगा अगर कोई ऐसा protocol आजमाए जो wrapper द्वारा LLM को देने के लिए fine-grained credentials generate करे
मैं ऐसी संरचना की कल्पना करता/करती हूं जहां application को ज्यादा मजबूत credentials दिए जाएं, और subordinate LLM को किसी specific task या resource के लिए “permission request” करना सिखाया जाए। अगर user अनुमति दे, तो framework service से limited-scope credentials लेकर उन्हें tool calls में इस्तेमाल करे
इसके लिए काफी sophisticated tool setup चाहिए, जिसमें “additional credentials request” tool expose किया जाए और call होने पर user से पूछा जाए
tool को credentials store करने चाहिए और actual token कभी भी LLM को नहीं देना चाहिए; इसकी जगह
creds1जैसा symbol देकर बताया जा सकता है कि आगे की requests मेंcreds1से call करेसोच रहा/रही हूं कि आपने यह paper देखा है या नहीं। अगर यह उतना ही महत्वपूर्ण है जितना दिखता है, तो क्या यह metric सभी system cards में नहीं होना चाहिए?
128K tokens से ज्यादा context support करने का दावा करने वाले 12 popular LLMs का evaluation करने पर पाया गया कि वे short context में अच्छा करते हैं, लेकिन context length बढ़ने पर performance काफी गिर जाती है। कहा गया कि 32K पर 10 models short-length baseline के 50% से नीचे चले गए, और exception के तौर पर अच्छी performance देने वाला GPT-4o भी 99.3% से घटकर 69.7% हो गया
https://arxiv.org/abs/2502.05167
आजकल needle in a haystack tests में Gemini 2.5 Pro और Gemini 2.5 Flash बाकी models से काफी आगे बताए जाते हैं, इसलिए अच्छा होगा अगर इन्हीं models पर भी इसे run किया जाए
पिछले हफ्ते 0.26a0 से proprietary data-based customer chatbot का demo बनाया
जिन core elements को मुझे खुद लिखना पड़ा, वे थे system prompt, external data fetch करने वाला tool, और calculations करने वाला tool; इस library की वजह से core functionality बनाना बहुत आसान रहा
demo में ज्यादातर मेहनत plumbing work में गई: conversation को बनाए रखना, connection issue के कारण browser refresh करने पर भी उसे natural तरीके से update होना, और नया chat session शुरू कर सकने वाला अच्छा web UI बनाना
after_call=printके बारे में मुझे पता नहीं था, लेकिन blog post पढ़कर यह जानकर अच्छा लगामैं Simon के tools रोज इस्तेमाल कर रहा/रही हूं
pipes और local Ollama व remote models के बीच आसानी से switch करने की सुविधा की वजह से काम करना बहुत सुविधाजनक है