Tool Call Bench
Guide

ToolBench (ToolLLM): The 16,000-API Tool-Use Benchmark, and Why StableToolBench Replaced Its Live Server

The tool-use dataset and benchmark built on 16,464 real REST APIs, taken apart for teams who need to know what a ToolBench score measures, which version of it they are looking at, and what it leaves out about their own agent.

Tool Call Bench EditorsUpdated

What ToolBench is

ToolBench is the dataset and benchmark at the centre of the ToolLLM project from Tsinghua University's OpenBMB and THUNLP groups, introduced in the July 2023 paper ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs. It was built to teach open-weight models to use tools, and to measure how well any model does it, on a large set of real web APIs rather than a handful of hand-written functions.

The project ships four things together: the ToolBench data (instructions plus annotated solution paths), the ToolLLaMA models fine-tuned on it, a neural API retriever, and ToolEval, the automatic evaluator that produces ToolBench scores. Code and data live in the OpenBMB/ToolBench repository and are distributed under Apache 2.0, for research and educational use.

ToolBench at a glance, from the repository README
WhatSize
Tools (RapidAPI services)3,451
APIs (endpoints)16,464, across 49 RapidAPI categories
Instances (instruction plus solution path)126,486
Real API calls made while annotating469,585
Average reasoning traces per instance4.0

One naming trap: an earlier, unrelated benchmark is also called ToolBench. It comes from the May 2023 paper On the Tool Manipulation Capability of Open-source Large Language Models (Xu et al.) and has eight software-tool tasks. When a paper or model card cites "ToolBench", check which one it means; most tool-calling work since mid-2023 means the ToolLLM one described here.

How the data was built

  • API collection. The team crawled RapidAPI Hub, an API marketplace, for each API's documentation: what it does, its required and optional parameters, and example calls. The team then dropped APIs that didn't work, answered too slowly, or returned low-quality responses such as raw HTML or error messages. Each tool's documentation is stored as JSON under data/toolenv/tools/<Category>/.
  • Instruction generation. ChatGPT (gpt-3.5-turbo-16k) was shown a sample of APIs and asked to write realistic requests that need them. Requests come in three shapes: single-tool (I1), multi-tool within one RapidAPI category (I2), and multi-tool within one RapidAPI collection, which can span categories (I3).
  • Solution path annotation. ChatGPT then solved each request by actually calling the APIs, using the project's depth-first search-based decision tree (DFSDT): when a line of calls goes nowhere, the model calls a give-up function, backs out and tries a different branch, instead of stopping as a single ReAct chain would. Only paths that passed were kept as training data.

Every path ends with a special Finish call that either gives a final answer or gives up. That detail matters for scoring: ToolEval reads how a path finished, not only what it called along the way.

The six test groups

ToolBench reports scores on six test subsets, which also name the folders under data/test_instruction/. Each tests a kind of generalisation beyond the training data, so a model that only memorised training instructions does well on the first column and poorly on the rest:

Test groupFolderWhat is new to the model
I1-Inst.G1_instructionNew single-tool instructions for tools seen in training
I1-ToolG1_toolSingle-tool instructions on unseen tools from categories seen in training
I1-Cat.G1_categorySingle-tool instructions on unseen tools from an unseen category
I2-Inst.G2_instructionNew intra-category multi-tool instructions
I2-Cat.G2_categoryIntra-category multi-tool instructions in an unseen category
I3-Inst.G3_instructionNew intra-collection multi-tool instructions

In the main ToolBench setting each model is handed the relevant APIs for the instruction (the paper calls them oracle APIs). A separate open-domain setting has the API retriever pick the top five APIs from the whole pool first, which tests tool selection as well as tool use. A score should say which setting it came from.

How ToolEval scores a model

ToolBench has no fixed answer key. The original paper explains why: real RapidAPI responses change over time and a request can have many valid solution paths, so one correct call sequence can't be written down for each test. Instead ToolEval uses a language model as the judge, with two metrics:

  • Pass rate. The share of instructions the model completes within a limited budget of calls. The judge first decides whether the instruction is solvable with the APIs given, then labels each solution path Pass, Fail or Unsure from rules: giving up on a solvable task after calling only a few APIs is a Fail, and so is a final answer that doesn't fully resolve a solvable request or claims success on an unsolvable one. Each path is judged several times and the majority label counts.
  • Win rate. The judge compares two solution paths for the same instruction, against criteria such as how complete and useful the final answer is, and records which one it prefers. Scores are reported against a fixed reference, ChatGPT with ReAct in the original results, so a win rate means nothing without its reference model.

