Skip to content

[ICLR 2025] "GraphRouter: A Graph-based Router for LLM Selections", Tao Feng, Yanzhen Shen, Jiaxuan You

License

Notifications You must be signed in to change notification settings

ulab-uiuc/GraphRouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphRouter: A Graph-based Router for LLM Selections

Build Build License
Build Build Build

🌐 Project Page | 📜 arXiv

GoR

News

[2025.01.22] 🌟 GraphRouter is accepted for ICLR 2025.

📌Preliminary

Environment Setup

# create a new environment
conda create -n graphrouter python=3.10
conda activate graphrouter

# install pytorch. Modify the command to align with your own CUDA version.
pip3 install torch  --index-url https://download.pytorch.org/whl/cu118

# install related libraries
pip install -r requirements.txt


# install pyg
pip install torch_geometric
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cu118.html

Dataset Preparation

First, generate 'data/unified_qa_data.csv'.

python data_processing/multidata_unify.py

Then, generate data/router_data.csv and configs/llm_description_embedding.pkl by setting your api_key in configs/config.yaml.

python data_processing/construct_router_data.py

For your convenience, we provide download links for the 'unified_qa_data.csv' and 'router_data.csv' files we generated. Please download them and put them in data folder.

unified_qa_data.csv router_data.csv

⭐Experiments

Training and Evaluation

Run experiments and print/save evaluation results on metrics Performance, Cost, and Reward. You can edit the hyperparameters in configs/config.yaml or using your own config_file.

python run_exp.py --config_file [config]

Citation

@inproceedings{feng2024graphrouter,
  title={Graphrouter: A graph-based router for llm selections},
  author={Feng, Tao and Shen, Yanzhen and You, Jiaxuan},
  booktitle={The Thirteenth International Conference on Learning Representations},
  year={2024}
}

About

[ICLR 2025] "GraphRouter: A Graph-based Router for LLM Selections", Tao Feng, Yanzhen Shen, Jiaxuan You

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages