shipwithjev

Catalog / Research & data

0440GitHub

choosekit

Scores a finite set of choices with a model you already run in llama.cpp and returns a typed decision with a probability distribution.

NotXf1le/choosekitREADME ↗
# choosekit

`choosekit` scores a finite set of choices with a language model and returns a typed decision with a probability distribution. It supports local llama.cpp models and an optional OpenRouter backend.

```sh
npm install choosekit
```

## Why

Agents often need to choose from known options:

- approve or reject an action;
- route a message;
- select the next tool;
- classify evidence;
- choose one legal move.

`choosekit` scores choices using the model's conditional log probabilities at the token branches that distinguish them.

The project was inspired by [Jev and the System One model interface](https://typesafe.ai/blog/introducing-system-one-models-and-jev): application state in, typed probabilistic decisions out. Jev is a specialized hosted model. `choosekit` explores the same useful interface with a model you control. The llama.cpp backend keeps application state on infrastructure you choose; OpenRouter is available when a hosted model is more convenient.

`choosekit` is an independent project with no affiliation to TypeSafe or Jev.

## MCP server

[`choosekit-mcp`](packages/choosekit-mcp/README.md) exposes choosekit through llama.cpp or OpenRouter as a read-only stdio tool for Claude Code, Codex, and OpenCode. Select the backend and configure it with environment variables when starting the MCP server. Every `choose` call uses this configuration.

## llama.cpp

```ts
import { fromLlamaCpp } from "choosekit/llama-cpp";

const choose = fromLlamaCpp({
  baseURL: "http://127.0.0.1:8080/",
  mode: "labels",
});

const decision = await choose({
  context: "The deployment modifies production data and no backup exists.",
  question: "Should this action run without human approval?",
  choices: {
    yes: "The action is reversible, low-impact, and within scope.",
   

Also filed under Research & data

  1. 0607

    Verify: new-hire onboarding completion

    An agent reports onboarding done; the judge verifies access and equipment claims.

    everyai-com · Research & data

  2. 0606

    Triage: vague meeting request gets a disposition

    A vendor asks for 30 minutes with no agenda; the judge picks the disposition.

    everyai-com · Research & data

  3. 0605

    Triage: data-loss bug gets a severity

    A note-taking app silently drops edits on flaky networks; the judge grades severity.

    everyai-com · Research & data

  4. 0604

    Triage: crash report routing + reproducibility

    A crash report with steps and logs; the judge routes it and checks reproducibility.

    everyai-com · Research & data