ToolACE: Function Calling Training Data Generation Pipeline(Reproduce)
September 18, 2025 ยท View on GitHub
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:
- Tool Self-Evolution Synthesis (TSS) - Tool evolution and synthesis module
- Self-Guided Dialog Generation (SDG) - Self-guided dialogue generation module
- 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
- Copy and modify configuration files:
cp config/data_config.yaml.example config/data_config.yaml
- 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
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
๐ง Contact
For questions or suggestions, please submit an Issue or contact the project maintainers.