ToolACE: Function Calling Training Data Generation Pipeline(Reproduce)

September 18, 2025 ยท View on GitHub

Paper Python

ToolACE: Winning the Points of LLM Function Calling
An automated agent pipeline designed to generate accurate, complex, and diverse tool learning data specifically tailored for Large Language Models' capabilities.

๐Ÿ“– Project Overview

ToolACE is a systematic tool learning pipeline that automatically synthesizes high-quality function calling data through three core modules:

  1. Tool Self-Evolution Synthesis (TSS) - Tool evolution and synthesis module
  2. Self-Guided Dialog Generation (SDG) - Self-guided dialogue generation module
  3. Dual-Layer Verification (DLV) - Dual-layer verification module

๐ŸŽฏ Core Features

  • Evolutionary Diversity: Generate diverse APIs across multiple domains through the TSS module
  • Self-Guided Complexity: Dynamically adjust data complexity based on target LLM capabilities
  • Precise Verification: Dual-layer verification system ensures data executability and consistency
  • Multi-Type Support: Support for single, parallel, dependent, and non-tool usage function calling types

๐Ÿ—๏ธ Project Structure

toolace/
โ”œโ”€โ”€ config/                      # Configuration directory
โ”‚   โ”œโ”€โ”€ data_config.yaml        # Data generation config
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ data/                       # Data directory
โ”‚   โ”œโ”€โ”€ examples/               # Example data
โ”‚   โ”‚   โ”œโ”€โ”€ api_examples.json
โ”‚   โ”‚   โ””โ”€โ”€ dialog_examples.json
โ”‚   โ”œโ”€โ”€ generated/             # Generated data
โ”‚   โ”‚   โ”œโ”€โ”€ apis/
โ”‚   โ”‚   โ”œโ”€โ”€ dialogs/
โ”‚   โ”‚   โ””โ”€โ”€ verified/
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ toolace/                    # Core implementation
โ”‚   โ”œโ”€โ”€ dlv/                   # Dual-Layer Verification
โ”‚   โ”‚   โ”œโ”€โ”€ model_checker.py   # Model verification
โ”‚   โ”‚   โ”œโ”€โ”€ rule_checker.py    # Rule verification
โ”‚   โ”‚   โ””โ”€โ”€ verification_rules.py
โ”‚   โ”œโ”€โ”€ sdg/                   # Self-Guided Dialog Generation
โ”‚   โ”‚   โ”œโ”€โ”€ agents/           # Agent implementations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ assistant_agent.py
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ tool_agent.py
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ user_agent.py
โ”‚   โ”‚   โ””โ”€โ”€ complexity_evaluator.py
โ”‚   โ”œโ”€โ”€ tss/                   # Tool Self-Evolution Synthesis
โ”‚   โ”‚   โ”œโ”€โ”€ adaptation.py      # Domain adaptation
โ”‚   โ”‚   โ”œโ”€โ”€ api_pool.py        # API pool management
โ”‚   โ”‚   โ”œโ”€โ”€ evolution.py       # API evolution
โ”‚   โ”‚   โ””โ”€โ”€ speciation.py      # API context tree building
โ”‚   โ””โ”€โ”€ utils/                 # Utility functions
โ”‚       โ”œโ”€โ”€ io_utils.py        # I/O utilities
โ”‚       โ”œโ”€โ”€ logger.py          # Logging utilities
โ”‚       โ””โ”€โ”€ model_generator/   # Model implementations
โ””โ”€โ”€ tests/                     # Test directory
    โ””โ”€โ”€ test_simple_model.py

๐Ÿš€ Quick Start

Installation

pip install -r requirements.txt

Configuration

  1. Copy and modify configuration files:
cp config/data_config.yaml.example config/data_config.yaml
  1. Set up your model API keys and paths in the configuration files

Generate Data

python scripts/generate_data.py --config config/data_config.yaml

๐Ÿ“š Core Modules

Tool Self-Evolution Synthesis (TSS)

Generates diverse API definitions through three steps:

  • Speciation: Builds hierarchical API context trees from pre-training data
  • Adaptation: Specifies domain and diversity levels for each API
  • Evolution: Continuously improves APIs based on results and new requirements

Self-Guided Dialog Generation (SDG)

Generates dialogue data suitable for target LLM capabilities:

  • Complexity Evaluator: Evaluates data complexity using target LLM
  • Multi-Agent Generator: Generates dialogues through user, assistant, and tool agents
  • Self-Guided Complication: Dynamically adjusts dialogue complexity

Dual-Layer Verification (DLV)

Ensures generated data accuracy:

  • Rule Checker: Validates syntax and structural requirements
  • Model Checker: Detects hallucinations, consistency, and tool responses

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ง Contact

For questions or suggestions, please submit an Issue or contact the project maintainers.