Skip to main content

Kedi Laya

Local Laya decision models without a TypeSafe dependency. Pydantic AI and LangChain are optional integrations, not required to import the client.

Use kedi-decisions[laya-mlx] on Apple Silicon or kedi-decisions[laya] for upstream PyTorch. Add langchain for that framework. The current packages are development versions in this monorepo and have not been published yet.

from kedi_laya import LayaClient

with LayaClient("path/to/checkpoint", backend="mlx") as client:
    evaluator = client.as_evaluator(threshold=0.85)
    result = evaluator.evaluate_sync(
        state="The duplicate charge has been refunded.",
        schema={
            "type": "object",
            "properties": {
                "refunded": {"type": "boolean", "description": "Has the refund been completed?"}
            },
            "required": ["refunded"],
        },
    )
    print(result.values)

LayaModel and LayaChatModel are available from kedi_laya or their respective integrations.pydantic and integrations.langchain modules. They accept a checkpoint, backend, threshold, and load_options. A borrowed client can be shared between models; closing a wrapper never closes a borrowed client.

backend="auto" prefers an installed MLX runtime on Apple Silicon, otherwise selects Torch. Explicit mlx or torch makes deployment deterministic. Missing or failing selected runtimes raise an error; there is no inference-error fallback to another backend. Weights load lazily once per client. The provider identifier is always laya, and model.backend reports the selected runtime.

Laya's engine checkpoint vega (laya 0.5+, PyTorch) also reads one prompt image, audio or video per decision: Pydantic AI BinaryContent and LangChain base64 blocks are passed to it with the prompt text as question context, and text-only checkpoints reject media with the reason. See docs/LAYA.md.

MLX-owned models are checked against the actual tokenizer and context budget before inference. Injected predictors and Torch retain their own context handling. Real inference has been verified on the multilingual MLX checkpoint; Torch must not be considered verified by the mocked loader tests.

The optional tool selector only executes parameterless calls through the host framework. Parameterized tool choices raise ToolCallProposed; the model does not invent arguments. Raw generated text and unsupported schemas are rejected.

Metadata

Release files for kedi-laya 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kedi-laya 0.1.2
File Size Uploaded Provenance Actions
kedi_laya-0.1.2.tar.gz 16.7 kB Without provenance Details for kedi_laya-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kedi-laya 0.1.2
File Interpreter ABI Platform Actions
kedi_laya-0.1.2-py3-none-any.whl Python 3 none any Details for kedi_laya-0.1.2-py3-none-any.whl

Total release size: 27.3 kB

Release files / kedi_laya-0.1.2.tar.gz

Download URL kedi_laya-0.1.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3bfb5256e7d407d6cbc13a309eb75e64e2cd0f7cb2d9109d7d0ec7be75880fd2
BLAKE2b-256 checksum
How to use checksums
d13bda5a719593643bd36302d6140db87299a54e56154b26450888fc16e8fffb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / kedi_laya-0.1.2-py3-none-any.whl

Download URL kedi_laya-0.1.2-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fd960d786371679936fa44b832db028ebf44f792ae696e56b261df517f91816
BLAKE2b-256 checksum
How to use checksums
bbcf311b75373f9381bb7ba85f66d703dff3b25262376b780b09bb5e4525538f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for kedi-laya 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page