ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs

Yujia Qin, Shi Liang, Yining Ye, Kunlun Zhu, Lan Yan +13 more
2/12/2026

No official code found. Best implementation: OpenBMB/ToolBench (5,715 stars, Apache-2.0, last commit 2025-05-21).

Abstract

Despite the advancements of open-source large language models (LLMs), e.g., LLaMA, they remain significantly limited in tool-use capabilities, i.e., using external tools (APIs) to fulfill human instructions. The reason is that current instruction tuning largely focuses on basic language tasks but ignores the tool-use domain. This is in contrast to the excellent tool-use capabilities of state-of-the-art (SOTA) closed-source LLMs, e.g., ChatGPT. To bridge this gap, we introduce ToolLLM, a general tool-use framework encompassing data construction, model training, and evaluation. We first present ToolBench, an instruction-tuning dataset for tool use, which is constructed automatically using ChatGPT. Specifically, the construction can be divided into three stages: (i) API collection: we collect 16,464 real-world RESTful APIs spanning 49 categories from RapidAPI Hub; (ii) instruction generation: we prompt ChatGPT to generate diverse instructions involving these APIs, covering both single-tool and multi-tool scenarios; (iii) solution path annotation: we use ChatGPT to search for a valid solution path (chain of API calls) for each instruction. To enhance the reasoning capabilities of LLMs, we develop a novel depth-first search-based decision tree algorithm. It enables LLMs to evaluate multiple reasoning traces and expand the search space. Moreover, to evaluate the tool-use capabilities of LLMs, we develop an automatic evaluator: ToolEval. Based on ToolBench, we fine-tune LLaMA to obtain an LLM ToolLLaMA, and equip it with a neural API retriever to recommend appropriate APIs for each instruction. Experiments show that ToolLLaMA demonstrates a remarkable ability to execute complex instructions and generalize to unseen APIs, and exhibits comparable performance to ChatGPT. Our ToolLLaMA also demonstrates strong zero-shot generalization ability in an out-of-distribution tool-use dataset: APIBench.

View on arXivView PDF

Code Implementations(1)

OpenBMB/ToolBenchCommunity100%
Apache-2.0

[ICLR'24 spotlight] An open platform for training, serving, and evaluating large language model for tool learning.

5,715487Shell, PythonMay 28, 20231 years agoApache-2.0

Similar Papers

Cite this paper

@article{qin2026toolllm,
  title  = {ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs},
  author = {Yujia Qin and Shi Liang and Yining Ye and Kunlun Zhu and Lan Yan and Ya-Ting Lu and Yankai Lin and Xin Cong and Xiangru Tang and Bill Qian and Sihan Zhao and Runchu Tian and Ruobing Xie and Jie Zhou and Marc H. Gerstein and Dahai Li and Zhiyuan Liu and Maosong Sun},
  year   = {2026},
  eprint = {2307.16789},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2307.16789},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.16789.svg)](https://codeofpaper.com/paper/2307.16789)

Discussion