The paper reports that its ChatGPT judge agreed with human annotators 87.1% of the time on pass rate and 80.3% on win rate. Results are also reported per reasoning method: the same model can be run with a single chain (CoT@1, ReAct-style) or with DFSDT (DFS_woFilter_w2), and DFSDT scores higher at the cost of more calls. Compare like with like.

Why scores drifted, and what StableToolBench changed

ToolBench's strength, real APIs, is also its main problem as a benchmark. RapidAPI services go offline, change their responses or start asking for authorisation, so the same model on the same task can score differently from one month to the next. When the authors of StableToolBench (Guo et al., March 2024) re-checked the APIs, only 44.4% of calls succeeded. The judge added more noise: deciding on the fly whether a task was solvable is itself unreliable.

StableToolBench keeps ToolBench's tools, query format and six test groups, and changes what sits behind the calls and how they are judged:

PartOriginal ToolBenchStableToolBench
API backendLive RapidAPI calls, through the project's server or your own RapidAPI keyA virtual API server: a cache of recorded responses, with an LLM simulating any API that has no cached answer. A later release adds MirrorAPI, a model trained on real request-response pairs to stand in for more than 7,000 tools
Test queriesAll generated test queriesSolvable queries only, chosen beforehand by a majority vote of gpt-4-turbo, gemini-pro and claude-2
MetricsPass rate and win rate, judged by ChatGPTSolvable Pass Rate (SoPR) and Solvable Win Rate (SoWR), judged by a GPT-4-class model; the MirrorAPI release adds a final-answer-correctness (FAC) score from a trained evaluator
What changes a scoreThe model, plus whatever the APIs return that dayMostly the model; cache misses still go to a simulator, so a new method can see responses no earlier run saw

The practical upshot: scores from the original ToolBench tables, StableToolBench's GPT-based caching system and its MirrorAPI system are three different measurements, and the StableToolBench README itself re-published its numbers after changing the judge model. Note the backend, the evaluator model and the reasoning method next to any figure you cite. Our post on benchmarking toolchains for agents with live external API dependencies goes further into why live calls make results hard to reproduce.

Running ToolBench yourself

For new evaluations, start from the StableToolBench repository, which keeps ToolBench's inference and ToolEval scripts but points them at the virtual API server. Download the tools and response cache it links to (on Hugging Face) into its server/ folder, set an OpenAI key and the simulator model in server/config.yml, then start the server and run inference on one test group:

git clone https://github.com/THUNLP-MT/StableToolBench
cd StableToolBench
pip install -r requirements.txt
# unzip the downloaded cache so server/ holds tools/ and tool_response_cache/
cd server && python main.py      # serves http://localhost:8080/virtual
cd ..

export OPENAI_KEY=""  TOOLBENCH_KEY=""  PYTHONPATH=./
export SERVICE_URL="http://localhost:8080/virtual"
group=G1_instruction
mkdir -p data/answer/my_run/$group
python toolbench/inference/qa_pipeline_multithread.py \
  --tool_root_dir toolenv/tools \
  --backbone_model chatgpt_function \
  --openai_key $OPENAI_KEY \
  --max_observation_length 1024 \
  --method CoT@1 \
  --input_query_file solvable_queries/test_instruction/$group.json \
  --output_answer_file data/answer/my_run/$group \
  --toolbench_key $TOOLBENCH_KEY \
  --num_thread 1
  • Cache misses fall through to the real ToolBench server, which needs a ToolBench key; the project hands these out through a request form linked from both READMEs, so apply before you plan a run around it.
  • Switch --method CoT@1 to DFS_woFilter_w2 for DFSDT. Expect many more model and API calls per query, and so a larger bill from your model provider.
  • To score a run, convert each test group's outputs with toolbench/tooleval/convert_to_answer_format.py, then run eval_pass_rate.py for SoPR and eval_preference.py for SoWR against a reference run. Both call an OpenAI judge model, configured in an openai_key.json pool file.
  • The MirrorAPI route swaps the GPT simulator for a model you serve yourself with vLLM (main_mirrorapi.py), which removes the per-call cost of simulation but needs a GPU.
  • To use the original live setup instead, the OpenBMB repository's toolbench/inference/qa_pipeline.py takes a ToolBench key or, with --use_rapidapi_key, your own RapidAPI key, and you subscribe to the APIs yourself. Its scores will drift as described above.
  • Model results change as models and judges change; read the current tables in the StableToolBench README rather than a number quoted elsewhere.

Even the stable version is not fully deterministic: the simulator and the judge are both language models. Pin the repository commit, the cache snapshot, and the simulator and judge model versions, and evaluate more than once. Our post on deterministic agent replay for regression testing covers making repeated runs comparable.

