All articles
New release17 min read

What's new in basal 3.0.3

The basal 3.0.3 engine, the first public 3.x release, is ready for production: about 3,700 engine tests on every change (Linux and Windows); it runs on NVIDIA GPUs, Apple Silicon and CPUs. New engines for Bielik / Llama models read two ways, the throughput of concurrent long requests is 1.7–3.6× higher than in 2.8 (8 clients), and the server gets a state cache on disk, a watch for stalled calls and a response cache. We also cover the cascade and the LLM fallback, decision rules, every change since 2.5, and five new models, basal-3.0 and basal-omni-2.0.

Remigiusz Kinas · ai5
basal 3.0.3 engine: production ready, the engine straight from PyPI; the throughput of concurrent long requests 1.7–3.6× higher than in 2.8 (8 clients); basal-omni-1.0-ultra in block FP8 on an H100 serves 2.3× more requests per second, with the same answers.

The basal 3.0.3 engine is ready for production. It is the first public 3.x release and a big one: the server bounds every input and watches for stalled calls, the state cache also works from disk, and long requests no longer take throughput from short ones. Bielik / Llama models get two new engines that read two ways: CUDA graphs on NVIDIA GPUs and Metal kernels on Apple Silicon. You install the engine from PyPI, the client separately, and pull the container image from ghcr.io. Five new models come out with 3.0.3: basal-3.0 on Bielik and basal-omni-2.0 on Gemma 4.

3.0.3 follows 2.8.1. The 2.x models answer as in 2.8, apart from a few changes listed in the box Upgrading from 2.x. No flag is removed, and every 2.8 endpoint and command still works. Almost everything new is opt-in. The exceptions are the stall watchdog and the new long-lane rule, described below. This post also covers everything that changed since the 2.5 release.

~3,700engine tests on every change, on Linux (Python 3.10 and 3.13), plus tests on Windows
2.1–3.1×the throughput of Bielik models in the new CUDA graph engine on an H100, with the same top answer in bf16
1.7–3.6×the throughput of concurrent long requests at 8 clients, against 2.8 (H100 and RTX PRO 6000)

Source of the engine numbers: the v3.0.3 release, the release notes of 2.5.1–2.8.1 and the documentation in the repository. Test counts: CI on the v3.0.3 release commit.

Production ready

For us, “production ready” means three things: the server does not fall over under traffic, an upgrade does not change answers without warning, and every change passes the same tests on several systems.

  • Limits on every input. Since 2.8 the server refuses an oversized request before doing any work: the limit on requests in flight (--max-requests, 1,024), the body size, the prompt text and the number of branches. 3.0 adds the router's own limit and the stall watchdog.
  • The same answers after an upgrade. We describe every known answer change in the release notes. On 8 November 2026 we compared the 3.0 development tree with the 2.8.0 release on an RTX PRO 6000 Blackwell: basal-omni-1.0-mini in --mode fast (also with --media on and with the state cache on disk) and basal-2.0-4.5B in --mode fast answered byte for byte as 2.8.0, apart from the changes in the box Upgrading from 2.x. 2.8.1 answers as 2.8.0, except that it refuses -FP8 checkpoints in some modes.
  • About 3,700 engine tests on every change. Every change runs about 3,700 engine tests on Linux (Python 3.10 and 3.13), a Windows smoke suite of 449, and the Python and TypeScript client suites (89 and 79). The Windows test builds and installs the package as from the release archive, starts basal-serve and sends a request. CI also checks the code and builds the package.
  • Clear messages at start-up. No C compiler on Linux, a model without a chat template, or both packages installed, basal and basal-engine: the server says so in one line at start-up. 3.0 requires torch 2.11 to 2.14, because we have not measured it on newer versions.
