LLM APIs and Tool Calling
What model APIs provide
- Chat completions with role-structured messages.
- Model choices based on cost/latency/quality.
- Vision/audio/embeddings support in selected models.
- Production-grade usage with token-based billing.
Tool calling concept
Model converts user intent into a structured function call (JSON arguments), then app executes the function and returns result back to model.
- User asks a question.
- Model selects tool and fills arguments.
- App executes tool (DB/API/calculation).
- Result is fed back for final natural-language answer.
Why tool calling matters
- Connects LLM reasoning with real-world systems.
- Reduces hallucination by grounding on tool outputs.
- Enables agent workflows (search, calculate, transact).
Basic schema pattern
{
"name": "get_weather",
"parameters": {
"type": "object",
"properties": { "location": { "type": "string" } },
"required": ["location"]
}
}