What a ToolBench score won't tell you about your agent

  • Nothing checks an end state. ToolBench's APIs are public RapidAPI services spanning categories such as sports, finance and weather, and ToolEval judges the trajectory and final answer. There is no shared state that the checker inspects afterwards, unlike the stateful backends in BFCL's multi-turn tests or the databases in τ-bench. If your agent books, cancels or edits things, see our post on scoring multi-step agent tasks with external side effects.
  • The judge is a model. Pass and win rates depend on a judge model's reading of a trajectory, and change when the judge changes. That is a different kind of number from a deterministic check against a recorded end state.
  • The instructions were written by a model. ChatGPT generated the requests from the APIs it was shown, so they read like requests built around those APIs rather than what your users type.
  • Simulated responses aren't your API. StableToolBench's stand-in responses are meant to be plausible, not to reproduce a particular service's errors, pagination or rate limits. Our post on schema conformance versus behavioural fidelity in API mocks covers that gap.
  • It is training data too. ToolBench was released as a fine-tuning set, and its test groups come from the same generation process. A model trained on it, or on data derived from it, can look better than it is. Keep a held-out set of your own; see contamination prevention in agent eval suites.

Used for what it is good at, ToolBench (in its StableToolBench form) is the broadest public test of whether a model can choose among many unfamiliar APIs from their documentation and chain calls to answer a request. The decision about what to ship should still rest on tasks built from your own APIs, run against stubs that keep state and fail the way your services fail; our post on replacing live endpoints with high-fidelity API stubs is a place to start.

ToolBench next to BFCL, τ-bench and other tool-use benchmarks

BenchmarkWhat it emphasisesReach for it when
ToolBench / StableToolBenchChoosing and chaining calls across thousands of real REST APIs from their documentation, judged by a language modelYou care about breadth of APIs, tool selection and retrieval
BFCLCall construction, relevance, multi-turn state and agentic tasks, scored deterministically against BFCL's own functionsYou want a broad, reproducible comparison of models' tool calling
τ-bench (Sierra)Whole conversations with a simulated user under a domain policy, scored on the end state, with reliability over repeated trials (pass^k)Your agent talks to customers and has to follow rules while it changes records
ToolSandbox (Apple)Stateful, conversational tool use with a simulated user and implicit dependencies between toolsYou need to test state dependencies and asking the user for missing information
AppWorldLong tasks across simulated everyday apps, solved by agents that write code against the apps' APIsYour agent acts by writing code rather than single calls

Each project's own paper and repository has its current task counts and scoring rules; check them before you quote a number.

Frequently asked questions

Is ToolBench the same as ToolLLM?

ToolLLM is the project and paper; ToolBench is its dataset and benchmark. The same project released the ToolLLaMA models, trained on ToolBench, and the ToolEval evaluator that scores it.

What is the difference between ToolBench and StableToolBench?

StableToolBench is a later version of the same benchmark that keeps ToolBench's tools and test groups but replaces live RapidAPI calls with cached and simulated responses, keeps only queries judged solvable, and scores with Solvable Pass Rate and Solvable Win Rate. Use it for new evaluations; its scores are not comparable with the original ToolBench tables.

Where do I download the ToolBench dataset?

The OpenBMB/ToolBench README links the data.zip archive on Google Drive and Tsinghua Cloud; the data_0801 folder there is the older version. StableToolBench's README links its tools, response cache, solvable queries and baseline results on Hugging Face.

Is there a ToolBench leaderboard?

There is no separately maintained public leaderboard page like BFCL's. The reference results are the tables in the OpenBMB/ToolBench and StableToolBench READMEs and papers, which name the backend, method and judge model they used. Check them for current figures, and cite the version alongside any score.

What does it cost to run ToolBench?

The code and data are free. You pay your model provider for the model under test, for the judge model ToolEval calls, and, with StableToolBench's GPT-based server, for simulating any API without a cached response. DFSDT runs make many more calls than single-chain runs. Your provider's pricing page has the rates.

Can ToolBench test my own APIs?

Partly. The OpenBMB repository shows how to add a custom tool (a JSON description plus a Python api.py) and query it, but only in the closed-domain setting, and the scores won't compare with published ones. To judge an agent on your system, build tasks and stateful fixtures from your own APIs.

Sources

  1. ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs (Qin et al., 2023)
  2. OpenBMB/ToolBench repository and README
  3. ToolEval
  4. StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Models (Guo et al., 2024)
  5. StableToolBench repository and README
  6. StableToolBench project page
  7. MirrorAPI model (Hugging Face)
  8. On the Tool Manipulation Capability of Open-source Large Language Models (Xu et al., 2023), the other ToolBench

Further reading on Tool Call Bench