#780·laya

[bug]: load() does not resolve the checkpoint aliases Router accepts, so load("typed-decisions") 404s

Author: krulamaCreated Sep 30, 2026Updated Sep 30, 2026

What happens

Router accepts friendly checkpoint names (english/laya, multilingual/ml, typed-decisions/typed), but the standalone load() does not. The same alias handed to load() is forwarded to Agent verbatim and treated as a Hub repo id:

python
import laya
laya.load("typed-decisions")
huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error.
Repository Not Found for url: https://huggingface.co/api/models/typed-decisions/revision/main.

load() in laya/agent.py passes model_id_or_path straight through to Agent, so subfolder is never filled in. The checkpoints bundled under convaiinnovations/laya/<subfolder> are therefore unreachable through the loader, and the only ways in are Router(auto_task_detection=True) or spelling out the full spec:

python
laya.load("convaiinnovations/laya", subfolder="typed-decisions")

Expected behavior

load() should resolve the same names and aliases router.normalise_name already does — laya/en/default → english, ml/multi → multilingual, typed/typed-decisions → typed-decisions. One registry of checkpoint names, one behaviour, so Router(model=...) and load(...) agree.

Workaround

Resolving the alias before calling Agent:

python
from laya.router import DEFAULT_MODELS, _ALIASES

key = _ALIASES.get(name.strip().lower(), name.strip().lower())
if key in DEFAULT_MODELS:
    repo, sub = DEFAULT_MODELS[key]
    ...

This reaches into the private _ALIASES, which is a hint that the alias table would be better exposed as a public normaliser that both Router and load() call.

Environment

  • laya 0.3.22 (PyPI), Python 3.11.9, torch 2.14.1+cpu, transformers 5.18.0, huggingface_hub 1.33.0
  • Windows 11, CPU-only
  • checkpoints: english, multilingual, typed-decisions (all from convaiinnovations/laya)

Related: #637 (temperature clamp mismatch) — reported separately as a comment there, not here.