Applies to Orch Engine v0.2.6 · Changelog

Deploy a model with bairav model deploy

One command, three targets. Pick the one that matches what you have on your machine.

bairav model deploy <hf-repo>                    # → docker compose (default)
bairav model deploy <hf-repo> --target k8s       # → active kubeconfig context
bairav model serve <hf-repo>                     # → bare process on this host

Docker and Kubernetes run the same serving image, ghcr.io/bairav-foundation/serving, at the version of your CLI. The bare-process target runs llama-server directly. All three expose an OpenAI-compatible endpoint and keep downloaded GGUFs in ~/.bairav/models/, so later runs skip the download.

This guide uses Qwen/Qwen2.5-0.5B-Instruct-GGUF, a 400 MB model that runs on any laptop.

Step 0: install the CLI

macOS or Linux, with Docker running:

curl -fsSL https://bairavs.com/install.sh | sh
bairav version

The script downloads the release for your OS and CPU from GitHub, checks its SHA-256 against the release’s checksums.txt, and installs bairav. To check it yourself first, see Install. Building from source is covered in CONTRIBUTING.md.

Not sure which model? bairav model discover

New open-weight models land every week, and most never reach the news. discover shows a curated catalog grouped by what each model is good at, with the ones bairav can run today first:

bairav model discover                    # every group
bairav model discover --for coding       # laptop | general | capable | coding | reasoning | indic | vision | embedding
bairav model discover --json             # for scripts

Sample output (your list and times will differ):

Open-weight models worth running, updated 3h ago

RUNS ON A LAPTOP  ·  Up to 4B parameters: about 3 GB of RAM at 4-bit. Start here.
  Qwen/Qwen2.5-0.5B-Instruct-GGUF ★   -               -           ✓ Qwen/Qwen2.5-0.5B-Instruct-GGUF
    The quickstart model. About 400 MB, runs anywhere.
  ...
INDIAN LANGUAGES  ·  Models trained for Hindi, Tamil, Telugu and other Indian languages.
  ...

The catalog is rebuilt every 12 hours from Hugging Face (first-party releases only: fine-tunes, re-uploads and “uncensored” variants are filtered out) plus an editorial list, catalog/curated.yaml, where we pin models worth knowing (★) and block bad ones. The CLI caches it for 12 hours in ~/.bairav/catalog.json, uses the cached copy when it can’t refresh, and falls back to the live ranking when there’s nothing cached. Set BAIRAV_CATALOG_URL to use a mirror.

For the live Hugging Face ranking instead:

bairav model discover --live                   # trending text models
bairav model discover --live --sort new        # newest first
bairav model discover --task embedding         # text | vision | embedding | image | speech
bairav model discover --all                    # raw HF ranking, unfiltered

How to read the columns:

  • SIZE is the parameter count. The ~Q4 figure is roughly the 4-bit download, which is also about the RAM the model needs.
  • The ✓ repo is the most-downloaded GGUF build bairav can pull. The model’s own org wins first, then well-known quantizers.
  • “no GGUF yet” means only safetensors weights exist so far. Community GGUF builds usually follow within days.

Will it fit my GPU? --memory and bairav model fit

No need to do the math. Add --memory to discover and every model gets a FIT column for your machine:

bairav model discover --memory auto       # this machine: NVIDIA GPU, Apple Silicon or CPU
bairav model discover --memory 24GB       # another machine, e.g. an RTX 4090
bairav model discover --memory cluster    # the biggest GPU node in your Kubernetes context

Sample output (your models and numbers will differ):

Sizing for: Apple M3 Pro (36 GB unified), about 24 GB usable by a model (macOS keeps the rest), context 8192 tokens

GENERAL CHAT  ·  ...
  Qwen/Qwen3-8B      8.2B (~4.6 GiB Q4)   apache-2.0  ✓ Qwen/Qwen3-8B-GGUF      ✓ Q8_0 · 9.6 GB
  Qwen/Qwen3-32B     32.8B (~18 GiB Q4)   apache-2.0  ✓ Qwen/Qwen3-32B-GGUF     ~ Q4_K_M tight · 22 GB
  meta/Llama-3.3-70B 70.6B (~39 GiB Q4)   llama3.3    ✓ ...                     ✗ needs 43 GB+

