laya driver connects Polyglot Decision to a separately deployed
typed-decision-lab service. The Python service is maintained outside the
InstructorPHP repository and Composer packages. One PHP driver works with
either the Laya-MLX or upstream PyTorch adapter because model selection,
loading, hardware, queues, and timeouts belong to the external service.
PHP never starts Python, invokes uv, downloads weights, selects a device, or
falls back to another provider.
Run the external service
Obtain the separately distributedtyped-decision-lab repository from your
deployment source. It has its own version, Git history, pyproject.toml,
uv.lock, CLI, tests, and runtime extras. From that repository, configure one
pinned adapter, route, and checkpoint revision:
uv run td-lab serve. Use that repository’s README for installation,
authentication, resource limits, adapter extras, and real-checkpoint smoke
commands. /healthz reports process liveness, while /readyz becomes
successful only after the checkpoint is loaded.
Configure PHP
Point the bundled preset at the already running service:laya-typed-decisions route. Other
bundled model records are laya and laya-multilingual. The service accepts
only its configured route; there is no automatic language or workflow routing.
Every question needs instructions because both reviewed Laya implementations
require that field. Text, object, and list state retain their System One shape
rather than being converted to classifier text.
Model action probability
Laya returns a separate action-head probability for each answer. Polyglot keeps it as a typed auxiliary signal:action.act_probability, and checks Laya’s redundant Noul confidence against
the confidence derived from its probability. Unknown fields, incomplete
answers, and inconsistent values fail closed.
Operational attribution
The returned model identity isroute@checkpoint-revision, not the ambiguous
upstream string laya-rl-agent. x-request-id becomes the provider request ID.
Backend, device, precision, revision, queue, inference, and server timing facts
remain available on DecisionResponse::responseData() and the external service’s
/v1/models and /stats endpoints.
Record those exact deployment facts when using the
provider evaluation workflow. Contract parity between MLX and
PyTorch does not establish equal calibration, latency, or application quality.