Day 4 - LLM - Tool Calling A developer published a walkthrough of LLM tool calling, explaining that tools are functions a model can invoke to reach external APIs, databases, or knowledge bases, and that the model itself only selects which tool to call for a given query. The post demonstrates the approach in LangChain using the @tool decorator and a tool_map dictionary, with Groq as the inference provider for models such as llama3 and gpt-oss-120b, and notes MCP as the next level. It lists real-time data access, reduced hallucinations, and extended LLM capability as benefits, against token cost, latency, and security risks as drawbacks. Tool Calling - Asking some query to the LLM. - LLM is like a phone book , it can't call on its own. With some tools only it will. - Tools are nothing but FUNCTIONS. - Tool calling is also called as FUNCTION Calling. - Its a method , which models reliably connect and interact with external tools like API , database or knowledge base. - LLM gets set of tools and it decides which tools needs to be invoked for a specific user query and to complete a given task. - Next level of this is " MCP ". Code - I am just Mocking the data. - In Langchain, tool is there . Tool is like the method.its like a rapper functionality. - If we write any method and mention " @tool https://dev.to/tool " means -- its called DECORATOR . Its like tool and object. - tool map is a dictionary. - ChatGroq -- if langchain is integrated with Groq. Notes - Functions are nothing but TOOLS. - llm will have many functions. - Infra provider for LLM is Groq site . Creat API key. This is a Groq client -- it will communicate to cloud LLMs. Eg., llama3 , gpt-oss120 billion model, for this we needs API key. Implementation Advantages - Real-time data access and information retrieval - Reducing Hallucinations - Extends capability of LLMs Disadvantages - Token consumption and Cost - Cost & Latency - Security & Safety Risks Questions