Z
Zirnay Documentation v2.4.1
System One Intelligence • AI Infrastructure for Decisions
Launch Playground ↗ Interactive API Explorer Strands Decider ↗
DOCS / GET STARTED / Model Lifecycle: 5 Steps to Production

Model Lifecycle: 5 Steps to Production

Depicting the end-to-end operational journey: 1. Choose Model, 2. Create Configuration, 3. Train, 4. Test, and 5. Publish.

⏱ 6 min read • Zirnay v2.4.1 • Updated October 2026

The 5-Step Production Decision Workflow

In contrast to multi-turn generative conversational models, Zirnay System 1 Decision Primitives follow a deterministic, engineering-grade lifecycle. Every decision service is provisioned with explicit output schemas, calibrated with Platt scaling, tested in isolated sandboxes, and promoted to production using zero-downtime kernel memory mapping.

Lifecycle Pipeline Architecture
1
Choose Model Engine & Prefix
2
Create Config Schema & Classes
3
Train Model JSONL & Weights
4
Test Model Sandbox & SLA
5
Publish POSIX mmap Hot-Swap
STEP 1

Choose Model

Model selection registers an isolated identity record in your organization's metadata store, establishes the team namespace partition, provisions dedicated object storage prefixes (in Amazon S3 or Google Cloud Storage), and binds an explicit P99 latency SLA target budget.

A. Select Engine Architecture

AnyJev Engine Zero-Training CPU

Calibrated compact open-weight decision engine. Substantially reduces position and label bias via cyclic permutation averaging with zero retraining across version upgrades.

Laya Engine < 2.50ms P99

Non-autoregressive ModernBERT (421M parameter) encoder head. Purpose-built for text tokenization, transaction scoring, reflex prompt security guards, and categorical triage.

Strands-dc Engine Qwen Decider Model

Qwen-based open-weight decider model (Strands Decider) for model routing, tool selection, evaluations, guardrails, context management, and hybrid agent workflows.

B. Provision via API or Web Console

You can create the model using the Model Catalog Wizard (Go to Catalog) or programmatically via the Control Plane REST API:

Terminal • POST /v1/teams/:teamSlug/models
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models \
  -H "Authorization: Bearer $ZIRNAY_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cardholder Fraud Reflex Guard",
    "slug": "laya-card-auth",
    "engine_type": "laya",
    "version": "1.0.0",
    "p99_latency_budget_ms": 2.50,
    "storage_provider": "S3",
    "classes": ["APPROVE", "CHALLENGE", "DECLINE"],
    "description": "System 1 transaction risk scoring evaluated within card authorization SLA."
  }'
💡 Note on Model Slugs: Model slugs must be unique within your team. If creating a new custom model alongside the default seeded laya-card-auth, specify a distinct slug (e.g. custom-fraud-guard) to avoid an HTTP 409 Conflict error.
✅ Step 1 Outcome: Model ID generated (e.g. mdl_91af02bc) and dedicated object storage prefix provisioned in your organization's isolated bucket: gs://zirnay-checkpoints-{orgid}-acme-financial/fraud-ops/laya-card-auth/.
STEP 2

Create the Configuration (Specify What Needs to Be Done)

Unlike vague natural language prompts that hallucinate, Zirnay requires a formal mathematical configuration schema. The configuration specifies the exact decision primitive, allowed categorical classes, structured input feature schema, and probability calibration parameters.

A. Decision Primitives

  • choice: Multi-class categorical decision. Emits a discrete winner from your pre-defined list plus calibrated softmax probabilities summing to 1.0 (e.g., ["APPROVE", "CHALLENGE", "DECLINE"]).
  • yes_no: Binary reflex classification with sigmoid certainty (e.g., Is Malicious Phishing? [YES / NO]).
  • score: Normalized regression risk metric bounded between [0.0, 1.0].

B. Production Configuration Specification (model_config.json)

Save the task configuration as an immutable JSON document:

config/model_config.json
{
  "model_slug": "laya-card-auth",
  "engine_type": "laya",
  "version": "1.0.0",
  "query": {
    "type": "choice",
    "target": "Real-time card authorization risk evaluation",
    "options": ["APPROVE", "CHALLENGE", "DECLINE"],
    "fallback_option": "CHALLENGE"
  },
  "features_schema": {
    "raw_text": { "type": "string", "max_tokens": 64, "required": true },
    "amount_cents": { "type": "integer", "min": 0, "required": true },
    "currency": { "type": "string", "default": "USD" },
    "geo_entropy": { "type": "float", "min": 0.0, "max": 1.0, "required": false },
    "velocity_1h": { "type": "integer", "min": 0, "required": false }
  },
  "calibration": {
    "method": "platt_temperature_scaling",
    "temperature": 1.15,
    "target_ece": 0.025
  },
  "sla": {
    "p99_latency_budget_ms": 2.50,
    "hard_timeout_ms": 15.0
  }
}
🔒 Security & Reliability Guarantee: Because the output options are constrained strictly to Step 2 classes, there is no token generation step to hijack. Prompt injections cannot cause data exfiltration or prose leakage.
STEP 3

