MCPcopy Index your code
hub / github.com/agent-husky/Husky-v1

github.com/agent-husky/Husky-v1 @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
90 symbols 244 edges 14 files 3 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Husky-v1

This repository contains the official code for the first iteration of Husky, an open-source language agent that solves complex, multi-step reasoning tasks via tool use.

Paper | Website | HuggingFace

Husky-v1 addresses numerical, tabular and knowledge-based reasoning tasks. Husky iterates between two stages: 1) generating the next action to take towards solving a given task, and 2) executing the action using expert models and updating the current solution state. Husky-v1 uses a code generator, a query generator and a math reasoner as expert models.

Installation

To get started with the code, first move to the main directory.

cd husky

Then, install the required packages. Note that our system uses CUDA 11.8.

pip install -r requirements.txt

Download the models

Visit our HuggingFace collection for Husky-v1 and download the associated models. - action generator (7B) - action generator (13B) - code generator - math reasoner - query generator

Inference

We use vLLM to perform inference with Husky. Below is an overview of our optimized inference procedure, where we execute all expert models in parallel and handle all LM generations in batches.

Run the following commands in parallel to run Husky. As there are five expert models running in parallel for each task, we recommend having an access to five GPUs or finding a way to run multiple models on the same GPU. Note that run_husky_update.sh does not involve GPU usage.

sh run_husky_action.sh
sh run_husky_code.sh
sh run_husky_math.sh
sh run_husky_query.sh
sh run_husky_reason.sh
sh run_husky_update.sh

Within each script, modify the MODEL_ID attribute as well as the DATASET_NAME attribute. For example, to run inference with llama-2-7b as the action generator and bamboogle as the dataset, modify run_husky_action.sh as:

MODEL_ID="action-generator-unified-llama2-7b"
DATASET_NAME="bamboogle"

To run inference for Google DeepMind mathematics and MathQA, set DATASET_NAME=lila and choose SUBTASK from deepmind_mathematics_{algebra/basicmath/calculus/muldiv/numbertheory} or mathqa_{gain/general/geometry/physics/probability}. Note that we only provide DROP*, IIRC* and HuskyQA through our HuggingFace space. Download the datasets and add them as test.jsonl to their respective subfolders under the dataset folder.

Running run_husky.sh will create a subfolder of the format evals/bamboogle/${SAVE_DIR}, where SAVE_DIR is the name of the directory you would like to store the inference outputs. The inference for each output will be stored in a JSON file. For example, the output to question 5 will be stored in q5.json under the subfolder.

Evaluation

After performing inference with the scripts above, run evaluation using eval_husky.sh.

sh eval_husky.sh

Again, set DATASET_NAME to the dataset of your choice, and set SUBTASK according to the list provided above if DATASET_NAME=lila.

Contact

For any questions, please open an issue mentioning @danieljkim0118 or send an email to jwonkim[at]cs.washington.edu.

Core symbols most depended-on inside this repo

get_status_file_path
called by 26
husky/run_husky.py
write_json_safe
called by 23
husky/utils.py
wait_for_file
called by 20
husky/run_husky.py
get_remain_indices_path
called by 14
husky/run_husky.py
search
called by 12
husky/search.py
read_json_safe
called by 9
husky/utils.py
extract_number_gsm8k
called by 9
husky/eval_husky.py
generate
called by 8
husky/generator.py

Shape

Function 68
Method 17
Class 5

Languages

Python100%

Modules by API surface

husky/math_utils.py35 symbols
husky/run_husky.py15 symbols
husky/utils.py12 symbols
husky/generator.py11 symbols
husky/eval_husky.py11 symbols
husky/search.py6 symbols

For agents

$ claude mcp add Husky-v1 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page