---
title: "Weka 1.0"
description: "Weka turns JSON state into typed decisions with probabilities. Use it when the next part of your application needs a value it can validate and act on."
slug: "models/weka"
sidebar:
  label: "Weka"
seo:
  title: "Weka 1.0 Public Preview"
  description: "Weka 1.0 is Autohand AI's first System One model for calibrated typed decisions through the API, SDK, and Console Playground."
---

<a id="overview"></a>

## Availability

Weka is in Public Preview on Lite, Pro, Pro+, Max, Team, and Enterprise. It is available only through the Autohand API, Autohand SDK, and Console Playground. Use the model ID `weka` with `POST /v1/decisions`.

:::info
**CLI support:** The Autohand Code CLI lists Weka for discovery, but cannot run it. Weka uses a structured decision contract rather than chat completions.
:::

Weka is Autohand's first System One model. We fine-tuned [Laya](https://laya-ai.com/), an open-source decision model, on the Autohand Coding-Agent Dataset, then trained it with Reinforcement Learning for Calibrated Decisions (RLCD) so its probabilities stay calibrated. Weka runs through Autohand inference. It is not a hosted copy of TypeSafe AI's Jev: JevBench is the public benchmark for Jev-style typed decision models, which is why Jev appears in the comparison below.

Weka uses a structured decision contract. It does not accept chat messages and cannot be called through `/v1/chat/completions`.

API and SDK calls use the same structured state, questions, answers, and quota checks.

## The request contract [#contract]

A Weka request has three top-level fields:

| Field | Meaning |
| --- | --- |
| `model` | The literal value `weka`. |
| `state` | The JSON facts Weka should evaluate. It can be a string, number, boolean, object, array, or `null`. |
| `questions` | A non-empty object of named `noul`, `choice`, or `score` questions. |

Autohand validates the questions before metering. A request needs at least one named question, and each question object accepts only `type`, `instructions` and `criteria`; any other key is rejected. A `choice` question takes 1 to 255 named options in `criteria`. A `score` question takes 2 to 10 ordered levels in `criteria`. A `noul` question needs only `instructions`; it may add `criteria` with a `true` and a `false` description of each outcome, and either key may be left out.

### Question types

| Type | Use it for | Limits | Answer |
| --- | --- | --- | --- |
| `noul` | A yes or no question where uncertainty matters. | `criteria` is optional: `{ "true": "…", "false": "…" }` describing each outcome. | A `noul` probability from 0 to 1. |
| `choice` | Selecting one named option. | 1 to 255 named options in `criteria`. | The selected key, confidence, and probability per option. |
| `score` | An ordered scale. | 2 to 10 ordered levels in `criteria`. | A numeric score, confidence, legend, and distribution. |

```bash title="cURL"
curl https://api.autohand.ai/v1/decisions \
  -H "Authorization: Bearer $AUTOHAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "weka",
    "state": {
      "tests": "passed",
      "changed_files": 14,
      "touches_payments": true
    },
    "questions": {
      "needs_review": {
        "type": "noul",
        "instructions": "Does this release need human review?",
        "criteria": {
          "true": "A person should look before this ships",
          "false": "Safe to ship on the normal lane"
        }
      },
      "release_lane": {
        "type": "choice",
        "instructions": "Choose the safest release lane.",
        "criteria": {
          "canary": "Deploy to a small cohort first",
          "stable": "Proceed to the normal rollout",
          "blocked": "Do not deploy"
        }
      },
      "risk": {
        "type": "score",
        "instructions": "Score operational risk.",
        "criteria": ["Low", "Medium", "High"]
      }
    }
  }'
```

```ts title="TypeScript"
type WekaDecision = {
  model: "weka";
  answers: Record<string, unknown>;
  usage: { input_tokens: number; output_tokens: number };
};

const response = await fetch("https://api.autohand.ai/v1/decisions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AUTOHAND_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "weka",
    state: releaseState,
    questions: releaseQuestions,
  }),
});

if (!response.ok) throw new Error(await response.text());
const decision = (await response.json()) as WekaDecision;
```

```python title="Python"
import os
import requests

response = requests.post(
    "https://api.autohand.ai/v1/decisions",
    headers={"Authorization": f"Bearer {os.environ['AUTOHAND_API_KEY']}"},
    json={
        "model": "weka",
        "state": release_state,
        "questions": release_questions,
    },
    timeout=30,
)
response.raise_for_status()
decision = response.json()
```

## Build a release gate [#release-gate]

Keep facts and policy separate. Send the current build facts to Weka, then let deterministic application code decide which probabilities are acceptable.

<img src="/images/docs/weka-release-light.svg" alt="Release signals and questions flow through Weka into a deterministic deployment policy" />

Weka evaluates the state. Your deployment code owns the final threshold and action.

### 1\. Describe observable state

```js
const releaseState = {
  commit: process.env.GIT_SHA,
  tests: { unit: "passed", integration: "passed" },
  changedFiles: 14,
  touchesPayments: true,
  previousIncidents: 1,
};
```

### 2\. Ask for values your pipeline can use