Train the Model

Training fine-tunes the non-autoregressive encoder representations on historical records, optimizes cross-entropy loss, and performs temperature Platt scaling so that output probabilities reflect true empirical error rates.

A. Prepare JSONL Dataset

Format historical events into a line-delimited JSONL file where each record satisfies your Step 2 schema:

dataset-train.jsonl
{"text": "Card swipe at electronics retailer in Lagos, Nigeria. Billing: US. Amount: $4,200", "label": "DECLINE", "features": {"amount_cents": 420000, "geo_entropy": 0.94, "velocity_1h": 6}}
{"text": "In-store grocery store contactless tap in home zip code. Amount: $34.50", "label": "APPROVE", "features": {"amount_cents": 3450, "geo_entropy": 0.02, "velocity_1h": 1}}
{"text": "New browser login followed immediately by $500 gift card purchase attempt", "label": "CHALLENGE", "features": {"amount_cents": 50000, "geo_entropy": 0.65, "velocity_1h": 3}}
🖥️ Web Console Interactive Workflow (Zero CLI Required)

You can perform the entire model training, calibration, and zero-downtime deployment cycle right inside the browser UI:

  1. Navigate to the Organization Console or Model Catalog in the top navigation bar.
  2. In the Team Models Registry, click "🔍 View Details & Lifecycle" on any model card.
  3. In the "📤 1. Upload Dataset" tab, drag-and-drop your .jsonl file or click "Load Sample Fraud Dataset" to inspect and upload your training corpus directly.
  4. In the "⚡ 2. Train Model" tab, configure epochs & learning rates and click "🚀 Start Training Run" to compile a new candidate checkpoint with real-time logs.
  5. In the "🎯 3. Test & Calibrate" tab, test sample events and tune the Platt Temperature Scaling slider ($T in [0.2, 2.0]$) to adjust confidence entropy.
  6. In the "🚀 4. Checkpoints & Promote" tab, click "🚀 Publish" to perform an atomic, zero-downtime POSIX mmap hot swap!

B. Programmatic Dataset Ingestion via Control Plane API (cURL / CI/CD)

For automated terminal scripts or CI/CD pipelines, authenticate using Zirnay tokens (Bearer $ZIRNAY_JWT_TOKEN or API key). External clients do not have direct access or credentials to underlying cloud storage buckets. Upload training sets directly through the Control Plane upload API:

Terminal • POST /v1/teams/:teamSlug/models/:modelSlug/datasets/upload
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/laya-card-auth/datasets/upload \
  -H "Authorization: Bearer $ZIRNAY_JWT_TOKEN" \
  -F "file=@dataset-train.jsonl" \
  -F "dataset_name=fraud-train-v1.jsonl"
HTTP 201 Created • Dataset Upload Response
{
  "dataset_id": "ds_9a12c84e",
  "filename": "fraud-train-v1.jsonl",
  "status": "READY",
  "record_count": 35000,
  "size_bytes": 1048576,
  "sha256": "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a",
  "created_at": "2026-10-11T19:30:00.000Z",
  "message": "Training dataset 'fraud-train-v1.jsonl' successfully uploaded and validated. You can now use dataset_id 'ds_9a12c84e' to trigger model training."
}
🔒 Zero Cloud Bucket Exposure: Clients never manage cloud IAM or bucket ARNs directly. The Zirnay Control Plane verifies authentication, parses and counts dataset records, computes SHA-256 integrity digests, and securely stages data in your team's isolated workspace.

C. Trigger Training via Control Plane API

Terminal • POST /v1/teams/:teamSlug/models/:modelSlug/train
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/laya-card-auth/train \
  -H "Authorization: Bearer $ZIRNAY_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset_id": "ds_9a12c84e",
    "hyperparameters": {
      "epochs": 12,
      "learning_rate": 0.0005,
      "batch_size": 128,
      "warmup_ratio": 0.1,
      "calibration_temperature": 1.15
    }
  }'
HTTP 200 OK • Training Completion Response
{
  "job_id": "job_tr_9128aa10",
  "status": "COMPLETED",
  "final_loss": 0.0421,
  "checkpoint": {
    "checkpoint_id": "chk_89f02c77",
    "storage_uri": "gs://zirnay-checkpoints-{orgid}-acme-financial/fraud-ops/laya-card-auth/chk_89f02c77.bin",
    "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "metrics": {
      "accuracy": 0.9842,
      "roc_auc": 0.9881,
      "ece_calibration_error": 0.021,
      "p99_latency_ms": 1.84
    }
  }
}
STEP 4

Test the Model (Pre-Flight Acceptance Gates)

Before routing production traffic to any new checkpoint, you must rigorously validate that the model satisfies three strict technical acceptance gates.

