Coding with AI

llm-typesafe version 0.1a0 released

llm-typesafe v0.1a0 is an early-alpha plugin that connects TypeSafe AI's Jev model to Simon Willison's llm CLI. The article covers installation via one command, setting the API key, and running Jev's three structured question types: noul yes/no checks with confidence values, multiple-choice routing with JSON criteria, and score-based grading. Jev returns machine-readable JSON, ideal for automating ticket triage, message checks, and rubric scoring.

If you use Simon Willison's `llm` command-line tool and have been curious about TypeSafe AI's newly released Jev model, a new plugin called llm-typesafe (version 0.1a0) makes it easy to connect the two. This article walks you through installing the plugin, setting up your API key, and running the three kinds of structured questions Jev is designed for: yes/no ("noul") checks, multiple-choice routing, and scoring tasks. No prior plugin experience is needed—just a working `llm` installation and a few minutes.

What the plugin does

Jev is not a general chatbot model. It is built for classification-style questions where you want a clean, machine-readable answer rather than a paragraph of prose. The `llm-typesafe` plugin wires Jev into the standard `llm` CLI, so once it is installed you can pipe any text into the model and get structured output back. That makes it a good fit for automating workflows like triaging support tickets, checking whether a message contains a specific request, or rating documents against a rubric.

The plugin is an early alpha release (0.1a0), so expect rough edges, but the core features already work as described in its README.

Step 1: Install the plugin

With `llm` already installed, adding the plugin is a single command:

```
llm install llm-typesafe
```

That is all it takes. The plugin registers itself with `llm` and makes the Jev model available as a model option.

Step 2: Set your API key

You will need an API key from TypeSafe AI. The release notes mention that the waitlist for keys appears to move quite quickly, so it is worth signing up sooner rather than later. Once you have your key, store it with:

```
llm keys set typesafe

Paste key

```

You will be prompted to paste the key, and `llm` saves it for future runs.

Step 3: Run yes/no "noul" questions

The simplest use case is a binary check. Jev calls these "noul" questions, and instead of just saying yes or no, it returns a confidence value. For example, to check whether a message explicitly asks for a refund:

```
llm -m jev 'Please refund my last payment.' \
-s 'Does this message explicitly request a refund?'
```

The output looks like this:

```
{"type": "noul", "noul": 0.99}
```

In other words, the model is 99 percent confident the answer is yes. Because the result is JSON, you can pipe it straight into other scripts or tools.

Step 4: Run choice questions

For routing tasks, you can ask Jev to pick from a set of labeled options. You define the options using the `criteria` option as a JSON object. Here is an example that routes an incoming message to the right team:

```
cat message.txt | llm -m jev \
-s 'Which team should handle this message? If billing and technical issues both occur, choose billing.' \
-o answer_type choice \
-o criteria '{
"billing": "Charges, invoices, payments, or refunds",
"technical": "Problems installing or using the product",
"other": "Neither category fits"
}'
```

Notice the tie-breaking rule built into the system prompt: when a message mixes billing and technical issues, billing wins. Defining rules like this in the prompt is how you keep routing behavior consistent.

Step 5: Run scoring questions

The third pattern is scoring, where each possible score level is described in an ordered JSON array. This is useful for grading reports, feedback, or quality checks. For example, rating how reproducible a bug report is:

```
cat report.txt | llm -m jev \
-s 'How reproducible is the problem described in this report?' \
-o answer_type score \
-o criteria '[
"No reproduction instructions",
"Some instructions, but important steps are missing",
"Complete steps with expected and actual results"
]'
```

The model matches the text against your descriptions and returns the score level that fits best. Writing clear, mutually distinct descriptions for each level is the key to reliable results.

Why structured output matters

The main advantage of this setup over a general-purpose chat model is predictability. When you ask a chat model "does this message request a refund?", you might get a sentence, a paragraph, or an unexpected format. With Jev through `llm-typesafe`, you get consistent JSON every time, which matters enormously if you are chaining these calls into automated pipelines—ticket triage, content moderation queues, document review, and similar workflows all benefit from answers a program can parse without fragile string matching.

Common mistakes

  • Skipping the API key step. If you install the plugin but never run `llm keys set typesafe`, every request will fail. Make sure the key is stored before your first run.
  • Malformed JSON in criteria. Both `choice` and `score` modes expect valid JSON—objects with quoted keys for choices, arrays for scores. A stray quote or missing comma will break the request.
  • Vague score descriptions. If your score levels overlap (for example, "some instructions" versus "some instructions but incomplete"), the model will struggle to pick consistently. Make each level clearly distinct.
  • Forgetting tie-breaking rules. In choice questions, ambiguous inputs can flip between categories. Add explicit rules to the system prompt, like the "choose billing" instruction in the example above.
  • Treating alpha software as production-ready. Version 0.1a0 is an early release. Test thoroughly before relying on it in critical workflows, and check the README for updates and known limitations.

If you want to dig deeper into the available options and additional examples, the plugin's README covers everything in more detail.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.