basal 3.0.3 engine · platforms
PlatformModesWhere checked
NVIDIA GPUs
(Hopper, Blackwell,
Ada, Ampere)
--mode fast (sm80+, Ampere and newer);
fp8 (Ada, Hopper, Blackwell);
nvfp4 (Blackwell);
int8 (sm80+);
--llama-graph on (Bielik / Llama);
container image
H100 and RTX PRO 6000 Blackwell (our 3.0 measurements);
RTX 4060 Ti, RTX 4090, RTX 5060 Ti and GB10
(contributors' measurements, engines 2.5.2–3.0)
Apple Silicon--mode mlx (default),
mps;
--mlx-forward metal (Bielik / Llama)
Apple M4 Pro 24 GB (3.0 tree, 8 November);
Apple M4 Pro 48 GB (Metal kernels);
MacBook Air M4 (2.x measurement)
CPU--mode eager, ggufCI tests on Linux and Windows
Older GPUs
(GTX 10xx, RX 480 / 580,
Iris Xe)
llama.cpp
with the Vulkan backend
the OLD_GPUS.md guide
AMD Strix Halo,
Google TPU
--mode strix,
--mode tpu
community-maintained;
the numbers are the contributors'

Systems: Linux (CI and GPU servers), Windows (CI on every change; native server start since 2.5.2) and macOS on Apple Silicon (measured on an M4 Pro).

Five new models on 3.0.3

Two model families come out with the engine. We describe their results, speed and formats in a separate post about the models.

  • basal-3.0, built on Bielik v3.0: basal-3.0-mini (4.5B, on Bielik-4.5B-v3.0-Instruct) and basal-3.0-max (11B, on Bielik-PL-11B-v3.0-Instruct). They read the state two ways: on NVIDIA GPUs with --llama-graph on, on Apple Silicon with --mlx-forward metal. Formats: bf16, FP8 (-FP8), MLX 8-bit (-MLX-8bit) and two kinds of GGUF. -GGUF reads the two-way model one way, at a cost its card measures, and -one-way-GGUF is a separately trained one-way model of the same size, with its own scores.
  • basal-omni-2.0, built on Gemma 4, text only: basal-omni-2.0-nano (Gemma 4 E2B), basal-omni-2.0-mini (Gemma 4 E4B) and basal-omni-2.0-max (Gemma 4 12B). nano and mini also come as GGUF and MLX ports, experimental and not recommended: they read these two-way models one way, and their cards measure the cost. basal-omni-2.0-mini replaces the November preview.
TERMINAL · NVIDIA GPU
basal-serve --model Remek/basal-3.0-mini --mode fast --llama-graph on --template-prefix off --port 8000

The 2.x models run in 3.0.3 as before: basal-2.0 (mini, 4.5B and max), basal-omni-1.0 and 1.1, and basal-omni-pico. The exception, from 2.8.1: an -FP8 checkpoint does not start in --mode eager, mps, mlx, strix or tpu, because these engines do not read its scales.

New kinds of models. 3.0 also serves dual models. They read a request with one question both ways. In a request with several questions they read the state prefix both ways once, and each question one way, over that prefix. --dual-reading auto chooses the reading by the number of questions. Prefix-bidirectional models are served the way they were trained.

New engines for Bielik / Llama and looped models

  • CUDA graphs for Bielik / Llama (--llama-graph on, opt-in). A separate pure-Triton engine with CUDA graphs, FP8 and INT8 weights and two-way reading. On an H100, against --llama-graph off on the same Bielik weights: the same top answer on the bundled decisions in bf16 (agreement 1.000), a 5–17× faster cold start and 2.1–3.1× the throughput. The engine has its own calibration (CALIBRATION.llamagraph*.json). A model without such a file is served with another engine's file, and its answers are marked "calibration": "unvalidated". The basal-3.0 models ship theirs. The default --llama-graph off answers as before.
  • Metal kernels on Apple Silicon (--mode mlx --mlx-forward metal, opt-in). Metal kernels for Bielik / Llama models, with two-way reading and their own calibration (CALIBRATION.mlx.metal.json). On a 48 GB Apple M4 Pro: 14–33% higher throughput with many requests at once, and state-cache hits up to 1.68× faster. The default MLX engine is unchanged.
  • Looped models (VarLoop, preview). A checkpoint with a varloop.json file runs its middle layers more than once per read, with learned gates between the passes, in --mode fast, fp8, int8 and eager. --varloop-passes T sets the number of passes, and --varloop-exit-tau τ stops after the first pass when the model is already confident. Models without varloop.json are served as before.

From 2.5 to 3.0.3: faster, a shorter start, less memory

Between 2.5 and 3.0.3 came releases 2.5.1–2.5.5, 2.6.0, 2.8.0 and 2.8.1. Each mostly changed reliability, but together they also brought clear speed-ups. Each row below compares one change with the version before it, on the same hardware.

From 2.5 to 3.0.3 · before and after the change
WhatReleaseBefore → afterWhere measured
Short requests next to long ones2.8median 3.9 s → 0.17 sRTX PRO 6000, basal-omni-1.0-mini,
60k-token states every 3 s
Concurrent long requests3.019.6 → 33.7 decisions/s (H100)
7.5 → 27.2 decisions/s (RTX PRO 6000)
basal-omni-1.0-mini,
8 clients
Ultra in block FP8 and int83.02.3 → 5.3 requests/s (FP8)
2.3 → 5.2 requests/s (int8)
H100, one question,
a state of about 1.5k tokens
Repeated states with PyTorch 2.133.017 → 124 questions/s (8 clients)
43 → 130 questions/s (16 clients)
RTX PRO 6000,
basal-omni-1.0-mini
CPU work per request2.83.1 → 1.75 ms (1 question)
10.8 → 4.8 ms (5 questions)
states of 1.5k and 6k tokens,
with the state cache
8-bit state cache: store / read2.811.3 / 6.4 ms → 1.3 / 0.5 msRTX PRO 6000, basal-2.0-4.5B
The last stage of basal-navigate3.077.8 → 6.5 s1,371 passages, RTX PRO 6000
basal-calibrate, refit3.087 → 6 s10,606 decisions, Apple M4 Pro
basal-omni-pico start in fast mode2.6220 → 80 sRTX PRO 6000
basal-omni-pico restart3.056 → 41 sRTX PRO 6000
Graph warm-up of basal-2.0-4.5B3.0498 → 459 s (H100)
530 → 313 s (RTX 4060 Ti)
empty compile caches
GPU memory of basal-omni-pico3.08.8 → 7.1 GiB at start-up
9.0 → 7.3 GiB at 8 clients
RTX PRO 6000 Blackwell Max-Q

Each row is a measurement from that release's notes. Numbers from different rows do not add up. A contributor measured the warm-up on the RTX 4060 Ti.

On top of that come changes the table does not show. Since 2.6, basal-2.0 in --mode fast and, on the H100 and RTX PRO 6000 Blackwell, basal-omni-pico give the same answers at every cold start, and 3.0 adds the same for --mode fp8. Since 2.5.4 a long first request no longer blocks the server for minutes, and since 2.6 a client that disconnects cancels its request.

Cascade, blend and LLM fallback in basal-router

basal-router, introduced in 2.5, puts several basal servers behind one port. On two H100s it served 1.58× the requests of one GPU. The modes that combine different models matter most, though:

Client basal-router requests in flight limit API keys prefix affinity trace: why this answer Level 1: pico fastest confidence below 0.8 Level 2: mini harder questions confidence below 0.9 Level 3: ultra largest model confidence below T The LLM fallback chat model, OpenAI API Answer from the first level that is confident answered_by says who answered a level is down: the previous answer stays Blend: every question to several models, a weighted mean of the probabilities
A cascade asks a larger model only when the smaller one is not confident. The thresholds 0.8 and 0.9 are an example; you set them yourself (--escalate-below).
  • Cascade (--escalate, --escalate-below). On the held-out half of the set, a mini → ultra cascade with a threshold of 0.95 served about 1.5× the requests of ultra alone on one H100, at the same accuracy (within 0.5 points).
  • Blend (--blend). Every question goes to several models, and the router returns a weighted mean of their probabilities. A mix of 0.6 ultra + 0.2 mini + 0.2 pico gave +0.45 points over ultra alone (95% interval: +0.09 to +0.81). It is an option for quality, not for speed.
  • The LLM fallback (--fallback). A choice question whose confidence is still below a threshold T after the last level goes to a chat model behind an OpenAI-compatible endpoint. With basal-omni-1.0-ultra and Gemma 4 31B-it with thinking at T = 0.8, the score rose by 1.40 points (95% interval: +0.90 to +1.89), and 8.4% of the questions went to the chat model. One call took 54 s at the median, though.

What 3.0 adds. The router has its own limit on requests in flight (--max-requests, 1,024 per replica by default) and beyond it answers 503 OVERLOADED, before it reads the request body. With --api-keys it checks API keys itself, and --max-requests-per-key stops one key from taking every place. "trace": true through the router explains the answer the router actually returns: a cascade level, the blend or the fallback. --prefix-affinity on and --state-holders on send a growing state, such as an agent's history, to the replica that has its beginning cached. On test replicas the share of state text computed again fell from 0.51 with 4 replicas to 0.17, a single replica's level. The option is based on the prefix affinity proposed by Miłosz Kucharski (#109).

We measured the cascade, the blend and the fallback in the 2.5 release on the held-out half of the set: the engine 2.5 post. The blend and the fallback are not calibrated.

Decision rules fitted to your data

A model returns probabilities, and the decision is usually the most probable option. Sometimes another boundary works better: a yes/no question with a threshold other than 0.5, or a score where the expected level matters. Decision rules (experimental, off by default) fit such a boundary to your labelled requests. The idea follows the experimental ReAnchor optimizer of DSPy; basal's implementation and its fitting rules are its own.

  1. basal-fit-decisions fit collects the probabilities from a running basal-serve. For each yes/no question it fits a threshold, and for each score a way to pick the level.
  2. It keeps a rule only when, on data it was not fitted on, the rule beats the model's most probable answer. It checks this twice: first out of fold on the fit part, then on the gate part, in a paired bootstrap of whole groups with Holm's correction.
  3. It reports the last part of the data once, with 95% intervals, for every rule: kept and rejected.
  4. basal-serve --decision-rules RULES.json serves the rules, and a question asks for a rule with the field "decision_rule". The answer gains the field decision, and the other fields do not change.

The rules file records the server's exact setup: the model identified tensor by tensor, the mode, the calibration and the engine version. A server with another setup does not start with that file, and names the fields that differ.

The gain depends on the deployment. The engine docs show an example on public data: basal-fit-decisions from basal 3.0 on the Typed Decisions benchmark, with basal-omni-2.0-mini (preview). The rules cover only yes/no and score questions, so the example has 14 answer spaces and 1,400 decisions from the test split. Accuracy rose from 74.9% to 75.6%, or +0.6 points (95% interval: −0.1 to +1.4), so the gain is not statistically significant. The tool kept three round rules for scores, together as one bundle: two gained (+2 and +8 points) and one lost 1 point. Every fitted yes/no threshold failed the check. The full table is in DECISION_RULES.md.

This is tuning for one deployment, not a general accuracy gain. It helps on a recurring family of questions for which you have your own labelled examples. Fitted thresholds are not covered by the model's certified max_error thresholds, so with max_error a decision other than the most probable answer abstains.

Installing from PyPI, npm and ghcr.io

From 3.0.3 every release is published straight from its tag, in four places:

  • basal-engine on PyPI: the server and all the tools. The import name stays basal, and the commands, such as basal-serve, basal-router and basal-calibrate, do not change. The extras keep their names ([fp8], [media], [mlx], [mcp]), and 3.0 adds [pdf].
  • basal-sdk on PyPI: the Python client alone, with httpx as its only dependency, without torch and without a model. You import it as basal_sdk. Alongside basal-engine, 2.x code (from basal.client import Basal) runs unchanged.
  • basal-client on npm: the TypeScript client. It now also runs in Cloudflare Workers and in browsers, Safari older than 16.4 included.
  • The container image ghcr.io/rkinas/basal-serve for NVIDIA GPUs: CUDA 12.8, torch 2.11.0, FlashAttention 3 and basal-engine[fp8,media], that is, the modes fast, fp8, eager and --media on in one image. One volume keeps the downloaded models and the compiled code between containers, the server does not run as root, and the health check reads GET /health.

The packages reach PyPI through trusted publishing, with no stored token, and basal-client reaches npm with provenance: each version is linked to the run that built it. A maintainer approves every upload. Installing from the release archive on GitHub still works.

TERMINAL · CLIENT ONLY
pip install basal-sdk
npm install basal-client
TERMINAL · CONTAINER
docker run --gpus all -p 8000:8000 -v basal-cache:/home/basal/.cache \
    ghcr.io/rkinas/basal-serve:3.0.3 --model Remek/basal-omni-2.0-mini --mode fast

Upgrading from 2.x? First uninstall basal. The old package basal and the new basal-engine hold the same files. Installed one over the other, they share them, and uninstalling basal afterwards deletes the files that basal-engine needs. When both are installed, basal-serve, basal-router and basal-calibrate say so at start. The package named basal on PyPI is an unrelated project.

A server for production

The state cache on disk

--state-cache-dir DIR also keeps every cached state as a file and reads it back when it is not in memory: the same state, or the longest stored beginning of a growing conversation, also after a server restart. The limit for the whole directory is set by --state-cache-disk-gb (20 GB by default), and the least recently used files go first. On an H100, a restarted server's answers from disk were byte-identical to its memory hits (basal-omni-1.0-mini at 16 and 8 bits, and basal-2.0-4.5B).

Request with a state 1. GPU memory --state-cache-gb fastest miss 2. Disk --state-cache-dir also after a restart miss 3. Compute the state again on the GPU a computed state goes to memory and to disk
Reading from disk pays off for long states and for slower or busy GPUs. For states of a few thousand tokens on an H100 it costs about as much as computing.

Disk is not always faster than computing: 8 repeated basal-navigate searches took 25.8 s from memory, 48.3 s from disk after a restart and 45.4 s cold. The disk tier works for models read one way, not yet for Qwen3.5.

The directory holds data derived from the prompts, including token IDs from which the text can be recovered. Keep it on a local disk that only the server's user can read, and encrypt it for sensitive data. The server creates directories with mode 0700 and files with 0600, refuses a directory others can access, and loads only files of the same model, version and settings that pass the checks. The feature is based on #79 by Paweł Kiszczak.

The stall watchdog

Until now, one stalled GPU call stopped the whole server: every request waited, and GET /health kept answering “ok”. In 3.0, the default --stall-s auto watches every engine call, including those with images and audio. A call that runs more than 20 times longer than expected, and at least 300 s, fails its own requests and those waiting with 503 ENGINE_STALLED, and /health answers 503 until the call ends. A router then sends that server no new requests.

With --stall-exit on the server exits with status 70, so that a supervisor (systemd or a container's restart policy) starts it again. The container image turns this option on. --stall-s off turns the watchdog off. Slow engines, such as a CPU in --mode eager or gguf, are not taken for stalled on their first long request.

The response cache

The same request sent again (a retry, a page reload, the same document from many users) was decided again. With --response-cache-mb MB the server returns the same response bytes from memory, without the engine, for --response-cache-ttl seconds (600 by default). The header x-basal-cache says hit or miss. The key covers the request body and the server's model, files, calibration and options, and with --api-keys also the client's key, so clients with different keys never share an entry. A repeated multipart/form-data upload hits the cache too.

Without API keys the cache is shared by every client, so a client can tell that someone else already sent the same request. Where that matters, keep the cache off.

The long lane and the main lane

short request long, fits the graphs longer than the graphs Main lane CUDA graphs, many requests at once Long lane one request at a time 3.0: when no short one waits out of memory: main lane waits over 30 s: gets the GPU for a whole call
In 2.8, under load, every long request went to the long lane, while the main lane's graphs sat mostly idle. --long-lane eager keeps 2.8's rule.
  • Concurrent long requests no longer cost half the throughput. In 3.0, --long-lane auto keeps a long request in the main lane when it fits the main lane's graphs and no short request waits there. basal-omni-1.0-mini at 8 clients: 33.7 instead of 19.6 decisions/s on an H100, and 27.2 instead of 7.5 on an RTX PRO 6000. The cost: a short request may wait for one call of a long one, 0.74 s median on the H100 instead of 0.02 s.
  • A long request no longer starves under a full queue. Under constant short traffic, a long request advanced about one layer per main-lane call. Gemma 4 31B on an RTX PRO 6000 at 32 clients: 29 of 1,000 requests waited 300 to 596 s. Now a long request that has waited 30 s gets the GPU for its whole call.
  • Running out of memory on the long lane no longer ends with a 503: the main lane takes such a request over.

A faster start, less memory and fixes

  • The rare HTTP 500 with --mode fast and the state cache is fixed, without a lock. This is the fix announced for 2.5.1. In a stress test on an RTX PRO 6000, with a compile in the server every 50 ms, 147 of 2,000 requests failed before the fix and 0 of 5,000 after it. In 20,000 ordinary requests there were 0 errors, at 1.02× the requests per second of the engine before the fix, where --state-cache-lock on gave 0.83×. That flag is no longer needed, though the server still accepts it.
  • Block FP8 and int8 on an H100 run at their kernels' speed. One kernel read its data a byte at a time, about 25× slower than the others. basal-omni-1.0-ultra on an H100: 5.3 instead of 2.3 requests per second in FP8, and 5.2 instead of 2.3 in int8, with identical answers.
  • --mode fp8 answers the same at every start, on an H100 and on an RTX PRO 6000 Blackwell, and starts sooner, because it no longer times kernel variants at start. In 2.8, two cold starts of basal-2.0-mini agreed byte for byte on 0 of 36 answers. So --mode fp8 answers differ from 2.8.0's. --mode fast (bf16) and the -FP8 checkpoints do not change.
  • FP8 for Qwen3.5 models in the fast engine, experimental (--mode fp8 --fp8-experimental on). No Qwen3.5 model shape has passed the paired accuracy check against bf16 yet: on a 4B model every configuration we tried failed it, most often on yes/no questions. So plain --mode fp8 refuses a Qwen3.5 model before reading its weights. With the flag the server runs it, gives the measured cost in a start-up warning and still needs the model's own FP8 calibration. A server in bf16 answers as before.
  • A shorter start of the CUDA graph engine for the basal-2.0 models: the warm-up runs only the first shapes of each graph family and captures the others directly. bf16 answers are byte-identical. By Miłosz Kucharski (#107).
  • basal-omni-pico: a restart and a start after basal-prepare no longer compile the kernels again (41 s instead of 56 s), and in the graph engine the model takes 1.7 GiB less GPU memory.
  • PyTorch 2.13 keeps the compile settings in every engine thread. Before, basal-omni with the state cache fell back to a slow path under load: 17 instead of 124 questions per second at 8 clients.
  • basal-omni on a Mac's GPU (--mode eager and mps) answers each request on its own, byte for byte as a request sent alone, and holds only one request in GPU memory at a time. Before, on a 24 GB Mac, 31 requests to basal-omni-1.0-mini in bf16, 4 at a time, took 6–11× as long as one at a time, because the system swapped. The MLX engine, the default on Apple Silicon, works as before.

extract and other tasks

The four tasks, classify, verify, compress and extract, are still experimental. In 3.0, extract reads the lines of an invoice or an order. An array of strings, numbers or objects in the schema becomes a list field. The engine generates nothing: for each line of the state it asks yes or no, is this an item, and then, in each line taken, it chooses the exact span that holds each field's value. Each item is one line of the document, and each value is exact text of that line, with character offsets. By default there are at most 50 items (maxItems).

List fields are weak for now. On 16 made-up invoices and orders, basal-omni-1.0-mini got the number of items right for 7 of 18 lists, and read 11 of 54 items and 43 of 138 fields fully right. Accuracy depends on the model, so check list fields on your own documents. When the exact items matter, extract one item at a time or ask explicit questions.

rank on long lists. A list in one shared context ("chunk": 0) is read in chunks of 50 candidates once its state is over 16,384 tokens. One shared context was slower there: 1.4× the time of chunks at 17,700 tokens and 6× at 84,000. The last stage of basal-navigate over 1,371 passages went from 77.8 to 6.5 s. This changes the answers for such lists, since each candidate is judged beside the 49 others of its chunk instead of beside all of them. Shorter lists in one context compute the shared state once instead of in every part of the request: 1.15–1.21× faster at 300–400 candidates, with identical probabilities. The idea came from Miłosz Kucharski (#112).

A single rank question no longer fills the server with its own requests: at most 256 of them run at once, and at most half of --max-requests. Before, a list in small chunks started them all at once (10,000 at "chunk": 1), and other clients got 503. By Dariusz Koryto (#142).

On Ollama, extract now reads text and list fields in documents longer than 19 lines too, which used to fail with a 422.

Requests, answers and clients

  • GET /v1/capabilities says what a server takes before you send a request: the endpoints, the question types, the number of options, the fields it serves and the limits. Through basal-router, the router's own limits are added.
  • "errors": "per_question": one invalid question no longer fails the whole request. It gets an answer with the fields error and code, and the other questions are answered as if it were not there.
  • "trace": true says why each question got its answer: the candidates, the probabilities, the threshold applied, the action and the reason in one sentence. The answers themselves are the same bytes as without the field.
  • Images and audio as files. /v1/systemone takes multipart/form-data, so media no longer have to go in the JSON as base64, a third larger than the files.
  • The Python and TypeScript clients have a timeout per call (timeout) and retries with a random wait (retries, backoff) after a 429, 502, 503 or 504 response, after a timeout and after a lost connection. The option fail_open (in TypeScript failOpen) then returns answers you supply instead of raising. A request the server refuses (422, 401, 403) still raises. Decisions change nothing on the server, so a retry is safe.
  • A 200 without answers is an error. The TypeScript client treats a 200 response without the field answers, from a proxy for example, as a server error, as the Python client does. By Dariusz Koryto (#143).

chat-classify and MCP tools

--chat-classify on is for LLM gateways. Gateways often route, block or tag text by asking a chat model for a number from a numbered list, an answer the model has to generate. With this option, POST /v1/chat/completions takes such an OpenAI request and turns the list into the options of one choice question about the last user message; 0 means “none” when the prompt says so. The reply is an ordinary chat completion with the chosen number, and on request also logprobs of the calibrated probabilities. The options are best given in a system message. Streaming, n above 1, tools and images are refused with OpenAI's error object.

MCP tools navigate and read_page (basal-serve --mcp on --mcp-tree, basal-mcp --tree) search a basal-navigate tree through the server. navigate returns the best passages with their page and headings, and read_page returns a node of the tree with its children and passages. An agent then reads a document piece by piece instead of getting all of its text in its context. Without a tree the tools are, as before, decide and decide_many.

basal-navigate reads PDFs (basal-engine[pdf]). Each page with text becomes a page of the tree, and its paragraphs become passages under the headings of the file's outline. A separate process reads the PDF within limits on size, pages and time, so a hostile file cannot take the build's memory or time. basal-navigate calibrate fits, on your labelled queries, how many pages to open so that the page with the answer is among them with the probability you choose. On a small test tree of 30 pages, --coverage 0.9 opened 2.4 pages on average (coverage on held-out queries 0.92) instead of 10 with a fixed keep of 10.

Calibration from production

The thresholds that automation relies on are best checked on decisions from your own traffic. 3.0 closes that loop:

basal-serve answers; the audit sample gets "review": true Decision log --log-decisions --log-requests Human reviews the audit sample and writes the labels basal-feedback basal-calibrate: new thresholds basal-fit-decisions: rules --calibration --decision-rules the loop from production
Only the audit sample goes into the calibration. Labels of deferred decisions alone would describe the uncertain tail, not the errors among the accepted decisions.
  • The audit sample (--review-sample P). The server marks "review": true on the automated answers of a random sample of requests, at rate P, for a person to review. The draw covers the request's id and content, so a retry of the same request is drawn as its first try was.
  • The decision log as calibration input (--log-decisions, --log-requests). Every log line now has the request's id, the serving configuration (model, revision, mode, the calibration file's hash) and the probability that the decision went to a person (review_p). --log-requests also stores each request's body, in most uses personal data. Images and audio go into the log only as their sha256 and size.
  • basal-feedback joins the log with your reviewers' labels into a file for basal-calibrate. It keeps only the audit sample, because a threshold certifies the errors among the accepted decisions.
  • A model's identity covers every tensor. Calibration and decision rules recognise a local model by every tensor, not by samples of its files. A file fitted on another checkpoint is therefore not used without notice.

The idea and the design of the audit sample and of the decision log as calibration input are by Dariusz Koryto (#57). basal-calibrate now refits about 14× faster, with the same result to the bit: 10,606 decisions over 78 families on an Apple M4 Pro in 6 s instead of 87 s. basal-fold-temperature folds a calibrated temperature into a checkpoint, so that vLLM, SGLang, llama.cpp and transformers return calibrated probabilities without basal-serve.

Honest about the limits

  • Decision rules are experimental, and their gain depends on the deployment. The file format and the fields may change in a later release. After any change to the model, the calibration or the mode, fit the rules again.
  • List fields in extract are experimental and weak for now (results above). Check them on your own documents.
  • The state cache on disk does not always speed things up. For states of a few thousand tokens on an H100, reading costs as much as computing, and in bursts some writes are dropped (43% and 57% in two basal-navigate runs). It does not work for Qwen3.5 yet.
  • The new long-lane rule has a cost: a short request may wait for a call of a long one. When short answers must be fastest, use --long-lane eager. Which lane answers a long request moves its probabilities in the last digits, and on the uncalibrated Gemma 4 31B by up to 0.21. So send reproducible evaluations from one client, or serve with --deterministic.
  • FP8 for Qwen3.5 through vLLM saves memory (weights of 4.7 instead of 7.9 GiB on a 4B model), but at 1–4 clients it is slower than bf16 and changes more decisions. It is not for decisions that must match bf16.
  • The audit sample trusts the client on one point. A client that sends the same request again under new ids until its answer comes back unmarked keeps that answer out of review. Every try stays in the log, though.
  • Without API keys the response cache is shared, so a client can learn that someone sent the same request.
  • The preset question sets have hand-picked thresholds, not certified for any model. For a certified decision use max_error and check it on your own data.
  • NVFP4 stays experimental. On basal-2.0-mini (RTX PRO 6000), 78.0% of decisions are the same as in bf16.
  • Support for looped models (VarLoop) is a preview, as the release notes describe it.
  • --llama-graph on and --mlx-forward metal have their own calibration files. A model without its own CALIBRATION.llamagraph*.json is served with another engine's file, and its answers are marked "calibration": "unvalidated". The basal-3.0 models ship theirs.

Thank you, community

  • Miłosz Kucharski (@Butterski): a shorter start of the CUDA graph engine (#107); basal-router --prefix-affinity is based on the proposed prefix affinity (#109); the idea that a split rank group computes its shared state once (#112); the compact half of #101 (--batches compact on torch 2.11).
  • Paweł Kiszczak (@pawelkiszczak): the disk tier of the state cache is based on #79.
  • Dariusz Koryto (@dkoryto): the idea and the design of the decision log as calibration input and of the audit sample (#57), a request limit for each question of type rank (#142) and a sturdier TypeScript client (#143).

In release 2.8.0, which prepared the ground for 3.0.3, Rafal Wiktorowicz (NovaraX) and Marcin Brzeżański also helped.

Upgrading from 2.x

You run basal-serve or basal-router:

  1. uv pip uninstall basal, then install basal-engine; torch first, from the CUDA index your driver takes.
  2. Under a supervisor, turn on --stall-exit on.
  3. More than 1,024 requests at once per router replica: raise basal-router --max-requests.
  4. Short requests must stay fastest next to long ones: --long-lane eager.
  5. Prepared start-up: run basal-prepare again, since the directories 2.x wrote are not loaded.
  6. Linux with modes that build Triton kernels: install a C compiler (gcc and libc6-dev).
  7. An -FP8 checkpoint: serve it in --mode fast, fp8 or vllm. From 2.8.1 the engine refuses it in --mode eager, mps, mlx, strix and tpu, also when such a mode would be the default.
  8. --mode fp8 (torchao FP8 on the basal-2.0 models) now answers the same at every start, on an H100 and an RTX PRO 6000, and differently from 2.8, so recheck your thresholds in this mode.

Your code sends questions to a server: an application that only calls a server installs basal-sdk and imports basal_sdk. With retries set, expect retries after 429, 502, 504 and lost connections too. Handle 503 OVERLOADED and ENGINE_STALLED like any 503.

Answers that change: --mode fp8, long rank lists read with "chunk": 0, text fields of extract in requests with "think": "off", concurrent long requests under --long-lane auto (in the last digits), basal-omni on a Mac's GPU, the text and list fields of extract in --mode ollama over documents of more than 19 lines, and early_exit in the second round of extract (--mode fast-exit). The full list: UPGRADING.md.

Getting started

NVIDIA GPU, with uv in a fresh environment:

TERMINAL
uv venv --python 3.12 --allow-existing ~/basal-env && source ~/basal-env/bin/activate
uv pip install torch==2.11.0 torchvision==0.26.0 --index-url https://download.pytorch.org/whl/cu128
uv pip install "basal-engine[media]"
basal-serve --model Remek/basal-omni-2.0-mini --mode fast

Apple Silicon, with the native arm64 Python:

TERMINAL
uv python install cpython-3.12-macos-aarch64-none
uv venv --python cpython-3.12-macos-aarch64-none --allow-existing ~/basal-env && source ~/basal-env/bin/activate
uv pip install "basal-engine[mlx]"
basal-serve --model Remek/basal-3.0-mini-MLX-8bit --mode mlx --mlx-forward metal --port 8000

To see why the model chose its answer, add to the request "trace": true:

POST /v1/systemone · application/json
{
  "state": "Klient: od wczoraj nie mogę zalogować się do bankowości internetowej, system pokazuje błąd hasła.",
  "questions": {
    "dzial": {
      "type": "choice",
      "instructions": "Do którego działu skierować zgłoszenie?",
      "criteria": {
        "karty": "Reklamacje kart",
        "online": "Wsparcie bankowości elektronicznej",
        "kredyty": "Kredyty"
      },
      "max_error": 0.05
    }
  },
  "trace": true
}

This is an example request; we do not simulate its results. The answer has the same bytes as without trace, and beside it, for each question, a description: the candidates, the probabilities, the threshold, the action and the reason.

After the upgrade the 2.x models answer as in 2.8, apart from the changes in the box above. Measure each new option on your own requests before it goes to production.

Full release notes → · Upgrading from 2.x, step by step → · Decision rules → · Inference server, REST and MCP →