Engines and BYOK

Decisions run on Jev or Laya. Use Dcision's key on TypeSafe, bring your own OpenRouter, TypeSafe or Vercel AI Gateway key, or run Laya on your own server — plus cost, limits and errors.

Engines

Dcision runs decisions on two engines. Both are decision models — trained to return decisions and calibrated probabilities instead of generated text — and both speak the same System One contract: choice, score and probability questions answered with a probability distribution, which Dcision turns into typed answers, confidence and weighted levels.

Enginemetrics.engineWhat it isWhere it runs
Jev (default)"jev"TypeSafe's System One decision model.TypeSafe, OpenRouter or Vercel AI Gateway — on Dcision's key or yours.
Laya"laya"Open-source decision model (Apache 2.0) by Convai Innovations, 322M–421M parameters.A Laya server: yours, or Dcision's when available. See Laya.

Responses report the engine in metrics.engine and the exact model that answered in metrics.model.

The decision schema doesn't depend on the engine: Dcision compiles it into an engine-neutral representation and only the engine adapter speaks to the model. The state, the decision's context and the questions — text or structured JSON — are sent in the engine's native shapes, and all the questions of a decision go in one request.

Which engine runs a decision

Settings → Engine sets the workspace's default engine. A decision can pick its own in Engine & runtime → Engine (settings.engine); without it, it follows the default. Each engine keeps its own credential and model, so a workspace can run most decisions on Jev and one on Laya.

Jev: who runs the engine call

Choose it in Settings → Engine (Admins and the Owner). The choice applies immediately to every Jev decision of the workspace — Playground and API.

OptionWhat happens
Dcision engine key (default)Dcision calls TypeSafe (Jev direct) with its own key, included in your plan. Pick the model: jev-1.13.0 by default. Nothing else to configure.
My own provider key (BYOK)Dcision calls the engine with your key on the provider and model you choose. The provider bills your account directly.

Models on Dcision's key

ModelWhat it is
jev-1.13.0Pinned (default, recommended). A fixed version: answers — and confidence — don't change under you.
jev-latestThe latest stable release. Moves when TypeSafe ships a new version.
jev-previewPreview builds, ahead of jev-latest when one is available.

Aliases move when TypeSafe ships a new release, so the answers behind them can change without a change on your side. metrics.model and the execution log always record the exact version that answered — jev-1.13.0 even when you selected jev-latest.

Pin a model version

Thresholds such as minConfidence are tuned against a model. Use the pinned jev-1.13.0 for production decisions, and move to a new version on your own schedule after re-testing in the Playground.

Providers

All three expose the same System One contract:

ProviderEndpointModelsWhere to get a key
OpenRouterhttps://openrouter.ai/api/v1/systemonetypesafe/jev-1.13openrouter.ai/keys
TypeSafe (Jev direct)https://api.typesafe.ai/v1/systemonejev-1.13.0 (default), jev-latest, jev-previewdocs.typesafe.ai
Vercel AI Gatewayhttps://ai-gateway.vercel.sh/typesafe/v1/systemonetypesafe-ai/jevvercel.com/docs/ai-gateway

Laya

Laya is an open-source System One model: no per-token price, and it runs where you run it — your data never leaves your server. Its laya-serve server exposes the same /v1/systemone contract as Jev, so Dcision calls it with the same questions.

ModelWhat it is
autoDefault. Laya's router picks the checkpoint from the language of the input. metrics.model reports the one that answered, e.g. laya/multilingual.
englishEnglish checkpoint (ModernBERT-large, 421M). Reads up to 512 tokens.
multilingual100+ languages (mmBERT, 322M), the fastest. Reads up to 1,024 tokens.
typed-decisionsFine-tuned for agent observability and customer-service workflows. Reads up to 1,024 tokens.

Run your Laya server

Run laya-serve (Python 3.10+) on a host Dcision can reach over public HTTPS, behind your reverse proxy:

pip install "laya[serve]"
LAYA_API_KEY=<a long random secret> LAYA_PRELOAD=1 laya-serve   # listens on :8000

The project also ships a Dockerfile and compose files for CPU and CUDA. A GPU answers in ~35 ms; a CPU in a few hundred ms per decision.

In Settings → Engine → Laya server, enter the server's URL (https://laya.example.com — Dcision calls /v1/systemone on it) and the LAYA_API_KEY if you set one. Click Save server, then Test.

