Skip to content

hydang99/opentools

Repository files navigation

🛠️🧰 OpenTools: Open, Reliable, and Collective: A Community-Driven Framework for Tool-Using AI Agents

Repo Demo License: Apache 2.0

OpenTools is a community-driven framework for building, evaluating, and deploying tools for tool-integrated language models. It treats end-to-end agent performance as a combination of tool-use accuracy (selecting/calling tools correctly) and intrinsic tool accuracy (tools staying correct and stable as APIs and environments drift). To support both, OpenTools provides two complementary workflows: a Tool Accuracy / Maintenance Loop for continuous validation, regression testing, and reliability reporting, and an Agentic Workflow for integrating curated tool collections into LLM agents to solve real user tasks. The project emphasizes standardized tool schemas, continuous community-driven evaluation, clear separation between tools and agent policies, and transparent, debuggable execution via structured tool-call and error logs.


What Is Included

  • Tool framework: BaseTool, registry, configuration, and LLM engine adapters.
  • Agents: OpenTools, OctoTools, ReAct, Chain-of-Thought, Zero-Shot.
  • Benchmarks: multi-agent runner and dataset folders.
  • CLI: tool discovery, metadata, and environment helpers.

Setup

Create a Python environment, install dependencies, and install OpenTools in editable mode.

1. Clone the repository

Fork the repo on GitHub, then clone your fork:

git clone https://github.com/your-username/opentools.git
cd opentools

2. Create and activate a virtual environment

Example with conda:

conda create -n opentools python=3.11 -y
conda activate opentools

3. (Optional) Windows: install dependencies

On Windows, shell and dependency behavior can differ from macOS/Linux. If you're on Windows, run the provided script first (e.g. in Git Bash or WSL):

bash set_up_package_window.sh

4. Install OpenTools in editable mode

From the repo root:

pip install -e .

API Keys and Environment

OpenTools loads API keys from environment variables ending with _API_KEY. If python-dotenv is installed, .env files can be loaded automatically.

Example .env:

OPENAI_API_KEY=your_openai_key
GOOGLE_API_KEY=your_google_key
...

CLI helpers for env setup:

opentools create-env-template
opentools load-env .env

OpenTools can be used in two ways: from the CLI (direct command-line interface) or inside a Python environment (import and call from your code). Both modes use the same tools and agents.

Using OpenTools in Python

Tools — load the registry, list tools, and run a tool:

from opentools import load_all_tools, list_available_tools, create_tool

load_all_tools()
print(list_available_tools())

tool = create_tool("Calculator_Tool")
result = tool.run(operation="add", values=[1, 2, 3])
print(result)

Agents — use UnifiedSolver to run an agent:

from opentools import UnifiedSolver

solver = UnifiedSolver(agent_name="opentools", llm_engine_name="gpt-4o-mini")
result = solver.solve(question="What is 2 + 2?")
print(result.get("direct_output") or result.get("final_output"))

Using OpenTools from the CLI

Run tools and inspect metadata directly from the terminal:

opentools list
opentools info Calculator_Tool
opentools reload

Documentation Structure

  • docs/: High-level guides and runnable examples for users and contributors.

  • src/: Source code and in-code documentation.

    • src/opentools/: Main Python package that powers everything in this repo.
      • core/: Config, base classes, and core orchestration logic.
      • tools/: Built-in tools, each usually documented by a local README.md.
      • models/: Model and LLM engine integrations.
      • agents/: Agent definitions and orchestrators (e.g., the unified solver).
      • Benchmark/: Benchmark runners and datasets (e.g., VQAv2) with their own README.md files and assets.
    • For deeper technical details, see the README.md files inside each subfolder and the inline docstrings/comments in the code.

Contributing

For how to run things and contribute in practice, start with the docs:

License

Apache License 2.0. See LICENSE.

Support

About

OpenTools: community-driven framework to build, evaluate, and deploy tools for tool-integrated LLMs. Separates tool-use accuracy from intrinsic tool reliability, with continuous validation/regression tracking and plug-and-play tool schemas for agent frameworks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors