Skip to content

Setup: Local Decision Model

Run a small Decision model on your own machine and register it in TomoriBot. A Decision model answers questions about a text, such as yes or no or which of several topics fits, with probabilities. Kev is an open one that speaks the System One protocol, the same one TypeSafe’s hosted Jev uses.

Kev needs Git, uv, and Python 3.12 or 3.13 (uv installs Python for you if needed). Pick a size that fits your memory:

ModelHub IDWeights (approx.)Notes
Kev-0.8Bjaredpalmer/kev-0.8b2 GBRuns on a 4 GB GPU. Least accurate.
Kev-4Bjaredpalmer/kev-4b8-9 GBKev’s recommended starting point if it fits in your memory.

Clone Kev somewhere outside the TomoriBot folder and start the server for your OS:

These steps were checked on native Windows with an NVIDIA GPU. If the server does not start natively, run the Linux steps inside WSL2 instead.

Terminal window
git clone https://github.com/jaredpalmer/kev.git
cd kev
uv sync --extra serve

On Windows with an NVIDIA GPU, uv sync installs a CPU-only PyTorch build, which is far too slow. Replace it with the CUDA build and check that it sees your GPU:

Terminal window
uv pip install --reinstall-package torch "torch>=2.6,<2.9" --index-url https://download.pytorch.org/whl/cu128
uv run --no-sync python -c "import torch; print(torch.cuda.is_available())"

It must print True. From then on, start Kev with uv run --no-sync, because a plain uv run syncs the CPU build back in:

Terminal window
uv run --no-sync python -m kev.serve --run jaredpalmer/kev-4b --port 8009 --device cuda

--device cuda makes Kev fail loudly if it cannot use your GPU instead of silently running on the CPU. Use jaredpalmer/kev-0.8b if Kev-4B runs out of memory.

Leave the server running and check it from another PowerShell window:

Terminal window
Invoke-RestMethod http://127.0.0.1:8009/v1/models
$body = '{"state":"The fictional door is blue.","model":"kev-latest","questions":{"q":{"type":"noul","instructions":"Is the door blue?"}}}'
Invoke-RestMethod http://127.0.0.1:8009/v1/systemone -Method Post -ContentType "application/json" -Body $body

The first run downloads the model, so it takes a few minutes. The model-list check returns kev-latest, and the System One check returns a probability between 0 and 1 for the yes/no question.

Kev prints a warning that flash-linear-attention is missing when those kernels are unavailable. It then uses a slower path that gives the same answers, so you can ignore it.

Run /providers, choose Add New Custom Endpoint, and enter:

FieldValue
Endpoint Labelkev
Endpoint URLhttp://127.0.0.1:8009/v1
API CompatibilitySystem One compatible
Auth TokenLeave blank, unless you set KEV_API_KEY

TomoriBot checks GET /v1/models when you save. A server that answers 404 or 405 there is still accepted.

Open the saved kev endpoint, choose + Add new Decision Model from its model dropdown, and enter:

  • Code Name: kev-latest, the model name Kev’s examples use.
  • Context Window: 8192, the longest text Kev-0.8B and Kev-4B are validated for. Kev refuses anything over 65,536 tokens.

Open /config > Models > Switch Models and pick kev-latest in the Decision slot. - No Model clears it without deleting the registration.

  • Stop the server with Ctrl+C. TomoriBot does not start or stop Kev for you.
  • TomoriBot in Docker? 127.0.0.1 inside the container is not your host. Use http://host.docker.internal:8009/v1 and start Kev with --host 0.0.0.0. Kev has no login by default, so set KEV_API_KEY first and put the same value in Auth Token.
  • Production runtimes enforce HTTPS and block private addresses for provider endpoints. A local HTTP URL works outside production when ALLOW_PRIVATE_NETWORK is true or lists its host:port. See Local LLM.
  • Other System One servers such as Laya use the same steps with their own URL and model name. A server that implements the OpenAI Decisions API uses OpenAI Decisions compatible instead.