Accepts your rules
Send the state, questions and allowed answers. The server checks the request structure and prepares the model input. You define the classifier with every call.
BASAL-SERVE / ENGINE 2.0
The model provides probabilities. The inference server turns them into an answer your application, workflow or AI agent can use.
basal-serve loads the weights, handles requests and returns typed, calibrated decisions. You choose the model and hardware. The way you ask questions stays the same.
Open source · Apache 2.0 · your infrastructure
Requests · queue · calibration
One selected model per server process
choicenoulscoremultiacttoolThe weights hold what the model has learned. The engine determines how your program uses that knowledge.
Send the state, questions and allowed answers. The server checks the request structure and prepares the model input. You define the classifier with every call.
SOAM (State Once, Ask Many) lets several questions share the same state. The engine can also batch concurrent requests to make better use of the GPU.
It reads option probabilities, applies calibration and builds a JSON response. For cost-aware decisions, it computes the expected cost of actions and can return a deferral to a person.
vLLM, SGLang, MLX, Ollama and llama.cpp can run model computation. basal-serve provides the typed decision layer in front of them. Running the model in ordinary text-generation mode does not provide the same API.
Combine different question types in one request. basal-2.0 supports up to 255 options per question; Ollama mode has a limit of 20.
choiceWhich team should handle the ticket? You receive the selected option and a probability distribution.
noulDoes the description include an order number? The result is the probability of “yes”.
scoreHow urgent is the issue? Define ordered levels; the server returns their distribution and the expected level.
multiA complaint, delivery issue and refund request can all appear in one message. Each label has an independent probability; their sum does not have to equal 100%.
actexperimentalProvide the costs of actions for each possible outcome. The server selects the lowest expected cost, including when consulting a person is the best action.
toolexperimentalSupply tool definitions in MCP, OpenAI or Anthropic format. basal selects a tool, a direct answer, a question for the user or no suitable option.
"facts": "auto" adds computed dates and amounts to a Polish state. Code does the arithmetic; the model evaluates the facts against the process rules you describe.The same entry point for decisions, with different ways to run the computation. Choose the mode to match your hardware, weights and application traffic.
| Environment | Mode | What to know |
|---|---|---|
| NVIDIA GPU · text | fastfast-nocompile | The main PyTorch engine. Compilation and CUDA graphs in fast; quicker startup without compilation in fast-nocompile. |
| NVIDIA GPU · FP8 | fp8 | FP8 ports on a compatible GPU. HP ZGX Nano (NVIDIA DGX Spark) requires a CUDA stack suited to Blackwell. |
| Apple Silicon | mlxmps | MLX with 8-bit ports, or PyTorch on the Mac’s GPU. Use calibration appropriate to the selected engine. |
| CPU and local GGUF files | eager --device cpugguf / ollama / llamacpp | PyTorch on CPU or GGUF files. For Ollama and llama.cpp, basal-serve connects to a separately running server. |
| Alternative CUDA servers | vllmsglang | The same basal API over another computation backend. The default context is 4096 tokens; change it with --max-len. |
| basal-omni · images and audio | eager --media on | NVIDIA GPU, bf16 weights. This release has no fast mode or MLX, FP8 or GGUF ports. Send media through the HTTP API. |
NVFP4 mode on Blackwell is experimental and may reduce accuracy. The project documentation covers hardware requirements and dependency installation.
These examples assume engine 2.0, a compatible PyTorch installation and access to the specified weights. For the 4.5B model, disable the template cache with --template-prefix off.
basal-serve \
--model Remek/basal-2.0-4.5B \
--mode fast --template-prefix off \
--host 127.0.0.1 --port 8000Requires the basal[mlx] dependencies and an MLX port. The command serves the same HTTP API on a local port.
basal-serve \
--model Remek/basal-2.0-4.5B-MLX-8bit \
--mode mlx --host 127.0.0.1 --port 8000Requires basal[media] dependencies and an NVIDIA GPU. The media field in the HTTP API carries images and audio. Split video into frames and an audio track first.
basal-serve \
--model Remek/basal-omni-1.0-mini \
--mode eager --media on \
--host 127.0.0.1 --port 8000Send JSON to POST /v1/systemone. In n8n, use an HTTP Request node; in an application, a standard HTTP client or the basal Python client.
{
"state": "The parcel arrived damaged. Please replace it.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this issue?",
"criteria": {
"claims": "Complaints and product replacements",
"sales": "Questions before purchase",
"billing": "Invoices and payments"
}
},
"reply_needed": {
"type": "noul",
"instructions": "Does the customer expect a reply?"
}
}
}The answers field contains each question’s result under its name. choice returns an option key; noul returns the probability of “yes”. The response also includes model and usage, with the number of questions, tokens and computation time.
statequestionsanswersThis is a request definition, not a measured result. This example does not call the model.
GET /health Service healthGET /v1/models Information about the loaded modelPOST /v1/basal Alias for the decision APIMCP is a standard for connecting AI applications to tools. Engine 2.0 exposes its own MCP server: an agent can ask basal for a decision through the same kind of connection it uses for other tools.
decideState, question and options. Supports choice, noul, score and multi. Returns the question’s answer and the model name.
decide_manyThe full questions map, as in the HTTP API. Also supports act with costs and max_error, tool, and facts. Returns answers, model and usage.
Both tools only return decisions. They do not execute commands, call other tools or generate their arguments. Execution and permission checks belong to the application using MCP.
basal-serve \
--model Remek/basal-2.0-4.5B \
--mode fast --template-prefix off \
--host 127.0.0.1 --port 8000 --mcp onMCP requires the optional basal[mcp] dependencies. It is off by default. When enabled, /mcp uses Streamable HTTP on the same port and shares the queue with /v1/systemone.
In a client supporting Streamable HTTP, add http://127.0.0.1:8000/mcp. Example for Claude Code:
claude mcp add --transport http basal http://127.0.0.1:8000/mcpIf the client starts tools as local processes, use the basal-mcp bridge. Replace the executable path with your own absolute path:
{
"mcpServers": {
"basal": {
"command": "/path/to/basal-env/bin/basal-mcp",
"args": ["--url", "http://127.0.0.1:8000"]
}
}
}The bridge forwards requests to the running server; it does not load a second copy of the model.
Arguments for a decide_many tool call. The tool definitions are options to choose from; basal does not execute any of them here.
{
"state": "The customer asks where order ZAM-42 is. Its status has not been checked yet.",
"questions": {
"next_step": {
"type": "tool",
"instructions": "Which tool is needed now?",
"tools": [
{
"name": "get_order_status",
"description": "Reads the current status of an order.",
"inputSchema": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": [
"order_id"
]
}
},
{
"name": "list_products",
"description": "Lists the available products.",
"inputSchema": {
"type": "object",
"properties": {}
}
}
]
},
"missing_order_id": {
"type": "noul",
"instructions": "Is the order number missing?"
}
}
}The tool type returns a selected tool name or the answer_directly, ask_user or none option. The agent supplies arguments and handles execution according to its permissions.
The model on your own device. You can run basal on HP ZGX Nano and connect clients through an SSH tunnel or your own gateway. The server has no built-in authentication; control network access outside it. basal computation stays local, but an agent using a cloud LLM may separately send its context to that provider.
The current MCP interface. The tools accept a text or JSON state. They have no media parameter: send images and audio for basal-omni through the HTTP API. MCP and the tool type are experimental; check decision accuracy on your own tasks.
The main server options. Run basal-serve --help to see all flags and their values.
| Option | Purpose |
|---|---|
--model / --mode | A repository or local weights directory, and the computation backend. Each server process loads the selected model. |
--calibration | Your own calibration file. By default, the server uses an engine-specific file when supplied, or the base CALIBRATION.json. |
--soam on | A shared state for multiple questions and option orders. On by default; the effects depend on the backend and request. |
--max-batch--batch-window-ms | Batch concurrent requests. Defaults: a maximum of 64 and a 3 ms window under load; with no queue, computation starts immediately. |
--scheduler | Schedule long and short requests in the CUDA engine. Turning it off restores arrival-order processing. |
--deterministic | Reproducible answers on the same machine, without batching different clients’ requests. Applies to in-process engines and may reduce throughput. |
--context-overflow | truncate cuts the middle of an oversized state and reports it in usage.truncated; refuse rejects the request instead. |
--template-prefix off | Recommended for basal-2.0 4.5B: the template cache did not pass this model’s check. Mini and max can use auto. |
--log-decisions | Log probabilities to a JSONL file for process analysis and later use of feedback. |
--mcp on--media on | An optional agent interface, or image and audio support in the basal-omni HTTP API. Both are off by default and require the appropriate dependencies. |
max_error in act and tool questions uses thresholds from the calibration file. A missing threshold defers the decision to a person. A 5% target does not guarantee that error on new data — measure coverage and accuracy in your own process.
basal-calibrate fits temperatures and thresholds on labelled examples using the selected engine. This is a separate step; the server does not automatically learn from traffic.
--think auto is only for basal-2.0 4.5B, requires vLLM and is off by default. It reduced the Werdykt score. evidence requires a separate head that basal-2.0 models do not ship.