Metadata-Version: 2.5
Name: laya-weights
Version: 0.1.0
Summary: Offline English weights for laya: pip install and laya.load() works without the Hugging Face Hub
Project-URL: Model (Hugging Face), https://huggingface.co/convaiinnovations/laya
Project-URL: laya on PyPI, https://pypi.org/project/laya/
Author: Aleeza Noor
Maintainer: Aleeza Noor
License-Expression: Apache-2.0
Keywords: agent-routing,huggingface,laya,offline,weights
Requires-Python: >=3.8
Requires-Dist: laya
Requires-Dist: laya-weights-part-00==0.1.0
Requires-Dist: laya-weights-part-01==0.1.0
Requires-Dist: laya-weights-part-02==0.1.0
Requires-Dist: laya-weights-part-03==0.1.0
Requires-Dist: laya-weights-part-04==0.1.0
Requires-Dist: laya-weights-part-05==0.1.0
Requires-Dist: laya-weights-part-06==0.1.0
Requires-Dist: laya-weights-part-07==0.1.0
Requires-Dist: laya-weights-part-08==0.1.0
Description-Content-Type: text/markdown

# laya-weights

Offline weights for [laya](https://pypi.org/project/laya/)'s English checkpoint
(`convaiinnovations/laya`, repo root), the one `laya.load()` uses by default.

Many organisations let pip reach PyPI (directly or through an internal mirror) but block the Hugging
Face Hub, so laya can't download its model. This package ships the weights through pip, so
`pip install laya-weights` is all you need.

**Maintainer:** Aleeza Noor

## Agent routing example

The English checkpoint suits agent routing and orchestration: read a query and pick the agent whose
description fits it best.

```python
import laya

agent = laya.load()
questions = {"agent": {
    "type": "choice",
    "instructions": "Which agent should handle this request?",
    "criteria": {
        "billing_agent": "refunds, invoices, duplicate charges",
        "tech_support_agent": "crashes, bugs, login problems",
        "sales_agent": "pricing, plans, upgrades for new customers",
    },
}}
result = agent.predict("The app crashes every time I open settings", questions)
print(result["answers"]["agent"]["choice"])   # tech_support_agent
```

Descriptions that are specific and don't overlap give the best routing.

```bash
pip install laya-weights        # also installs laya
```

```python
import laya
agent = laya.load()             # no Hugging Face Hub access needed
```

Code that works today keeps working unchanged. A `.pth` startup hook wraps `huggingface_hub.snapshot_download`
so that requests for this checkpoint are served from the installed package. Other models, other
revisions and full-repo snapshots still go to the Hub as before.

## Notes

- PyPI rejects files over 100 MB, so the 843 MB `model.safetensors` ships as 9 `laya-weights-part-NN`
  packages. The first load rebuilds the file into `~/.cache/laya-weights` (set `LAYA_WEIGHTS_HOME` to change this),
  checks its SHA-256, and then reuses it. To do the rebuild ahead of time, for example in a Dockerfile, run `python -m laya_weights`.
- The multilingual and typed-decisions checkpoints are not included. `Router()` sends non-English
  text to the multilingual checkpoint, which still needs the Hub.

## Building and releasing

```bash
pip install build hatchling twine huggingface_hub
python -c "from huggingface_hub import snapshot_download as s; s('convaiinnovations/laya', revision='55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851', local_dir='hf_snapshot', allow_patterns=['rl_agent_config.json','model.safetensors','tokenizer/*','encoder/*'])"
python build_weights.py --version 0.1.0
python -m pytest tests
twine upload dist/*
```
