Instructions to use martini/laya-query-router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use martini/laya-query-router with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("martini/laya-query-router", device_map="auto") - Laya
How to use martini/laya-query-router with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Laya (Fine-Tuned Query Router)
Fine-tuned on a local dataset of 500 template-generated queries with multi-hot labels
over 32 crops, 6 roles, and
19 zones. The checkpoint drops into the existing Laya
Router/Agent two-step call pattern: step 1 asks one noul presence question per
category, step 2 asks one noul question per option for gated categories, with
membership decisions taken at the per-option thresholds stored in
rl_agent_config.json (thresholds) rather than a global 0.5.
Evaluation (held-out 100-query test split)
| Model | Step-1 Acc (mean) | Step-2 P/R/F1 | Label-Set F1 | Latency p50 (ms) |
|---|---|---|---|---|
| Laya (fine-tuned, gated) | 1.0 | 0.959 / 1.000 / 0.979 | 0.9893 | 173.0 |
| Laya (fine-tuned, always-on) | 1.0 | 0.946 / 1.000 / 0.972 | 0.9693 | 252.8 |
| Laya (pretrained, zero-shot) | 0.713 | nan / nan / nan | nan | 46.7 |
Limitations
- Template leakage: queries share ~100 sentence frames; absolute metrics partly measure template memorization.
- Multi-label supervision is scarce (10 multi-crop, 5 multi-zone queries), so multi-label metrics are indicative rather than decisive.
Installation & Quickstart
pip install laya
import laya
agent = laya.load("convaiinnovations/laya-query-router")
res = agent.predict(state, questions)
print(res["answers"])
License
Apache 2.0. Developed by Convai Innovations.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support