Skip to content

Tool Calling (Function Calling)

Tool Calling is the feature that transforms an AI model from a passive text generator into an active problem solver. It gives the AI "hands" to interact with the digital world—your file system, the internet, and your computer's internal state.

What is Tool Calling?

Normally, an LLM is limited to the knowledge it was trained on. It can't know what time it is, what files are on your desktop, or what happened in the news today.

Tool Calling bridges this gap. Instead of hallucinating an answer, the model can say: "I need to use the web_search tool to find the current stock price of Apple."

Backend.AI GO intercepts this request, executes the tool securely, and feeds the result back to the model. The model then uses this real data to answer your question.

Why is it Important?

  • Real-Time Knowledge: Access the latest news, weather, and financial data via web search.

  • System Interaction: Read log files, organize folders, or check system health directly through chat.

  • Accuracy: Perform precise mathematical calculations using a calculator instead of relying on the model's approximate arithmetic.

  • Agentic Behavior: It is the foundation of AI Agents. By chaining multiple tool calls (Search -> Read -> Write), the AI can complete complex workflows autonomously.

Compatible Models

Not all models support Tool Calling. You need a model that has been fine-tuned to understand tool definitions and output structured tool requests.

  • Look for the "Tool" Tag: In the Backend.AI GO Model Library, compatible models are marked with a Tool or Function Calling chip.

  • Recommended Models: Gemma 3, Qwen3, Llama 3.1, Mistral Large, and GPT-4o (via cloud integration) are excellent choices.

Security & Permissions

Because tools can access your files and run code, security is paramount. Backend.AI GO implements a robust Risk-Based Permission System.

Risk Levels

Every tool is assigned a risk level:

  • 🟢 Safe (No Risk): Actions that simply read public data or perform calculations.

    • Examples: Calculator, Get Current Time.
    • Behavior: Executed automatically without interrupting you.
  • 🟡 Moderate (Read Access): Actions that read your personal files or access external websites.

    • Examples: Read File, Web Search, List Directory.
    • Behavior: Requires one-time approval per session. Once approved, the agent can use it freely for the rest of the conversation.
  • 🔴 Critical (Write/Execute): Actions that modify data or execute code.

    • Examples: Write File, Delete File, Run Shell Command.
    • Behavior: Requires explicit approval for every single call. The AI cannot delete a file without you clicking "Approve".

Built-in Tools

Backend.AI GO comes with a powerful suite of built-in tools.

1. Web Tools

  • Web Search (web_search): Searches Google or DuckDuckGo.

    • Use Case: "Who won the Super Bowl this year?"
  • Fetch URL (fetch_url): Downloads the text content of a specific webpage.

2. File System Tools

  • Read File (read_file): Reads the content of a file.

    • Use Case: "Analyze the error logs in server.log."
  • List Directory (list_directory): Sees what files are in a folder.

    • Use Case: "What files are in my Downloads folder?"
  • File Operations: Create, move, renaming, and delete files (with permission).

3. Utility & System

  • Calculator (calculator): Performs precise math.

    • Use Case: "Calculate 1243 * 5921."
  • System Info (get_system_info): Checks CPU/Memory usage.

    • Use Case: "Why is my computer running slow? Check the RAM usage."

4. Code Execution (Advanced)

  • Run Python/Shell (run_python, run_shell): Executes code in a sandboxed environment.
    • Use Case: "Write and run a Python script to plot this CSV data."