A. Three Pre-Flight Acceptance Gates

1. Calibrated Probabilities

Softmax outputs must sum to 1.00, and confidence scores must reflect true empirical likelihood (Expected Calibration Error ECE < 0.03).

2. Latency Budget Verification

Server execution reported via execution_nanos must confirm P99 < 2.50ms on warm volatile memory (RAM).

3. Strict Schema Conformance

Outcome must strictly match allowable Step 2 classes without generative token wander or prompt injection vulnerability.

B. Test in Decision Playground & via cURL

Open the System 1 Decision Playground to test inputs interactively, or run test queries via cURL:

Terminal • POST /v1/teams/:teamSlug/models/:modelSlug/decide
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/laya-card-auth/decide \
  -H "X-API-Key: zrn_live_98124acme" \
  -H "Content-Type: application/json" \
  -d '{
    "raw_text": "Card swipe at electronics retailer in Lagos, Nigeria. Billing country: US. Amount: $4,200.",
    "query": { "type": "choice", "options": ["APPROVE", "CHALLENGE", "DECLINE"] },
    "features": { "amount_cents": 420000, "geo_entropy": 0.94, "velocity_1h": 6 }
  }'
HTTP 200 OK • Test Verification Response
{
  "request_id": "req_test_88f0b71e-0129",
  "decision": "DECLINE",
  "confidence": 0.9842,
  "probabilities": {
    "DECLINE": 0.9842,
    "CHALLENGE": 0.0135,
    "APPROVE": 0.0023
  },
  "score_value": 0.9842,
  "checkpoint_id": "chk_89f02c77",
  "model_type": "laya",
  "execution_nanos": 1842000,
  "timestamp": "2026-10-10T19:30:00.000Z"
}
STEP 5

Promote the Model and Configuration to Production

Once testing validates the acceptance gates, promote the checkpoint to production. Zirnay activates the new weights across all warm worker instances with zero downtime using Linux kernel POSIX memory mapping (mmap).

A. Atomic Checkpoint Activation API

Terminal • POST /v1/teams/:teamSlug/models/:modelSlug/checkpoints/:checkpointId/activate
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/laya-card-auth/checkpoints/chk_89f02c77/activate \
  -H "Authorization: Bearer $ZIRNAY_JWT_TOKEN"
HTTP 200 OK • Production Activation Confirmation
{
  "message": "Checkpoint 'chk_89f02c77' successfully promoted to production with zero downtime.",
  "model_slug": "laya-card-auth",
  "team_slug": "fraud-ops",
  "checkpoint_id": "chk_89f02c77",
  "status": "ACTIVE_PRODUCTION",
  "hot_swap": {
    "mechanism": "POSIX_MMAP_PAGECACHE",
    "downtime_nanos": 0,
    "worker_nodes_synced": 12,
    "previous_checkpoint_id": "chk_01ac88f2"
  },
  "activated_at": "2026-10-10T19:35:00.000Z"
}

B. How Zero-Downtime POSIX mmap Hot-Swaps Work

1. Control Plane signals worker daemons with new Checkpoint ID & SHA-256.
2. Workers pre-fetch checkpoint binary from S3/GCS to local NVMe SSD.
3. Workers call mmap(2) to map binary tensors directly into Linux Page Cache.
4. Atomic pointer swap: Active model head pointer switches in <100 nanoseconds.
5. Previous checkpoint unmapped gracefully after active in-flight requests complete.

C. Instant 1-Click Rollback Safety Net

If any unforeseen distribution shift occurs in live traffic, roll back to the previously active checkpoint in zero downtime:

# Instant rollback to previous known-good checkpoint:
curl -X POST https://api.zirnay.com/v1/teams/fraud-ops/models/laya-card-auth/checkpoints/chk_01ac88f2/activate \
  -H "Authorization: Bearer $ZIRNAY_JWT_TOKEN"
📊 Production Telemetry Active: The promoted model is immediately visible in live dashboards, exported to Prometheus (daas_decision_requests_total), logged with PII redaction, and reported to Stripe Metered Billing.

Lifecycle Summary Matrix

Quick reference mapping actions, interfaces, inputs, and outputs across all 5 operational steps:

STEP OPERATIONAL ACTION PRIMARY INTERFACE PRIMARY INPUT DELIVERABLE ARTIFACT
Step 1 Choose Model Control Plane POST /models Engine type, slug, storage provider Model registry record & S3/GCS namespace
Step 2 Create Configuration Task Schema (model_config.json) Query primitive, classes, features, calibration Immutable decision contract schema
Step 3 Train Model Training API POST /train JSONL dataset URI & hyperparameters Trained Checkpoint binary + SHA-256 digest
Step 4 Test Model Playground UI & POST /decide Test transactions & synthetic vectors Calibrated probabilities & P99 SLA verification
Step 5 Publish Checkpoints POST /activate Validated checkpoint ID POSIX mmap hot-swap + Prometheus telemetry