Skip to content

GraphRouter (training + inference)

GraphRouter is a graph neural network (GNN) router. It can capture relational structure beyond independent per-query decisions.

Notebooks: - Training: https://github.com/ulab-uiuc/LLMRouter/blob/main/notebooks/graphrouter/01_graphrouter_training.ipynb - Inference: https://github.com/ulab-uiuc/LLMRouter/blob/main/notebooks/graphrouter/02_graphrouter_inference.ipynb

Router docs: https://github.com/ulab-uiuc/LLMRouter/blob/main/llmrouter/models/graphrouter/README.md

Configs

Note

GraphRouter may require optional dependencies. If llmrouter list-routers does not show it, check the router README and install the extra requirements.

Run (CLI)

Train:

llmrouter train --router graphrouter --config configs/model_config_train/graphrouter.yaml

Route-only inference:

llmrouter infer --router graphrouter --config configs/model_config_test/graphrouter.yaml --query "Explain transformers." --route-only

Full inference:

llmrouter infer --router graphrouter --config configs/model_config_test/graphrouter.yaml --query "Explain transformers."