Select Laya as the default engine — or pick it in one decision's settings — choose the model and Save engine settings.

Protect your Laya server

laya-serve has no authentication unless LAYA_API_KEY is set. Set it before exposing the server, and paste it in Settings → Engine. Dcision only calls public https:// addresses — never private, loopback or cloud-metadata ones — and doesn't follow redirects.

Shorter context than Jev. Laya reads up to 512 tokens (english) or 1,024 (multilingual, typed-decisions) of state and question; longer inputs are truncated by the server. For long states, prefer multilingual or keep Jev. Re-test thresholds (minConfidence, policy ranges) in the Playground when moving a decision to Laya: each model has its own confidence profile.

Bring your own key

In Settings → Engine → Provider keys, paste the key next to the provider and click Save key.

Click Test. Dcision runs a tiny probe decision (the Spam Detection template on a one-line message) with your key and shows the model and latency, or the provider's error. The probe isn't recorded as an execution, but your provider may bill it.

Select My own provider key, the provider and the model, then Save engine settings. New runs use them immediately.

If you select My own provider key without saving a key for that provider, every run fails with 424 ENGINE_NOT_CONFIGURED.

How keys are protected

  • Encrypted at rest with AES-256-GCM; the API never returns them — only the last 4 characters are shown.
  • Never written to logs and never sent anywhere but the provider's endpoint.
  • Only Admins and the Owner can add, replace, test or remove them; everyone else in the workspace sees which providers have a key, with its last 4 characters.
  • Removing a key deletes it. Save a new key to rotate.

Keys for LLM destinations

The OpenRouter and Vercel AI Gateway keys saved here also power LLM destinations — the answers a decision can generate for a route. They are used for those answers even when the engine runs on Dcision's key, and the provider bills their tokens to your account. Dcision's engine key never runs LLM destinations.

Limits of the engine

  • Token budget. Jev reads the state once and evaluates every question against it: about 32,000 tokens for the state plus the longest question and 64,000 for the state plus all questions. Dcision checks both before the call and answers 422 INVALID_STATE when a state doesn't fit — see Limits.
  • Throughput. TypeSafe limits each account in requests and tokens per second. On Dcision's key, the limit is shared by all workspaces, so Dcision smooths bursts: a call waits for a free slot within its deadline instead of failing at once. With your own key, your provider account's limits apply.
  • Text only. The state must be text or JSON; convert images, audio or files to text first.

Cost

On Laya the engine cost is the server you run: Dcision estimates estimated_cost_usd: 0 for Laya calls. A successful API run still counts as a billable decision.

On Jev, each response includes metrics.input_tokens, metrics.output_tokens and metrics.estimated_cost_usd: the input tokens of the call times the model's price. Jev is priced at US$0.042 per 1M input tokens and doesn't bill output tokens — they are reported for observability only — so a decision of 375 input tokens is estimated at 0.00001575. This is an estimate of the engine cost — useful to compare decisions — not your Dcision invoice.

All the questions of a decision share one call, so adding a question adds its own tokens to the call, not another request.

With your own key, the provider bills the engine call. The call still counts as a billable decision on your Dcision plan when it succeeds through the API.

Engine errors

CodeStatusCause
ENGINE_NOT_CONFIGURED424No key saved for the selected provider, no Laya server for a Laya decision, or Dcision's engine key is unavailable.
ENGINE_AUTH_FAILED502The provider rejected the key (401/403). Check it in Settings → Engine.
ENGINE_RATE_LIMITED503The provider is overloaded or rate limited (429/503/529), or Dcision's shared key had no free slot before the deadline.
ENGINE_UNAVAILABLE503The provider failed (5xx) or couldn't be reached.
ENGINE_TIMEOUT504No answer within the decision's timeoutMs.
ENGINE_INVALID_REQUEST502The provider rejected the request; the message includes its reason. Also a Laya server URL that resolves to a private or reserved address.
ENGINE_ERROR502The engine answered outside the contract (for example an unknown option).

Within the decision's timeoutMs, Dcision makes up to 2 retries on network errors, 429/503/529 and other 5xx answers, honoring the provider's Retry-After — see timeoutMs. Failed runs are recorded as executions with status Error and are not billed. With onEngineError: "fallback", every error of this table except ENGINE_NOT_CONFIGURED becomes a 200 with the decision's fallback action. See Errors.

On this page