```js
const releaseQuestions = {
  needs_review: {
    type: "noul",
    instructions: "Does this change require human review before deployment?",
  },
  release_lane: {
    type: "choice",
    instructions: "Choose the safest release lane from the supplied state.",
    criteria: {
      canary: "Release to 5% of traffic first",
      stable: "Use the normal rollout",
      blocked: "Do not deploy",
    },
  },
  risk: {
    type: "score",
    instructions: "Score the operational risk.",
    criteria: ["Low", "Medium", "High", "Critical"],
  },
};
```

### 3\. Apply a deterministic threshold

```js
const lane = decision.answers.release_lane;
const review = decision.answers.needs_review;

if (lane.type !== "choice" || review.type !== "noul") {
  throw new Error("Unexpected Weka answer shape");
}

if (lane.choice === "blocked" || review.noul >= 0.8) {
  await requestHumanReview(decision);
} else if (lane.choice === "canary" && lane.confidence >= 0.7) {
  await deploy({ trafficPercent: 5 });
} else {
  await holdRelease(decision);
}
```

Do not treat confidence as permission by itself. Validate the answer type and selected key, then enforce thresholds in code that can be reviewed and tested.

## Triage an incident [#incident-triage]

Build one state object from observability data and recent delivery events. Ask Weka for severity and the next runbook branch.

<img src="/images/docs/weka-incident-light.svg" alt="Observability signals go to Weka and a typed answer chooses a runbook branch" />

The runbook consumes a typed answer instead of extracting intent from prose.

```text
questions = {
    "severity": {
        "type": "score",
        "instructions": "Score customer impact.",
        "criteria": ["No impact", "Degraded", "Major", "Critical"],
    },
    "response": {
        "type": "choice",
        "instructions": "Choose the next runbook branch.",
        "criteria": {
            "rollback": "The latest deployment is the likely cause",
            "investigate": "Evidence is incomplete or points elsewhere",
            "monitor": "The service is recovering without intervention",
        },
    },
}

decision = decide(state=incident_snapshot, questions=questions)
branch = decision["answers"]["response"]

if branch["confidence"] < 0.65:
    page_on_call(decision)
elif branch["choice"] == "rollback":
    run_rollback()
```

## Put Weka inside an agent workflow [#agent-loop]

An agent can use Weka after it has gathered evidence. A low confidence result can send the agent back for more information, while a blocked decision can hand control to a person.

<img src="/images/docs/weka-agent-light.svg" alt="An agent checks a proposed change with Weka and either continues, gathers evidence, or escalates" />

Use Weka as a decision step inside the loop, with explicit exits for uncertainty and review.

```text
for (let attempt = 0; attempt < 3; attempt += 1) {
  const decision = await decideWithWeka({
    patch: await agent.currentDiff(),
    checks: await collectCheckResults(),
    openQuestions: await agent.openQuestions(),
  });

  const next = decision.answers.next_step;
  if (next.type !== "choice") throw new Error("Invalid next_step answer");
  if (next.choice === "continue" && next.confidence >= 0.75) break;
  if (next.choice === "escalate") return handOffToReviewer(decision);
  await agent.gatherMoreEvidence(next.probabilities);
}
```

## Validate the response [#response]

The response repeats your question names under `answers`. Each answer is a discriminated object whose `type` matches the requested question.

```json
{
  "model": "weka",
  "answers": {
    "needs_review": {
      "type": "noul",
      "noul": 0.93
    },
    "release_lane": {
      "type": "choice",
      "choice": "canary",
      "confidence": 0.8,
      "probabilities": {
        "canary": 0.8,
        "stable": 0.16,
        "blocked": 0.04
      }
    },
    "risk": {
      "type": "score",
      "score": 1.54,
      "confidence": 0.72,
      "legend": {
        "0": "Low",
        "1": "Medium",
        "2": "High",
        "3": "Critical"
      },
      "probabilities": {
        "0": 0.08,
        "1": 0.42,
        "2": 0.38,
        "3": 0.12
      }
    }
  },
  "usage": {
    "input_tokens": 426,
    "output_tokens": 73
  }
}
```

Reject an unknown answer type, an option that was not offered, or missing question names. Log the input state version, answer, probabilities, and policy result when a decision changes production behavior.

## Use Weka through the API, SDK, or Console [#playground]

