Skip to content

armgit / laya

Public Imported from GitHub
0

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.

4.9 KB
Raw Blame
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "laya"
version = "0.4.26"
description = "Fast, non-autoregressive System 1 decision engine with calibrated probabilities"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
authors = [
    { name = "Convai Innovations" }
]
keywords = ["decision-model", "rlcd", "calibration", "system-one", "routing", "guardrails", "moderation", "triage"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: Apache Software License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
    "torch>=2.0.0",
    "transformers>=4.48.0",
    "safetensors>=0.4.0",
    "huggingface_hub>=0.20.0",
    "numpy>=1.20.0",
    # vega's engine behind laya's surface, `laya.Agent(vegaml=True)` (laya/vega.py): conformal sets,
    # abstain and unbound flags, heads fitted on your labels, a refit calibration, 73k tokens of context,
    # images and speech. A core dependency since 0.4.23 so a plain `pip install laya` carries it; the
    # module itself is imported only when the argument is given, so `import laya` stays as light as before.
    "vegaml>=0.15.0",
]

[tool.setuptools]
# assets/, research/ and notebooks/ sit in the root, so auto-discovery bails out.
packages = ["laya", "laya.backends", "laya.mcp", "laya.integrations"]

[project.optional-dependencies]
# `pip install laya[serve]` adds the HTTP server (laya.serve / the laya-serve CLI).
serve = [
    "fastapi>=0.110.0",
    "uvicorn>=0.27.0",
    "python-multipart>=0.0.9",  # examples/server.py form uploads
]
# `pip install laya[fast]` adds the TileLang GPU fast path (laya/fast.py); everything else works without it.
fast = ["tilelang>=0.1.14"]

# `pip install laya[mcp]` adds the MCP stdio server (laya.mcp / the laya-mcp-server CLI).
mcp = ["mcp>=2.2.0"]

# `pip install laya[structured]` adds pydantic for the typed-model helpers (laya/structured.py).
structured = ["pydantic>=2.0.0"]

# `pip install laya[vision]` is what `Agent(vegaml=True).predict(image=...)`, `predict(video=...)` and the
# Router's `--image`/`--video` need: the reader's image processor is built on Pillow and torchvision.
# Text and speech need neither, which is why these are an extra and not core.
vision = ["pillow>=9.0", "torchvision>=0.19"]
# `pip install laya[audio]` decodes audio FILES (wav, flac, ogg, mp3) for `predict(audio=path)`; a numpy
# waveform with `sampling_rate=` needs nothing extra.
audio = ["soundfile>=0.12"]

# `pip install laya[onnx]` adds ONNX Runtime for `laya.onnx_agent` and `onnxscript`, which
# `torch.onnx.export` requires (`scripts/export_onnx.py`, `tests/test_onnx.py`).
#
# The NumPy cap is not about ONNX: the extra's own resolution (onnx -> ml-dtypes) otherwise
# pulls NumPy 2, and torch below 2.3 is built against NumPy 1.x and raises "Numpy is not
# available" when it converts a tensor against 2.x, which `predict()` needs for its final
# `.numpy()`. This package declares `torch>=2.0.0`, so the extra must not force a NumPy the
# declared floor cannot use.
#
# It is scoped by marker rather than written as a blanket `numpy<2`, because a hard upper cap
# binds every `laya[onnx]` install -- including the many on a current torch -- and makes the
# extra unresolvable next to anything else requiring `numpy>=2`. The marker names the stack this
# actually affects: the macOS/Intel checkout (#948), where torch tops out at 2.2.2 and NumPy 1.26
# satisfies onnx, onnxruntime and onnxscript. Every other platform resolves what `onnx` wants,
# so none of those three is quietly pinned to NumPy 1.x on its behalf.
onnx = ["onnx", "onnxruntime", "onnxscript",
        "numpy<2; platform_system == 'Darwin' and platform_machine == 'x86_64'"]

# `pip install laya[langchain]` adds the LangChain / LangGraph integrations (laya.integrations).
langchain = [
    "langchain-core>=0.2.0",
    "langgraph>=0.1.0",
]
langgraph = [
    "langchain-core>=0.2.0",
    "langgraph>=0.1.0",
]

# `pip install laya[llamaindex]` adds the LlamaIndex query router & selector integrations (laya.integrations).
llamaindex = [
    "llama-index-core>=0.10.0",
]

# `pip install laya[crewai]` adds the CrewAI multi-agent delegation router (laya.integrations).
crewai = [
    "crewai>=0.28.0",
]

# `pip install laya[agno]` adds the Agno multi-agent team routing and guardrail integration (laya.integrations).
agno = [
    "agno>=1.1.14,<4",
]

[project.scripts]
laya = "laya.cli:main"
laya-serve = "laya.serve:main"
laya-evals = "laya.evals_cli:main"
laya-mcp-server = "laya.mcp.server:main"
laya-train = "laya.train_cli:main"

[project.urls]
Homepage = "https://huggingface.co/convaiinnovations/laya"
Demo = "https://huggingface.co/spaces/convaiinnovations/laya-demo"