deciax
High-performance decision models on TPUs, powered by JAX and Pallas.
Development
Install the development tools and Git hooks:
uv sync
uv run pre-commit install
Run all checks manually with uv run pre-commit run --all-files.
Run the tests and type checks:
uv run pytest # TPU-only tests are skipped off-TPU
uv run mypy
Parity fixtures come from the PyTorch reference, Laya 0.4.4 at commit 682ac67. Install it with
uv sync --group reference and run scripts/export_reference.py.
Layout
| Path | Contents |
|---|---|
src/deciax/protocol/ |
Model-agnostic question/answer types and the /v1/systemone schema. Pure Python. |
src/deciax/models/ |
Checkpoint registry, the DecisionModel interface, the ModernBERT encoder. |
src/deciax/models/laya/ |
Laya: config, tokenizer, sequence construction, heads, calibration, weights. |
src/deciax/nn.py |
Backend-agnostic primitives (linear, layer norm, RoPE). |
src/deciax/ops/ |
The only place the backend forks (jax reference or pallas). |
src/deciax/kernels/ |
Attention: pure-jnp reference and the Pallas TPU kernel. |
src/deciax/runtime/ |
Shape buckets and the jit engine. |
src/deciax/serve/ |
python -m deciax.serve: stdlib HTTP server. |
Usage
import deciax
decider = deciax.load("laya") # or "laya-multilingual"; bf16 on TPU, fp32 elsewhere
decider.decide(
{"user": "I was charged twice this month, please fix it."},
{
"intent": {
"type": "choice",
"instructions": "What does the user want?",
"criteria": {"billing": "payments, refunds", "other": "everything else"},
},
"urgency": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": ["not urgent", "soon", "blocking"],
},
"angry": {"type": "noul", "instructions": "Is the user angry?"},
},
)
The response has the same shape as Laya's system_one response. Install with uv sync --extra tpu on a TPU host.
HTTP server
uv run python -m deciax.serve --model laya --model laya-multilingual --default-model laya-multilingual --port 8000
curl -s localhost:8000/v1/systemone -d '{"state": "I was charged twice", "questions": {"angry": {"type": "noul", "instructions": "Is the user angry?"}}}'
The server speaks the same /v1/systemone wire protocol as laya-serve:
- Routes:
POST /v1/systemone,POST /v1/systemone/batchandGET /health. - Requests and responses: the same request limits and status codes,
x_jev_confidenceon choice and score answers,--jev-strictand Bearer auth (DECIAX_API_KEY). - Request controls:
model,max_lenandhead_max_len.
There are two differences from laya-serve:
- No language routing. A request with no
model, the bundle id or an unknown id such asjev-1gets the default model. - The controls deciax does not implement return 422 instead of being ignored:
task,lang,lang_guess,min_confidence,batch_sizeandsort_by_length.
Every flag also reads an environment variable: DECIAX_HOST, DECIAX_PORT, DECIAX_MODELS,
DECIAX_DEFAULT_MODEL, DECIAX_MAX_CONCURRENT, DECIAX_JEV_STRICT, DECIAX_DTYPE, DECIAX_IMPL and
DECIAX_LOG_LEVEL.
Status
The Laya inference path works end to end. The runtime needs only JAX and tokenizers; it does not need
torch, transformers or laya. Parity against PyTorch Laya 0.4.4 (tests/laya/):
- Inputs: tokenizer ids and
input_ids/marker_posmatch token for token. - CPU fp32: option and act logits are within 1e-3 (act logits within 1e-5 relative). Responses match up to the last rounded digit.
- TPU bf16: probabilities are within 0.02 and the argmax matches, with both the
jaxandpallasattention.
impl="auto" uses XLA attention, which is faster than the Pallas flash kernel at these shapes.
Not yet supported:
- the parallel option layout
- per-language temperatures and binning maps
predict_longwindowing- tournament selection
- language routing between checkpoints
- benchmarks
Laya is Apache-2.0 (https://github.com/NandhaKishorM/laya). Code ported from it is attributed in each module docstring.
Metadata
Release files for deciax 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deciax-0.1.1.tar.gz | 24.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deciax-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.5 kB
Release files / deciax-0.1.1.tar.gz
| Download URL | deciax-0.1.1.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f19b9dd15a2d582672e124d1a29878ef0a6c8516a7ec1fba48d67626c0cc9d2
|
|
BLAKE2b-256 checksum How to use checksums |
4c568ac8d32a9a0f586e8cec7f4c4a76a1baa201028c2498e935d15d905bed4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / deciax-0.1.1-py3-none-any.whl
| Download URL | deciax-0.1.1-py3-none-any.whl |
|---|---|
| Size | 35.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
904986b09d4b4236bc38e87b2964ba556e5ad683df60382977839b3a6cb9993e
|
|
BLAKE2b-256 checksum How to use checksums |
8d0e5265cd92653156ab9674eb3137e56250962cd95d7d98c8f11c80ba0d03ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|