1. Open the [Console Playground](https://console.autohand.ai/playground/).
2. Select **Weka decisions**.
3. Start from the release gate or incident triage example.
4. Edit the JSON state and questions, then run the decision.
5. Inspect the typed answer, confidence, probability distribution, and token usage.

The Autohand SDK and Console Playground use the same `/v1/decisions` contract as a direct API request. Every surface uses the selected account and consumes the same plan allowance.

## How Weka compares on JevBench [#benchmark]

JevBench scores typed decision systems on intelligence, calibration, speed, and cost. Weka ranks second of 13 in this comparison of leading typed decision systems.

| System | Score | Intelligence | Calibration | Speed | Cost |
| --- | --- | --- | --- | --- | --- |
| **Jev 1.13.0** (TypeSafe AI) | **74.4** | 85.7 | 82.7 | 83.3 | 52.0 |
| **Weka** (Autohand AI) | **73.1** | **89.5** | **80.2** | **81.3** | **49.0** |
| **SemIf** (Qwen3.5-4B) | 73.1 | 79.0 | 72.6 | 83.7 | 59.5 |
| **djev** (Maisa · diffusion-gemma) | 73.0 | 82.7 | 65.4 | 91.4 | 57.6 |
| **Winnow-12B Q8** | 71.2 | 82.0 | 72.0 | 82.3 | 52.9 |
| **reflex 4B** | 70.3 | 80.1 | 75.2 | 68.0 | 59.7 |
| **jqv** (Qwen3-32B zero-shot) | 68.6 | 79.3 | 79.0 | 74.6 | 47.5 |
| **decision-machine-1** | 68.3 | 62.1 | 70.4 | 92.9 | 53.7 |
| **decider-35b-a3b** | 67.6 | 79.6 | 71.5 | 80.8 | 45.3 |
| **open-alternative-jev** (Qwen3.5-4B) | 67.0 | 64.0 | 63.2 | 83.5 | 59.6 |
| **system-one-open** (Gemma 4 E2B) | 66.6 | 69.5 | 56.7 | 77.0 | 64.8 |
| **OpenJev** (DiffusionGemma 26B-A4B) | 66.4 | 79.2 | 64.8 | 83.2 | 45.5 |
| **SimpleJev** (Qwen3.8-27B) | 66.3 | 84.7 | 81.1 | 71.2 | 39.5 |

JevBench v1.3.0 evaluates 534 decisions per system. Weka's row is Autohand's own JevBench v1.3.0 run and is pending a public listing on Benchmark Heaven. The other rows are taken from the [public leaderboard, task results, and methodology](https://benchmarkheaven.com/jev-models).

### How the score is calculated [#score]

Each axis is scored from 0 to 100. The JevBench score is the geometric mean of the four axes, with equal weight:

```text
score = (intelligence × calibration × speed × cost) ^ (1/4)
```

For Weka:

```text
score = (89.5 × 80.2 × 81.3 × 49.0) ^ (1/4)
      = 28,594,600 ^ (1/4)
      = 73.1
```

A geometric mean rewards balance. A weak axis pulls the score down further than it would in a plain average, so a system can't make up for a poor cost or calibration result by being very fast. That's why Weka's score (73.1) sits below the plain average of its axes (75.0): its cost axis (49.0) is its weakest. Every score in the table above is calculated the same way, rounded to one decimal.

## Use cases [#use-cases]

Twelve step-by-step workflows show how to shape state and questions for common decisions. [Browse all Weka use cases](/models/weka/use-cases).

**[Gate a deployment](/models/weka/use-cases/gate-a-deployment-with-weka)**

Turn release signals into a calibrated go or hold decision.

**[Gate risky tool calls](/models/weka/use-cases/gate-risky-tool-calls-with-weka)**

Score an agent's proposed tool call before it runs.

**[Detect agent loops](/models/weka/use-cases/detect-agent-loops-with-weka)**

Stop repeated work when no new evidence appears.

**[Triage CI failures](/models/weka/use-cases/triage-ci-failures-with-weka)**

Classify failing checks so the right owner acts first.

## Plans, quotas, and errors [#plans]

Weka is included on Lite, Pro, Pro+, Max, Team, and Enterprise. It is not included on Free. Weka and the hosted chat models share your plan's credit allowance and rate limits. Team and Enterprise credit limits are independent per member; calling the public API does not bypass metering.

| Plan | Weka |
| --- | --- |
| Free | Not included |
| Lite | Included |
| Pro | Included |
| Pro+ | Included |
| Max | Included |
| Team | Included |
| Enterprise | Included |

Free includes Fantail only. See the [Free plan](/getting-started/plans-and-pricing/free) for its limits and [Available models](/getting-started/plans-and-pricing/available-models) for all model entitlements.

Autohand checks the account before calling Weka. A denied request returns HTTP `429` with the exhausted quota window, reset time, and retry metadata.

Invalid state or questions return HTTP `400` before the request is metered, with the code `invalid_decision_request`. You get this for an unnamed question, a `choice` with 0 or more than 255 options, a `score` with fewer than 2 or more than 10 levels, or a key other than `type`, `instructions` and `criteria` on a question. The body looks like this:

```json
{"error":{"type":"invalid_decision_request","message":"Use model `weka` with a state and named noul, choice, or score questions. Choice requires 1-255 options; Score requires 2-10 levels."}}
```

Fix the request and resend; nothing was charged.

## Operational guidance [#security]

- Keep `AUTOHAND_API_KEY` on a server or in a secret store.
- Send the smallest state needed for the decision and omit secrets and personal data.
- Use reviewed thresholds for production actions and keep a human path for low confidence results.
- Version question instructions and criteria when decisions must be reproducible.
- Use idempotency in the action layer so retries do not deploy or roll back twice.

<AcademyCta course="building-with-the-autohand-api" title="Building with the Autohand API" blurb="Create a key, send your first chat completion, and ask Weka for typed decisions." />
