Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
docs: add CONTRIBUTING, CODE_OF_CONDUCT, and issue/PR templates (#275)
Emiliano G.O.d5f7896a89b9
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.ymlnew file mode 100644index 00000000..3de86ae2--- /dev/null+++ b/.github/ISSUE_TEMPLATE/bug_report.yml@@ -0,0 +1,93 @@+name: Bug report+description: Something is not working as expected.+title: "[bug]: "+labels: ["bug"]+body:+ - type: markdown+ attributes:+ value: |+ Thanks for taking the time to file a bug. A short, runnable reproduction is the fastest+ path to a fix. Please write in English if you can.++ - type: textarea+ id: what-happened+ attributes:+ label: What happened+ description: What did you expect, and what did you get instead?+ placeholder: I expected X, but I got Y.+ validations:+ required: true++ - type: textarea+ id: reproduction+ attributes:+ label: Steps to reproduce+ description: The smallest script or sequence that shows the problem.+ render: python+ placeholder: |+ import laya++ agent = laya.load("convaiinnovations/laya")+ print(agent.system_one("...", {"q": {"type": "noul", "instructions": "?"}}))+ validations:+ required: true++ - type: textarea+ id: logs+ attributes:+ label: Relevant logs or traceback+ description: Paste the full traceback if there is one.+ render: shell+ validations:+ required: false++ - type: input+ id: laya-version+ attributes:+ label: Laya version+ description: The output of `python -c "import laya; print(laya.__version__)"`.+ validations:+ required: true++ - type: input+ id: python-version+ attributes:+ label: Python version+ placeholder: "3.12.4"+ validations:+ required: true++ - type: dropdown+ id: os+ attributes:+ label: Operating system+ options:+ - Linux+ - macOS+ - Windows+ - Other+ validations:+ required: true++ - type: dropdown+ id: backend+ attributes:+ label: Device or backend+ options:+ - CPU+ - CUDA+ - MPS (Apple silicon)+ - ONNX Runtime+ - Other+ validations:+ required: false++ - type: checkboxes+ id: checklist+ attributes:+ label: Before submitting+ options:+ - label: I searched the existing issues and this is not a duplicate.+ required: true+ - label: I reproduced this on the latest `main`.+ required: falsediff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.ymlnew file mode 100644index 00000000..1c1abb32--- /dev/null+++ b/.github/ISSUE_TEMPLATE/config.yml@@ -0,0 +1,8 @@+blank_issues_enabled: false+contact_links:+ - name: Documentation+ url: https://nandhakishorm.github.io/laya/+ about: Installation, routing, serving, fine-tuning and prediction hooks.+ - name: README and examples+ url: https://github.com/NandhaKishorM/laya#readme+ about: Quickstart, benchmarks and usage examples.diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.ymlnew file mode 100644index 00000000..de426101--- /dev/null+++ b/.github/ISSUE_TEMPLATE/feature_request.yml@@ -0,0 +1,58 @@+name: Feature request+description: Suggest an idea or a new capability.+title: "[feature]: "+labels: ["enhancement"]+body:+ - type: markdown+ attributes:+ value: |+ Thanks for sharing an idea. The most useful requests describe the problem and the use case,+ not only the proposed API. Please write in English if you can.++ - type: textarea+ id: problem+ attributes:+ label: The problem+ description: What are you trying to do, and what gets in the way today?+ validations:+ required: true++ - type: textarea+ id: proposal+ attributes:+ label: Proposed solution+ description: What would you like to see? A sketch of the API is welcome.+ validations:+ required: true++ - type: textarea+ id: alternatives+ attributes:+ label: Alternatives considered+ description: Any workarounds or other approaches you tried or thought about.+ validations:+ required: false++ - type: textarea+ id: use-case+ attributes:+ label: Use case+ description: How would this be used in practice? Concrete examples help a lot.+ validations:+ required: false++ - type: textarea+ id: prior-art+ attributes:+ label: Prior art+ description: Links to other projects, issues, or discussion that solve something similar.+ validations:+ required: false++ - type: checkboxes+ id: checklist+ attributes:+ label: Before submitting+ options:+ - label: I searched the existing issues and this is not a duplicate.+ required: truediff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.mdnew file mode 100644index 00000000..3ace824b--- /dev/null+++ b/.github/PULL_REQUEST_TEMPLATE.md@@ -0,0 +1,25 @@+## What++<!-- A short summary of the change. -->++## Why++<!-- The problem it solves, and the concrete use case. -->++## How it was verified++<!-- The exact commands you ran, and what they showed. -->++```bash+python tests/test_router.py+ruff check laya/ --select=E9,F63,F7,F82,F401,F811 --line-length=120+```++## Checklist++- [ ] Focused on one change (split unrelated work into another PR)+- [ ] Rebased on the latest `main`+- [ ] Tests pass locally+- [ ] Docs or examples updated when the public API changed++Fixes #diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.mdnew file mode 100644index 00000000..f5180cae--- /dev/null+++ b/CODE_OF_CONDUCT.md@@ -0,0 +1,111 @@+# Contributor Covenant Code of Conduct++## Our Pledge++We as members, contributors, and leaders pledge to make participation in our community a+harassment-free experience for everyone, regardless of age, body size, visible or invisible+disability, ethnicity, sex characteristics, gender identity and expression, level of experience,+education, socio-economic status, nationality, personal appearance, race, caste, color, religion,+or sexual identity and orientation.++We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive,+and healthy community.++## Our Standards++Examples of behavior that contributes to a positive environment for our community include:++* Demonstrating empathy and kindness toward other people+* Being respectful of differing opinions, viewpoints, and experiences+* Giving and gracefully accepting constructive feedback+* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience+* Focusing on what is best not just for us as individuals, but for the overall community++Examples of unacceptable behavior include:++* The use of sexualized language or imagery, and sexual attention or advances of any kind+* Trolling, insulting or derogatory comments, and personal or political attacks+* Public or private harassment+* Publishing others' private information, such as a physical or email address, without their explicit permission+* Other conduct which could reasonably be considered inappropriate in a professional setting++## Enforcement Responsibilities++Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior+and will take appropriate and fair corrective action in response to any behavior that they deem+inappropriate, threatening, offensive, or harmful.++Community leaders have the right and responsibility to remove, edit, or reject comments, commits,+code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and+will communicate reasons for moderation decisions when appropriate.++## Scope++This Code of Conduct applies within all community spaces, and also applies when an individual is+officially representing the community in public spaces. Examples of representing our community+include using an official email address, posting via an official social media account, or acting as+an appointed representative at an online or offline event.++## Enforcement++Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the+maintainer, NandhaKishorM, through a private message on GitHub. All complaints will be reviewed and+investigated promptly and fairly.++All community leaders are obligated to respect the privacy and security of the reporter of any+incident.++## Enforcement Guidelines++Community leaders will follow these Community Impact Guidelines in determining the consequences for+any action they deem in violation of this Code of Conduct:++### 1. Correction++**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or+unwelcome in the community.++**Consequence**: A private, written warning from community leaders, providing clarity around the+nature of the violation and an explanation of why the behavior was inappropriate. A public apology+may be requested.++### 2. Warning++**Community Impact**: A violation through a single incident or series of actions.++**Consequence**: A warning with consequences for continued behavior. No interaction with the people+involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified+period of time. This includes avoiding interactions in community spaces as well as external channels+like social media. Violating these terms may lead to a temporary or permanent ban.++### 3. Temporary Ban++**Community Impact**: A serious violation of community standards, including sustained inappropriate+behavior.++**Consequence**: A temporary ban from any sort of interaction or public communication with the+community for a specified period of time. No public or private interaction with the people involved,+including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this+period. Violating these terms may lead to a permanent ban.++### 4. Permanent Ban++**Community Impact**: Demonstrating a pattern of violation of community standards, including+sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement+of classes of individuals.++**Consequence**: A permanent ban from any sort of public interaction within the community.++## Attribution++This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at+https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.++Community Impact Guidelines were inspired by+[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).++[homepage]: https://www.contributor-covenant.org++For answers to common questions about this code of conduct, see the FAQ at+https://www.contributor-covenant.org/faq. Translations are available at+https://www.contributor-covenant.org/translations.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 00000000..91b8ef86--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,129 @@+# Contributing++Thanks for helping improve Laya. This guide keeps reviews fast and the history clean.++By taking part you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).++## Scope++Laya is a fast, local, on-device decision engine. Keep additions in that spirit: they should run+in the user's own process or on their own hardware, with no dependency on a hosted service or an+external API. A feature that only works against a hosted backend is out of scope for the core+package; it belongs in a separate integration or a community project.++## Ways to contribute++- Report a bug with the bug report template.+- Request or discuss a feature with the feature request template.+- Improve the docs under [`docs/`](docs/index.md), including the [hooks guide](docs/hooks/index.md).+- Fix a bug or add a feature with a focused pull request.+- Share benchmarks, evaluations, or integration reports, which the project treats as first class.++## Development setup++Laya supports Python 3.10 to 3.13. Use a virtual environment so nothing leaks into your system.++```bash+python -m venv .venv+source .venv/bin/activate+pip install -e ".[mcp]"+```++Optional extras are declared in `pyproject.toml`: `serve`, `fast`, `onnx`, `langchain`, `langgraph`.+Install the ones a change needs, for example `pip install -e ".[serve]"`.++The server and ONNX paths are exercised by `tests/test_serve.py` and `tests/test_onnx.py`, which+skip when their extras are not installed.++## Running the tests++Most suites are plain scripts, so no test runner is required:++```bash+python tests/test_router.py+python tests/test_criteria.py+python tests/test_hooks.py+python tests/test_hooks_api.py+```++A few are pytest based and run with `python -m pytest tests/test_serve.py`, `tests/test_onnx.py`+and `tests/test_truncation_direction.py`.++The full set, including the ones the CI runs, is in [`.github/workflows/ci.yml`](.github/workflows/ci.yml).+A handful of suites need hardware or local weights and are skipped otherwise: `tests/test_fast.py`+needs CUDA, and `tests/test_local_e2e.py` and `tests/test_mcp_local_e2e.py` expect checkpoints under+`~/laya_models`.++Before opening a pull request, run the lint and compile checks the CI runs:++```bash+ruff check laya/ --select=E9,F63,F7,F82,F401,F811 --line-length=120+python -m compileall -q laya/ tests/+```++## Style++- Keep the public API stable. If a change must move it, update `tests/test_hooks_api.py` in the same+ pull request, because that suite is the API contract.+- Prefer the standard library and what is already a dependency over a new one.+- Leave one runnable check behind for non-trivial logic: an assert based script is enough.+- Comment only where the code cannot say it, usually a non-obvious reason or a hardware caveat.+- Match the surrounding style rather than a personal preference.++## Commits++Use conventional commit prefixes, matching the history:++```+feat(agent): ...+fix(router): ...+perf(common): ...+docs(hooks): ...+test(batch): ...+```++Keep one logical change per commit. A focused pull request is much easier to review and merge than a+large one, and it is fine to split a big change into several PRs.++## Pull requests++The template asks for four things; filling them in is what makes review quick:++1. **What** changed.+2. **Why**, ideally the concrete use case, not only the mechanism.+3. **How it was verified**: the exact commands you ran.+4. Any follow-ups you deliberately left out.++Before you open one:++- Rebase onto the latest `main`, so the diff is only your change.+- Keep it focused; split unrelated work into another PR.+- Update docs or examples when the public API changes.+- Do not commit secrets, tokens, or large binary files.++If your change moves numbers, report the before and after: the maintainer verifies decisions against+real checkpoints, and measured deltas (probability changes, latency, memory) are what gets a change+merged.++## Reporting issues++The project is maintained in English, so please write issues in English when you can; it is the+common language for everyone reading and triaging.++Use the issue templates and include:++- What you expected and what you got.+- A minimal reproduction, ideally a short script.+- Your Laya version (`python -c "import laya; print(laya.__version__)"`), Python version, OS, and+ device or backend (CPU, CUDA, MPS, ONNX).++## Reviews++Reviewers may ask you to rebase, to split a change, or to add a regression test. Those are the+normal asks in this repository, not a rejection. If you disagree with a request, say so on the PR+and explain the tradeoff.++## License++By contributing you agree that your contributions are licensed under the+[Apache License 2.0](LICENSE).