Biggest that fits: Qwen/Qwen3-8B. Pick the file:  bairav model fit Qwen/Qwen3-8B-GGUF --memory auto

Then bairav model fit lists every file in a repo with what it needs, and picks the best one that fits:

bairav model fit Qwen/Qwen3-8B-GGUF
  FILE                QUANT   FILE SIZE  NEEDS   FIT
  Qwen3-8B-BF16.gguf  BF16    15 GB      17 GB   ✓ fits
  Qwen3-8B-Q8_0.gguf  Q8_0    8.1 GB     9.6 GB  ✓ fits
  Qwen3-8B-Q4_K_M.gguf Q4_K_M 4.7 GB     6.2 GB  ✓ fits

Best you can deploy from this repo: Qwen3-8B-Q8_0.gguf (Q8_0, near-full quality, needs about 9.6 GB)
  bairav model deploy Qwen/Qwen3-8B-GGUF --file Qwen3-8B-Q8_0.gguf

How it works, so you can trust it:

  • NEEDS = the model file + the KV cache for the context window (--ctx, default 8192 tokens) + about 0.6 GB for the runtime. Longer contexts need more.
  • Usable memory: an NVIDIA GPU’s memory minus 0.5 GB for the driver; on Apple Silicon about two thirds of unified memory (three quarters from 64 GB), which is what macOS lets the GPU use; on CPU three quarters of RAM.
  • ✓ fits leaves at least 10% spare, ~ tight fits with less (another app or a longer prompt can tip it over), ✗ doesn’t fit.
  • Which quant: the best quality that fits, up to Q8_0. F16/BF16 double the memory for a difference most people can’t measure. Below Q4_K_M quality drops noticeably, so those are only suggested when nothing better fits.
  • For several GPUs it sizes for one GPU (the smallest), since that’s how a model runs by default.
  • Split files: some repos (the official Qwen ones, for example) split the bigger versions into parts (-00001-of-00002.gguf). bairav serves single files today, so fit lists those as “can’t serve yet” and, when one would suit your machine better, points you to repos of the same model as single files.

These are estimates with headroom, not guarantees. --memory cluster reads NVIDIA GPU Feature Discovery labels (nvidia.com/gpu.memory) and otherwise the node’s allocatable memory.

What’s running? bairav model status

bairav model list is the download cache. status shows deployments on every target (local, docker and k8s): the model each one really serves, any upgrade in flight, and AGE.

NAME           TARGET  NAMESPACE  SERVING                          PHASE  UPGRADE                    AGE
qwen           docker  -          Qwen/Qwen2.5-0.5B-Instruct-GGUF  Ready  -                          3h
support-model  k8s     team-a     Qwen/Qwen2.5-1.5B-Instruct-GGUF  Ready  from Qwen2.5-0.5B-… 12m ago  2d

bairav model status support-model shows the details for one deployment:

  • serving vs wanted model
  • previous model and the exact rollback command
  • strategy, endpoint and conditions

To swap models safely, see Swap a model with bairav model upgrade.


Path 1: Docker Compose (the default, no cluster)

Ports are published on 127.0.0.1 only, so your model isn’t reachable from the network you’re on. Set BAIRAV_PUBLISH_ADDR=0.0.0.0 before deploying if you do want LAN access.

Best when you have Docker Desktop / Colima and don’t want to bring up Kubernetes.

Prerequisites: docker (with the v2 compose plugin — comes with Docker Desktop).

bairav model deploy Qwen/Qwen2.5-0.5B-Instruct-GGUF
bairav ps

Sample output:

Target:    docker (compose)
Name:      qwen2-5-0-5b-instruct-gguf
Repo:      Qwen/Qwen2.5-0.5B-Instruct-GGUF
Endpoint:  http://127.0.0.1:8080/v1
StackDir:  ~/.bairav/compose/qwen2-5-0-5b-instruct-gguf
…
✓ Stack up. First boot pulls the GGUF inside the container — give it a minute.

The compose file lands at ~/.bairav/compose/<name>/docker-compose.yaml. The container bind-mounts ~/.bairav/models/ to /models, so once the GGUF is pulled it persists across down → up.

Talk to it:

bairav chat --endpoint http://127.0.0.1:8080/v1
# or curl directly
curl http://127.0.0.1:8080/v1/models

Tear it down:

bairav model undeploy qwen2-5-0-5b-instruct-gguf

Path 2: Kubernetes (k3d on the laptop, or any real cluster)

Best when you want the operator and the Model resource, or to see what a real cluster will run.

Prerequisites: kubectl pointed at a cluster. For a local one, Docker plus k3d: k3d cluster create bairavs.

Install the operator and CRDs once, then deploy:

kubectl apply -f https://github.com/bairav-foundation/orch-engine/releases/latest/download/install.yaml
kubectl -n bairav-system rollout status deploy/bairav-operator
bairav model deploy Qwen/Qwen2.5-0.5B-Instruct-GGUF --target k8s
bairav ps

Sample ps output:

KUBERNETES  (context: k3d-bairavs)
  NAMESPACE  NAME                        REPO                             PHASE    ENDPOINT
  default    qwen2-5-0-5b-instruct-gguf  Qwen/Qwen2.5-0.5B-Instruct-GGUF  Loading  http://qwen2-5-0-5b-instruct-gguf.default.svc.cluster.local:8080/v1

The phase moves Pending → Pulling → Loading → Ready as the operator reconciles the pod. --wait (default true) polls until Ready; pass --wait=false to return immediately.

Talk to it from inside the cluster (the in-cluster DNS name above), or kubectl port-forward to reach it from the laptop:

kubectl port-forward svc/qwen2-5-0-5b-instruct-gguf 8080:8080
bairav chat --endpoint http://127.0.0.1:8080/v1

Tear it down:

bairav model undeploy qwen2-5-0-5b-instruct-gguf --target k8s
# or delete the local cluster entirely:
k3d cluster delete bairavs

Pinned by default

bairav model deploy (and model upgrade) resolve the revision to the exact commit and record the file’s SHA-256:

Pinned:    Qwen/Qwen2.5-0.5B-Instruct-GGUF @ 9217f5db79a2, qwen2.5-0.5b-instruct-q4_k_m.gguf sha256 74a4da8c9fdbcd15…

The serving container checks the file on every start: a changed or tampered cache is downloaded again, and a download that doesn’t match is refused, so the model can’t change under you. Run deploy again to move to a newer version on purpose. --revision <branch|tag|commit> picks the version; --no-pin follows the branch with no check.

Path 3: Bare process (bairav model serve)

No container and no cluster: the CLI starts llama-server directly. Useful on machines without Docker, or when you want to tune llama-server flags by hand.

Prerequisites: llama-server on your PATH (we don’t bundle it for this path — the container image is what handles the install for the other two).

bairav model pull Qwen/Qwen2.5-0.5B-Instruct-GGUF
bairav model serve Qwen/Qwen2.5-0.5B-Instruct-GGUF
bairav ps         # LOCAL section shows it
bairav chat       # auto-detects the running endpoint

State lives at ~/.bairav/run/port-<N>.json; ps prunes stale entries on every invocation.


Which target should I use?

Situation Target
“I just want to talk to an LLM on my laptop” docker (default)
“I want the Kubernetes resources, grants and dashboard” k8s
“I have no Docker, or I want to tune llama-server myself” serve (bare process)
“I’m going to ship this to a real cluster” k8s (same code path as production)

The docker and k8s targets run the same serving image with the same BAIRAV_REPO / BAIRAV_PORT / BAIRAV_FILE / BAIRAV_CTX_SIZE env contract. A model that works on docker will work on k8s and vice versa.


Cross-references