AISBF Logo AISBF

AI Service Broker Framework — AI Should Be Free

CoderAI documentation · source-backed from Nexlab/coderai

Inference engines

CoderAI is not tied to one runtime. Each model picks the engine that can actually serve it — from HuggingFace Transformers to native C MoE engines that stream a multi-terabyte model off disk, to a GPU rented by the second.

Why more than one engine

A 7B safetensors model and a 2.78-trillion-parameter mixture-of-experts checkpoint are not the same problem. The first wants PyTorch. The second wants an engine that keeps the dense trunk resident and streams routed experts off NVMe, because it will never fit anywhere else.

So CoderAI treats the runtime as a per-model decision. Every model entry in models.json can carry a backend pin; the front proxy routes the request to an engine node that declares the matching capability, and the engine dispatches to the right backend class. CoderAI owns the whole lifecycle of each external engine: cloning and building it, downloading its weights, supervising the process, sharing VRAM with the other tenants, and tearing it down.

The engine matrix

backendEngineShapeWhat it is for
transformersPyTorch + HF Transformersin-processsafetensors models on CUDA, with 4/8-bit quantization and offload
ggufllama.cppin-processGGUF models on CUDA or Vulkan — the AMD/Intel path
ds4ds4 / DwarfStarHTTP subprocessDeepSeek-V4, from-scratch native C/CUDA engine with its own OpenAI server
colibricolibrinative wire protocolGLM-5.2, DeepSeek-V4 and Kimi-K3 — a pure-C MoE engine streaming experts from disk
k3kimi-k3-in-cnative wire protocolKimi-K3 (2.78T params) on CPU, in as little as ~8 GB RAM
ktktransformers via SGLangHTTP subprocessCPU+GPU heterogeneous MoE: DeepSeek, Kimi, Qwen, GLM, MiniMax
vllmvLLMHTTP subprocess, isolated venvcontinuous batching + paged KV for high aggregate throughput
runpodRunPodremote HTTPa GPU rented by the second — see the RunPod guide

How an engine is chosen

Selection is deliberately conservative, because guessing wrong means loading tens of gigabytes onto the wrong device. In order:

  1. An explicit backend pin on the model entry wins outright.
  2. An enabled engine's model_id alias — if you configured colibri.model_id and the request names it, colibri serves it.
  3. An unambiguous name claim — e.g. a GGUF whose architecture only ds4 can read. Engines that could collide with everything else (kt, vllm, runpod) never claim by name; they must be pinned.
{
  "text_models": [
    { "id": "glm-5.2",        "backend": "colibri", "enabled": true },
    { "id": "kimi-k3",        "backend": "k3",      "enabled": true },
    { "id": "Qwen/Qwen3.5-9B","backend": "vllm",    "enabled": true },
    { "id": "cloud-70b",      "backend": "runpod",  "enabled": true, "runpod": { "mode": "pods" } }
  ]
}

Isolated environments

Dependency conflicts

Its own venv, its own torch

vLLM pins its own torch/CUDA build, which cannot coexist with the main CoderAI environment. It therefore runs in an isolated virtualenv built from requirements-vllm.txt. The same pattern is used for pyannote diarization, NVIDIA NeMo and CrisperWhisper.

Native builds

Built on first use

ds4, colibri and k3 are C engines. CoderAI clones and builds them on first use, applies the patches it needs (a resident serve loop for k3), and manages the resulting binary as a supervised subprocess.

Co-tenancy

Sharing one GPU

External engines participate in the same VRAM accounting as local models: they are eviction-tracked, they take part in thermal throttling, and a cross-engine swap gate batches same-model requests before handing the GPU over, so two engines on one card do not thrash.

Engines as nodes

The front proxy is torch-free: it supervises engine subprocesses and forwards /v1/* to them over localhost HTTP. Each engine reports its state — resident models, VRAM, in-flight tasks, thermal state — and the front aggregates that into the engines and Tasks pages.

vLLM appears there as a first-class node next to nvidia and radeon, with the same health, task and VRAM reporting. When RunPod is enabled it gets its own box too, so remote work is visible in the same place as local work.

Further reading

The repository carries a per-engine guide under docs/: deepseek-ds4.md, glm-colibri.md, kimi-k3.md, ktransformers.md, vllm.md, runpod.md and frontend-engine-split.md.