Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

About this guide

What Glyd does

Glyd compresses an LLM and runs it. It packs the weights and the KV cache losslessly and decodes them inside the GPU kernels, so a model that does not fit your GPU in bf16 often fits and answers exactly as before. When lossless is not enough there are lossy levels, experts kept in RAM, and more GPUs. It is one program written in Rust, from the compressed file to the tokens, with an OpenAI and Anthropic compatible server and a chat page.

Features

  • Lossless weights and KV cache, bit for bit, decoded in the kernels.
  • Four lossy levels (kestrel, swift, wren, hummingbird) for when a model still does not fit.
  • Mixture-of-experts models with their experts in RAM or on the SSD.
  • One model across the GPUs of a machine, and across machines with Starlings (beta).
  • A server for the OpenAI and Anthropic APIs, with tools and constrained JSON, and a chat page.
  • fit: the plan for your GPU before anything is downloaded.

How it works

  1. You name a model: gemma4:12b, google/gemma-4-12B-it, or a path.
  2. fit reads the model's config and plans a level, where the weights go and how much context fits.
  3. On the first run Glyd downloads the model, packs it for your GPU and builds the KV tables.
  4. The kernels read the packed weights and decode them as they compute. Nothing is unpacked into memory first.
  5. run gives a chat in the terminal and at http://localhost:8000. serve gives the same server for programs.

The design is in docs/architecture.md.

How to use it

Install, then first run: a few commands. Choosing a level when the model does not fit. Serving and connecting tools to use it from other programs.

What runs today

  • NVIDIA Ampere or newer (RTX 30 series and up, A10, A100, L4, L40S, H100), Linux x86_64, driver 580 or newer.
  • The families are on the Models page, generated from the code.
  • A 180B mixture of experts on one 12-16 GB GPU: Condor.

Not yet: Windows, macOS, aarch64 and CPU-only engines. AMD is a development build.

Pages

  1. Install
  2. First run
  3. Choosing a level
  4. Serving and the APIs
  5. Connecting tools
  6. Several GPUs and Starlings
  7. Condor
  8. Troubleshooting, by what glyd doctor prints
  9. API reference and the background service, generated from docs/serve-api.md and docs/service.md
  10. Models, generated from glyd-engine/src/support.rs
  11. The model catalog
  12. Checking a machine: the M1 gate, step by step

The command is glyd

Since v0.33.0 glyd is one program with the engine linked in: run, serve, pull, ls, rm, service, ps, stop, fit, doctor, login, connect, supports, preflight and the rest. glyd-engine is a link to it that keeps the engine's older command line. File compression is the same program: glyd FILE -o FILE.glyd.

Benchmarks

This guide has no benchmark tables. Every measurement, with its machine, build and log, is in benchmarks/.

Versions

This guide at /guide/ follows main. Each release tag that has the guide also gets its own copy at /guide/vX.Y.Z/, built from that tag's text.

Supporting Glyd

Glyd is open source under Apache-2.0. GitHub Sponsors pays for the GPUs it is measured and tested on.

Install

What each machine gets today

MachineWhat you get
Linux x86_64, NVIDIA Ampere or newer, driver 535 or newer (570 for Blackwell; 580 for a build with CUDA 13 kernels alone)The engine: run, serve, fit, doctor.
Linux x86_64, NVIDIA older than Ampere (Turing and before)Refused: "older than the engine runs on".
Linux aarch64 (Grace, Jetson, DGX Spark)Refused: the engine has not run on an aarch64 computer. File compression only.
macOS, Apple GPURefused: Apple GPUs are not supported yet. File compression only.
Windows x86_64, NVIDIA Ampere or newer, driver 535 or newerFrom v0.34.0 a zip with glyd.exe (the engine linked in) and the GPU libraries, and install.ps1 (below). The release workflow builds it and installs it on a runner with no GPU; a first chat on a Windows GPU is still to be shown (#159). Condor has PowerShell scripts for its own model.
AMD (RDNA 3 and 4)A development build: GLYD_HIP=1 cargo build --release -p glyd --features engine. Not in releases.
No GPURefused: "no GPU was found: the engine's CPU backend is not built yet".

The refusals are what glyd run prints (exit 3). glyd doctor says what the machine has.

The release script

curl -LsSf https://getglyd.com/install.sh | sh

On Linux x86_64 with an NVIDIA GPU, the v0.33.0 script installs glyd with the engine and its GPU library in one folder (about 100 MB, no Python, no PyTorch), checks each download against the release's sha256, and ends with glyd doctor. It also sets up the background service as a user unit of your account (see Serving); GLYD_NO_SERVICE=1 in front of sh leaves that out. GLYD_WITH_VLLM=1 adds the Python tool with vLLM and PyTorch (about 8 GB), for the bf16 models the engine does not run.

On a Mac, or a machine with no NVIDIA GPU, it installs the file compression program only.

The copy of the script at getglyd.com is replaced with the v0.33.0 one when the site is next published from this repository. Until then it installs v0.32.1, which goes through vLLM. To install v0.33.0 now, take the script from its tag:

curl -LsSf https://raw.githubusercontent.com/surya-koritala/Glyd/v0.33.0/scripts/install.sh | sh

The release has the engine bundles glyd-engine-v0.33.0-linux-x86_64.tar.gz and its .sha256 (releases).

Windows

irm https://getglyd.com/install.ps1 | iex

The script downloads the release's glyd-engine-vX.Y.Z-windows-x86_64.zip, checks it against the .sha256 beside it, puts glyd.exe and the GPU libraries (CUDA 13 and CUDA 12; the engine loads the one the driver's version asks for) in %LOCALAPPDATA%\Glyd, adds that folder to your user PATH, and runs glyd doctor. No administrator rights. $env:GLYD_RELEASE_URL (a mirror or a folder), $env:GLYD_VERSION, $env:GLYD_HOME and $env:GLYD_NO_PATH = '1' change where it reads from and writes to.

Unsigned downloads

The Windows and macOS programs of a release are not code-signed or notarized: the certificates are the owner's to get (#223). Expect these warnings, which do not mean the file is bad:

  • Windows SmartScreen, "Windows protected your PC", for glyd.exe or the installer: More info, then Run anyway.
  • macOS Gatekeeper, "cannot be opened because the developer cannot be verified", for the glyd program of the tarball: xattr -d com.apple.quarantine glyd, or allow it in System Settings, Privacy & Security. (Homebrew's glyd is not quarantined.)

Check the file instead of trusting a warning: every release file is attested and signed by the workflow that built it, with no key of ours (gh attestation verify, or cosign with the .sigstore.json beside the file). Verifying a release has the commands.

Build from source

Linux x86_64, git, the Rust toolchain (the repository pins 1.97.1 and rustup fetches it), and for the GPU kernels the CUDA toolkit with nvcc (12.8 or newer).

git clone https://github.com/surya-koritala/Glyd && cd Glyd
cargo build --release -p glyd --features engine
bash gpu/build_lib.sh target/release
target/release/glyd doctor

Or let cargo build and install the one program, the engine linked in (glyd-engine is glyd under another name: make it a link if a tool asks for it):

cargo install --git https://github.com/surya-koritala/Glyd glyd --features engine --locked
ln -s glyd "$(dirname "$(command -v glyd)")/glyd-engine"    # optional
glyd --version                                       # says `engine: linked`

Without --features engine the install is the file compression program alone.

  • -p glyd --features engine builds glyd with the engine linked in: run, serve, pull, ls, fit, doctor and the rest are its own commands. cargo build --release -p glyd-engine builds the engine's own program, glyd-engine, which has the older command line without pull, ls, rm and the service.
  • The build finds nvcc on the PATH, or at $NVCC. Without one it builds without CUDA kernels and warns. The kernels are built for Ampere, Ada and Hopper (GLYD_ENGINE_ARCHS="80 86 89 90a" is the default); GLYD_ENGINE_ARCHS="89" builds for one architecture, which is quicker.
  • gpu/build_lib.sh DIR writes the GPU library, libglyd_gpu_cuda13.so, into DIR. The engine looks for it beside its own program, then in the loader's path; GLYD_GPU_LIB=/path/to/it names it.
  • The engine needs the NVIDIA driver only. It does not link the CUDA runtime.

The rest of the guide writes glyd. With a source build, run it as target/release/glyd.

First run

A few commands (with a source build, target/release/glyd):

glyd doctor                       # what this computer has: GPU, driver, library, disk, Hub
glyd fit gemma4:12b               # the plan for this GPU, before anything is downloaded
glyd run gemma4:12b               # download, pack, then a chat in the terminal and at http://localhost:8000

Names

A model is a Hub id (google/gemma-4-12B-it), a directory, a GGUF file, or a short name: NAME[:SIZE][:LEVEL], for example gemma4, qwen3.8:27b, gemma4:12b:wren. A tag of letters only is a level, so :27b is a size. Without a size, glyd run, serve, fit and pull pick the largest size of the family whose plan on this computer reaches 10 tokens a second and 8,192 tokens of context (the plan glyd fit shows, with the level it takes), and say so in one line: glyd: gemma4 is gemma4:12b (google/gemma-4-12B-it) at kestrel: the largest size that gets 10 tokens/s and 8192 tokens of context on ..., about 38 tokens/s, 32768 context; the others: 31b: 4 tokens/s, 8192 context. To choose another: gemma4:SIZE[:LEVEL]. gemma4:31b (a size, and :wren for its level) is taken as it is; a level alone (gemma4:wren) is asked of every size. Where no size reaches the floors the fastest that fits is taken and the line says so; where none fits, the refusal says why for each. glyd fit gemma4 --machine rtx4090 shows the choice for another machine. glyd ls --all lists the names and what each is:

glyd ls --all        # name, level, size on disk, repo; "not pulled" for a name not downloaded
glyd pull gemma4:12b # download a model by name or Hub id
glyd rm gemma4:12b   # take it out of the cache

Short names offer models released in the last six months. An older model still works by its Hub id.

doctor

doctor prints one line for each thing the engine needs and ends with "Everything glyd run needs is here." (exit 0) or "N thing(s) to fix." (exit 1). Troubleshooting goes through each line.

fit

fit reads the model's config.json from the Hub and prints the plan: the level, where the weights go, the context, and a predicted speed. With --machine rtx4090, the preset for an RTX 4090 with 23 GiB free:

Plan: penguin (10.8 bits) · GPU 0 (NVIDIA GeForce RTX 4090) · 32768 tokens of context · ~43 tokens/s
  penguin       14.9 GiB    32768 ctx  ~  43 tok/s  GPU 0 (NVIDIA GeForce RTX 4090)  <- chosen
  kestrel        9.0 GiB    32768 ctx  ~  80 tok/s  GPU 0 (NVIDIA GeForce RTX 4090)
  swift          7.6 GiB    32768 ctx  ~  94 tok/s  GPU 0 (NVIDIA GeForce RTX 4090)
  wren           6.2 GiB    32768 ctx  ~ 114 tok/s  GPU 0 (NVIDIA GeForce RTX 4090)

It lists every level the model runs at with its size on your GPU, and marks the one it chose. The speeds are estimates from memory bandwidth, for a short prompt and one user. --machine NAME plans for another computer (rtx4060-laptop, rtx4080s, rtx4090, 2x3090, l4, a6000, a100-80g, h100, 8xh100, rx7900xtx, m4max-64g, dgx-spark, strix-halo-128g), so you can see the plan before you buy or rent. --context N and --users N change what it plans for. glyd preflight MODEL says whether the engine will certainly run the model here (exit 0 yes, 3 no with the reason).

When a model does not load at the level asked for, fit prints the degrade ladder: a shorter context, experts in the computer's memory, the last layers' dense matrices there too, then a lower level, each with its cost in speed. run says the same steps in its first lines and asks before one that costs over 30% of the speed or lowers the level (--yes, or GLYD_DEGRADE=yes, takes them; GLYD_DEGRADE=no refuses); serve and the service never stop to ask and refuse without --yes.

fit reads the model's file headers by range requests (two small reads a shard, kept in the cache), so a model's sizes are exact before anything is downloaded; nothing of the weights is fetched to plan. The plan is what loads. For Qwen3 dense, Qwen3.5/3.6/3.8, Nemotron 3 Super, Gemma 4 and (once its files are here) the models that run over several GPUs, fit sizes the model with the functions run and serve do, from the same GPU's free memory: the weights, the cache for the context and the users, the engine's work, and a small reserve the GPU keeps. Where run would refuse, fit refuses in the same words and exits 3. run prints its plan before it loads (Plan: ...). fit --json prints the plan as glyd-plan/1 for scripts: level, context, users, the bytes of each part, and experts (places a layer on the GPU, bytes in the computer's memory and on the disk) where a mixture of experts keeps them off the GPU.

The one size fit estimates is the lossless level's (penguin), which depends on how well the weights compress: 10.75 bits a weight (12.04 on A100, H100 and B200). Measured on an RTX 4080 SUPER, Qwen3-8B loaded 0.2% above that and Qwen3-0.6B 2.3% below it. After a model's first load, fit and run plan the GPU's memory with what that load took beyond its plan (up to 1 GiB).

run

The first run downloads the model into the Hugging Face cache, packs it for this GPU and makes the KV tables. Later runs start from the packed copy.

  • --prompt "TEXT" gives one answer and exits. --no-think turns a thinking model's thinking off.
  • MODEL:LEVEL picks a level: Choosing a level. --context N sets the context.
  • The chat page is at http://localhost:8000 while it runs: the same server as serve.
  • A gated model needs a Hugging Face token: glyd login, or HF_TOKEN in the environment.
  • The packed models are in $GLYD_CACHE (default ~/.cache/glyd), the downloads in the Hub cache ($HF_HOME, default ~/.cache/huggingface). Set either to put them on another drive.

Choosing a level

A level is how a model's weights are stored on the GPU. You pick one with a tag: glyd run Qwen/Qwen3.8-27B:swift. With no tag, run uses penguin, and refuses a model that has none. fit lists every level and picks the first that fits: lossless if it fits, then the highest lossy level that does, then experts in RAM for a mixture of experts. --lossy is the same as :kestrel.

LevelBits a weightLosslessWhat it is
penguinabout 10.8yesThe release's weights, bit for bit, packed smaller than bf16.
kestrel6.5noThe closest lossy level.
swift5.5noSmaller again.
wren4.5noThe smallest dense level. Exact on a quantization-aware checkpoint (Google's -qat- releases).
hummingbird2 to 4 on the expertsnoA mixture of experts' experts at 2 to 4 bits by use. Pre-packed.

Which families run at which level is on the Models page. A level a family does not run is refused.

How to choose

  1. Run glyd fit MODEL. It lists every level with its size on your GPU and says which fit.
  2. Take penguin if it fits. Nothing changes.
  3. If not, take the highest level that fits. Each step down changes more of the model's answers than the one above it.
  4. For code and long tool loops, stay at kestrel or above where you can.

What each costs

fit shows the memory for your GPU (First run has an example). Quality is measured as the KL divergence of the model's next-token distribution from bf16's, and how often its top token is bf16's. The records, each with its machine, build and log, are in benchmarks/: start with benchmarks/weights/kld-q56-2026-10-09 for the dense levels and benchmarks/cards for the cards.

Serving and the APIs

glyd serve google/gemma-4-12B-it

serve loads the model and answers on http://127.0.0.1:8000. The chat page is at /. run starts the same server.

After the release script, a background service is also running on 127.0.0.1:11434. It loads a model when a request names it and unloads it when idle, and holds two at a time by default:

glyd pull gemma4:12b
curl localhost:11434/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"gemma4:12b","messages":[{"role":"user","content":"hi"}]}'
glyd ps                  # what is loaded, and when it is unloaded
glyd stop gemma4:12b     # unload it now (glyd stop --all)
glyd service install     # run it at every login; glyd service runs it in this terminal

The service loads only models already pulled, and glyd run chats through it where it runs. Its options (--keep-alive, --max-loaded, --port) and what it leaves open are in the service page.

Options

FlagWhat
--port NThe port. Without it, 8000, then each next port up to 8020 that is free. With it, that port or a refusal.
--host HListen on H. Without it, only this computer, and a request whose Host or Origin is not this computer's is refused (421, 403). With it, those checks are off.
--context NThe context in tokens (--ctx is the same). Without it, what fits: Models has each family's default.
--users NHow many requests run at once, 4 by default: 1 to 8 on the lossless Qwen3 engine; up to 64 for Gemma 4, Qwen3.8 dense, Nemotron-H, DeepSeek-V4, Muse Spark, Kimi-K3 and GLM-5.3-Flash on one GPU, as many as its memory holds. Other engines take one request at a time and the rest wait in order.
--with MODEL2A second model served by the same process on the same GPU, on --with-port N (else the next free port after the first's). Each has its own server; the first loads and takes up to half of the memory left for its sequences, then the second loads in the rest.
--host-memory GIBThe computer's memory a mixture of experts may use for its experts.
MODEL:LEVELA level: Choosing a level.

The key

GLYD_API_KEY=secret glyd serve google/gemma-4-12B-it

With a key, every path under /v1 needs Authorization: Bearer secret. /, /health and /stats stay open. Put the key in the environment: a --api-key flag shows in ps. With --host set to an address other than this computer's, anyone who can reach it can use the model, and the traffic is plain HTTP: use a key and an SSH tunnel or a VPN.

What it answers

PathWhat
POST /v1/chat/completionsOpenAI chat, JSON or a stream. Tools, response_format (json_object, json_schema), tool_choice, and vLLM's guided_* fields.
POST /v1/completionsA plain completion; suffix makes it fill in the middle for a model that has the tokens.
POST /v1/responsesOpenAI's Responses API, stateless.
POST /v1/messages, /v1/messages/count_tokensAnthropic's Messages API, for the Anthropic SDKs and Claude Code: thinking blocks, tools, streaming.
/api/chat, /api/generate, /api/tags, /api/show, /api/ps, /api/versionOllama's API, for programs that talk to Ollama. --ollama-port N listens on Ollama's port too, where it is free.
GET /v1/models, /v1/models/IDThe one model. id is the name you started it with.
GET /health{"status":"ok"}, no key needed.
GET /v1/glyd/infoWhat the server is and holds: model, level, precision, device, limits, memory.
GET /statsThe scheduler's counts (lossless engine).

A first request with curl:

curl -s http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"Say pong."}],"max_tokens":64}'

A thinking model thinks before it answers. To turn that off for a request, send "chat_template_kwargs": {"enable_thinking": false}; run takes --no-think.

Errors are OpenAI's shape: {"error": {"message", "type", "param", "code"}}. A prompt past the context is 400 with the code context_length_exceeded; a wrong key is 401 invalid_api_key.

The full reference

Every field the server reads, refuses or ignores, the states from loading to failed, the exit codes and the status file are in the API reference (the contract, glyd-serve/1). The background service is in its own page.

Connecting tools

glyd connect [TOOL] finds the server that runs here (ports 8000 to 8020, then Ollama's 11434, or --port N) and prints what each tool needs, with the real port and model. It changes nothing and never prints a key. Start a server first (glyd serve MODEL).

ToolWhat it is givenglyd connect
OpenAI SDKs, LangChain ChatOpenAI, aiderOPENAI_BASE_URL=http://127.0.0.1:8000/v1, OPENAI_API_KEY (any, or the server's key)openai
Claude Code, Anthropic SDKsANTHROPIC_BASE_URL=http://127.0.0.1:8000, ANTHROPIC_API_KEYanthropic
ollama libraries, LangChain ChatOllamaOLLAMA_HOST=http://127.0.0.1:8000 (--ollama-port 11434 for programs that look at Ollama's port)ollama
Open WebUI (container)its Ollama and OpenAI connections set to the serveropen-webui
Continue~/.continue/config.yaml: a chat model through the OpenAI APIcontinue

The model name can be anything: the server answers with the one it runs. GET /v1/models shows it. Without a key set, any key works; with GLYD_API_KEY set on the server, use that key.

An agent that sends many tool definitions needs more context than the default (the Models page has each family's): start the server with --context N.

Containers

A container on Linux reaches a server on this computer only from the host's network (docker run --network=host ...). Docker Desktop and Podman reach it as host.docker.internal and host.containers.internal, and the server's Host check answers those two names and no others. A server started with --host 0.0.0.0 has the Host and Origin checks off: give it a key. glyd connect open-webui prints the whole docker run line.

What is checked

The clients are checked in tests/clients/: run.sh URL [KEY] runs the OpenAI, Anthropic, Ollama, LangChain and Open Responses checks, each with the newest release of its library, against a running server, and openwebui_check.py checks an Open WebUI container. Claude Code and Open WebUI were run against the server; the API reference, Connecting tools, says on what. Continue's settings are printed by glyd connect; a session with Continue is not recorded.

If you try another tool, say how it went in an issue.

Python

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="none")
model = client.models.list().data[0].id
r = client.chat.completions.create(model=model, messages=[{"role": "user", "content": "Hi"}], max_tokens=64)
print(r.choices[0].message.content)

Several GPUs and Starlings

Two things share the name "more than one GPU": the engine across the GPUs of one machine, and Starlings, which puts one model across machines.

The engine, one machine

glyd run and serve use the GPU with the most free memory. A model too big for it (Kimi-K3, GLM-5.3-Flash, DeepSeek-V4, Muse Spark) is split over all the GPUs the process can see, by their free memory.

CUDA_VISIBLE_DEVICES=0,1 glyd serve MODEL                 # the GPUs to choose from
glyd serve MODEL --split CUTS --devices GPUS              # your own split, see below
  • Which families split, and at which levels, is the Models table, column "Weights split over GPUs".
  • --split CUTS --devices GPUS is the layer cuts and the GPUs they go to. fit MODEL shows the placement the planner would choose. If the GPUs do not hold the model, run says how much it needs and stops (exit 3).
  • With layers split, one GPU works at a time. On datacenter GPUs that reach each other directly (A100, H100, B200), Kimi-K3 and DeepSeek-V4 put every layer across all of them, so every GPU works on every token. The start checks two gathers of known values and refuses where the GPUs' writes to each other arrive wrong.
  • To see a split before you rent the machines: glyd fit zai-org/GLM-5.3-Flash --machine 8xh100 plans GLM-5.3-Flash at penguin over the eight GPUs of the preset. Measurements of the split are in research/tp-8xa100-2026-10-22.

Starlings, one model across machines

Starlings is a beta. One model across two GPUs in one machine, or two machines on one LAN, NVIDIA on Linux, Qwen3.5, 3.6 and 3.8 models. Each GPU holds a contiguous range of layers and the output is the same tokens the whole model gives on one card.

Build it (from the repository root; the binary is target/release/starlings):

cargo build --release -p starlings-cli

Run it, from the beta guide:

starlings up --model glyd/Qwen3.8-27B-swift                 # one machine, its GPUs
starlings up --model glyd/Qwen3.8-27B-swift --machines 2    # first machine: prints a join code
starlings join --model glyd/Qwen3.8-27B-swift               # second machine: enter the code, approve on the first
  • It opens a web UI and an OpenAI-style /v1/chat/completions on loopback (port 9750).
  • Two machines need one LAN with private addresses and TCP ports 9741 and 9761-9762 open from the second to the first, 9770-9772 the other way. Each GPU needs about half the model free (the 27B: about 10 GB) plus 1 GiB.
  • Measurements are in starlings/benchmarks.
  • One GPU for both halves works and is slower than the whole model: it proves the setup.

Starlings becomes glyd cluster in M4 (ROADMAP). It is not part of the engine's serve yet.

Condor: a big MoE on one GPU

Condor runs Qwen3.8-Flash-Next, a 180B mixture of experts, on one 12-16 GB NVIDIA GPU with 32-64 GB of RAM. It has its own setup script, its own server and chat page. glyd run does not take this model yet: it refuses it and points here (ROADMAP P8 moves it into run).

What you need

  • NVIDIA RTX 30, 40 or 50 series (or an Ampere workstation card), 12 GB or more, driver 580 or newer.
  • 32 GB of RAM or more: 64 GB for the precise and best modes, 32 GB for fast.
  • About 90 GB of free SSD (73 GB for fast, 97 for best).
  • Linux x86_64 or Windows 10/11 x64.

Install and run

git clone https://github.com/surya-koritala/Glyd && cd Glyd/condor
./setup.sh

It checks the GPU, RAM and disk, installs the engine, downloads the model (rerun it if it stops), asks the mode and the context, and opens http://127.0.0.1:8080. Run ./setup.sh again to start next time. On Windows, in PowerShell:

git clone https://github.com/surya-koritala/Glyd; cd Glyd\condor
powershell -ExecutionPolicy Bypass -File setup.ps1

Modes

ModeDownloadRAMFor
precise (default)82 GB64 GBCode: long programs come out right more often.
best90 GB64 GBThe closest to the original.
fast66 GB32 GBQuicker, and the mode for 32 GB of RAM. Weaker on long code.

Switch with tools/download.sh --best (or --fast), then tools/serve.sh --best. The speed and quality of each mode, with the machine and logs, are in condor/README.md and condor/results. The CPU matters nearly as much as the GPU, because the experts that miss the GPU's cache run on it.

Using it

  • Chat: http://127.0.0.1:8080. OpenAI API at http://127.0.0.1:8080/v1 (any key, any model name), Anthropic API at /v1/messages.
  • Context up to 262,144 tokens; the default is 32,768 (GLYD_CTX=65536 tools/serve.sh for more).
  • Two NVIDIA cards: GLYD_GPUS=0,1 tools/serve.sh.
  • 4 requests at once by default (GLYD_USERS=N, 1 to 8).

More: condor/README.md, condor/docs/CLIENTS.md for what is tested with tools.

Troubleshooting

Start with glyd doctor. It prints one line for each thing a run needs and ends with "Everything glyd run needs is here." (exit 0) or "N thing(s) to fix." (exit 1). Fix the lines it names, in order.

For a bug report, run glyd doctor --json (the bundle on the screen) or glyd doctor --bundle (the same in a file, glyd-bundle-TIME.json, or --bundle FILE) and attach it. It holds the versions, every check with its fix, each GPU's memory and the terms a plan is made of (what the engine keeps free, its work, the computer's memory kept for the system), each backend detected or rejected and why, the plan run would load for Gemma 4 12B here, the ports, the models in the caches, the GLYD_* and HF_* environment, the service's configuration and the end of its recent logs. Tokens, keys, credentials in addresses and your home folder are taken out of it (~); --no-logs leaves the logs out. Read it before you post it.

Exit codes

CodeMeaning
0Done. For supports and preflight: the engine runs it.
1Something went wrong, or a wrong flag, or the Hub did not answer. The message says what and what to do.
3The engine cannot run this model on this computer: the model's kind, the GPU, the driver, or not enough memory. The reason is on stderr. A program that started the engine can then run the model another way.

By doctor line

doctor saysCauseFix
GPU none usable: no CUDA driver ...No NVIDIA driver loaded, or no GPU visible to the process.Check nvidia-smi. Install the driver (580 or newer). In a container, give it the GPU (--gpus all). An empty CUDA_VISIBLE_DEVICES hides every GPU.
older than the engine runs on (Ampere or newer)Compute capability below 8.0: Turing, Pascal and before.Nothing on this card. RTX 30 series and later, A10, A100, L4, L40S and H100 run.
driver too old: the driver here runs CUDA 12.x ...The engine's kernels need CUDA 13 (driver 580 or newer).Update the driver. On Ubuntu: sudo apt install nvidia-driver-580 (or sudo ubuntu-drivers install) and reboot; elsewhere the installer at nvidia.com/drivers. A CUDA 12 build is ROADMAP P6.
GPU library not foundlibglyd_gpu_cuda13.so is not beside glyd-engine or on the loader's path.Build it: bash gpu/build_lib.sh target/release, or set GLYD_GPU_LIB=/path/to/libglyd_gpu_cuda13.so.
cuBLAS not foundNot an error. Long prompts use the engine's own products, a little slower.Optional: install the CUDA 13 cuBLAS, or set GLYD_CUBLAS to it.
cache, models: a low "free" figureThe packed copy and the downloads need disk: the download is the model's size on the Hub, and the packed copy is extra.Free space, or move them: GLYD_CACHE=/big/drive for packed models, HF_HOME=/big/drive for downloads.
Hub token noneFine for public models.For a gated model, accept its licence on the model's page, then glyd login (a token from huggingface.co/settings/tokens), or set HF_TOKEN.
backend ...Each backend (CUDA, ROCm, Metal, CPU) is said detected or not, with its version, and accepted or rejected with the refusal run would give.Only a rejected backend that is the one you need is a problem: its line has the fix.
GPU budget, RAMThe terms a plan is made of: free memory, what the engine keeps and its work, the computer's memory kept for the system.A small "for the weights and the cache" means little room: close programs that use the GPU.
sample plan ... does not load hereGemma 4 12B, a small model, has no level that loads on this GPU and memory.Not an error: a bigger model will not either. glyd fit MODEL shows each level.
port ... is in use by ...A program holds the service's port (11434) or a server's first port (8000).Stop it, or glyd service --port N; a server takes the next free port up to 8020.
Hub ...: <error>The Hub is not reachable: no network, a proxy, or IPv6 that fails.Check the network. GLYD_IPV4=1 forces IPv4. HF_ENDPOINT names a mirror. A model already downloaded runs with HF_HUB_OFFLINE=1.

Refusals from run and serve

These are exit 3 unless noted. The message says what to do; the usual ones:

Message startsWhat it meansWhat to do
X is a ...ForCausalLM model, and this engine runs Qwen3 models so farThe model's kind is not one of the Models families.Pick a listed family, or run it with another engine.
GLM-5.3-Flash (GLM-5.3-Flash) runs at the penguin level in this engine, not swiftThe family does not run that level.Use the level the message offers, or see Models.
it needs ... GiB of GPU memoryThe model does not fit at the level and context asked.A lower level, a smaller --context, another GPU, or for a mixture of experts more of the computer's memory (--host-memory). glyd fit MODEL shows each level's size first.
no GPU was found: the engine's CPU backend is not built yetNo usable GPU.See Install.
AMD GPUs run in development builds only (GLYD_HIP=1)AMD is a development build.GLYD_HIP=1 cargo build --release -p glyd-engine.
Apple GPUs are not supported yetmacOS.The engine needs an NVIDIA GPU on Linux.
glyd service says its port is in use, and names the programSomething else has the service's port. The service never moves to another port.Stop that program, or glyd service --port N; glyd ps, stop and run read --port N or GLYD_SERVICE_PORT=N.
port 8000 is in use by another program (exit 1)You gave --port and something else has it.Another port, --port 8001. Without --port the server takes the next free port up to 8020.
Gemma 4 ... not in this engine yetGemma 4's 26B-A4B and E models are refused.Gemma 4 12B or 31B.
the Hugging Face Hub would not show X (exit 1)The name is wrong, or the model is gated or private.Check the name (ORG/NAME). For a gated model, accept the licence and run glyd login.

Still stuck

Run glyd doctor and glyd preflight MODEL and put what they print in an issue with the model, the command and the GPU. For Condor, choose "Condor: something went wrong".

glyd serve: the HTTP API, glyd-serve/1

Notes for a program that starts glyd serve (or glyd-engine serve) on its own machine and sends it whole requests, as Glyd-Compute's service adapter does. glyd-serve/1 is what GET /v1/glyd/info says in api; a change that breaks a client of this page gets a new number. The numbers below are from one run on an RTX 4080 SUPER with Qwen3.5-9B at the swift level: benchmarks/gpu/rtx4080s-serve-probe-2026-10-19. The contract tests are in glyd-engine/src/server.rs and cli.rs (the #[test]s named below) and glyd-gpu-py/tests/test_onboard.py.

Start, ready, stop

glyd serve Qwen/Qwen3.5-9B:swift                         # the Python front end: hands a level to the engine
glyd-engine serve Qwen/Qwen3.5-9B:swift --ctx 4096       # the engine itself
HF_HUB_OFFLINE=1 GLYD_API_KEY=... glyd-engine serve /path/to/models--glyd--Qwen3.5-9B-swift/snapshots/073a2132... \
    --ctx 4096 --port 8238 --status-file /run/glyd.status  # offline: the directory alone is read
  • MODEL:level takes penguin (lossless), kestrel, swift, wren and hummingbird (Nemotron 3 Super). A tag that names no level is refused (exit 1). A level the engine does not run for the model, or a model that does not fit, is refused with the reason (exit 3, on stderr and in the status file). Nothing is changed for you: the model, the level and the precision are the ones asked for, or the start fails.
  • glyd serve of a level, a glyd-v7 directory or a glyd/ repo vLLM cannot read goes to the engine without GLYD_ENGINE=1. glyd serve of a lossless model is vLLM's unless GLYD_ENGINE=1, as before.
  • A Hub name with a level reads the base model's config.json (the cache, else the Hub) and loads glyd/NAME-LEVEL from the cache (else downloads it). Offline, give the snapshot directory: nothing else is read.
  • The address is 127.0.0.1:8000, or the next free port up to 8020; --port N is that port or a refusal. --host H listens on H: an address that is not this computer's own (0.0.0.0, a LAN address) needs GLYD_API_KEY (or --api-key) or --insecure-no-auth, else it is a refusal before the model loads. --allowed-origins URL,URL lets those pages' scripts call the API (CORS answers for exactly those origins, never *; with none listed CORS is off), --allowed-hosts NAME,NAME adds names the Host may be. --ollama-port N also listens on N (Ollama's own is 11434), only where N is free (else it says so and goes on): for the programs that look for Ollama at its port; Ollama's API is at the server's own port too.
  • The GPU is the one with the most free memory of those CUDA_VISIBLE_DEVICES shows. The context is --ctx N (--context); without it, what fits, up to 32,768 at a level (served to several users, what fits each of them, at least 4,096). --users N (4 if not given) is how many requests run at once: 1 to 8 on the lossless Qwen3 engine; 1 to 64 for Gemma 4, Qwen3.8 dense, Nemotron-H, DeepSeek-V4, and Muse Spark, Kimi-K3 and GLM-5.3-Flash on one GPU, as many as the GPU's memory holds (the server says how many); the other level engines run one request at a time (the others wait in order).
  • --with MODEL2 serves a second model from the same process, on the same GPU: MODEL on its port and MODEL2 on --with-port N, else the next free port after MODEL's. Each is a server of its own (its scheduler, its /v1/glyd/info, /metrics and requests); the first loads as it would alone and takes up to half of the memory left for its keys and values, then the second loads in what is left and takes the rest. Both are models of the level engines (a lossy level, as MODEL:wren). The status file says ready when both serve; a model that fails to load, or whose server does not start, ends the start of both. A GPU error after which the GPU cannot be used ends the process, both models with it, as it ends a server of one.
  • A model too big for one GPU (Kimi-K3, DeepSeek-V4, GLM-5.3-Flash, Muse Spark) uses all the GPUs shown. On datacenter GPUs (A100, H100, B200) that reach each other directly, Kimi-K3 and DeepSeek-V4 put every layer across all of them: each GPU holds a slice of every big matrix and the slices are gathered GPU to GPU, so every GPU works on every token. The start checks two gathers of known values and refuses (exit 3) where the GPUs' writes to each other arrive wrong. Elsewhere, or with --split CUTS --devices GPUS, the layers are split between the GPUs (one at work at a time). The numbers: research/tp-8xa100-2026-10-22.
  • The environment it reads: GLYD_API_KEY (or VLLM_API_KEY; --api-key works but ps shows it), GLYD_GPU_LIB where the GPU library is not beside the program, HF_HUB_CACHE or HF_HOME for a Hub name, HF_HUB_OFFLINE=1. A directory needs nothing else.

States:

statehow it shows
loadingthe process runs; the port is not bound (connections are refused); the status file is touched as it goes
readythe port is bound, /health is 200, /v1/glyd/info says "state":"ready", the status file says ready (2.6 s after the start in the record)
failed before readyexit 3 (1 for a wrong flag or level name), the reason on stderr and in the status file
failed after ready/v1/glyd/info says "state":"failed" with error: {at, message}, the engine's first failure. It stays failed: start the process again

Stop: SIGTERM or SIGINT end the process at once (exit 143, 130); a request in flight is cut. The GPU's memory is the driver's again when the process is gone (the record: 2,223 MiB used before the start and after the stop).

The key and the address checks

  • With a key, every path under /v1 needs Authorization: Bearer KEY (the scheme in any case), else 401 ({"error": {"message": ..., "type": "authentication_error", "param": null, "code": "invalid_api_key"}}, with WWW-Authenticate: Bearer). /, /health, /ready and /stats are open; /metrics needs the key. The key is compared as SHA-256 digests in constant time.
  • On this computer's own address (the default, and a loopback --host): a Host that is not localhost, 127.0.0.1, [::1], a container's name for this computer (host.docker.internal, gateway.docker.internal, kubernetes.docker.internal, host.containers.internal, host.lima.internal, host.minikube.internal) or a name in --allowed-hosts is 421. On every address an Origin that is not the server's own (http:// and the Host; https:// too where the server is open to the network, for a proxy that ends TLS) or one in --allowed-origins is 403 (a CORS preflight too). A program that sends no Origin (curl, the OpenAI libraries) is answered.
  • Limits: a body of 16 MiB (413), a header block of 64 KiB or 256 headers (431), 64 connections at once (503), the request line and headers within 30 s and the body within 120 s (408), a write to a client that reads nothing 60 s.

Operations: metrics, readiness and drain

GET /metrics (guarded by the key where there is one: Prometheus takes authorization: {credentials: ...} in its scrape config) answers, from the first request on:

metrickindwhat
glyd_requests_total{api}counterrequests taken for chat_completions, completions, messages, responses, ollama
glyd_requests_refused_total{code}counterrequests refused before any work: 401, 403, 421, 408, 413, 431, 503 (a drain)
glyd_requests_in_flightgaugerequests taken and not yet answered to their end
glyd_prompt_tokens_total, glyd_prefix_cache_hit_tokens_total, glyd_generated_tokens_totalcounterprompt tokens run or found in the prefix cache, those found, tokens written
glyd_sequences_finished_total{reason}counterstop, length, stopped (the client left or cancelled), error
glyd_time_to_first_token_secondshistogramfrom the sequence reaching the scheduler to its first token (the queue and the prompt included)
glyd_time_per_output_token_secondshistogrambetween two tokens of one reply
glyd_request_duration_secondshistograma sequence from the scheduler to its end
glyd_queue_depth, glyd_sequences_runninggaugesequences waiting for room, sequences running
glyd_kv_cache_pages, glyd_kv_cache_pages_used, glyd_kv_cache_usage_ratiogaugethe KV cache's pages (not at a lossy level: its engine has no paged cache)
glyd_gpu_memory_used_bytes{gpu}, glyd_gpu_memory_total_bytes{gpu}gaugethe computer's GPU memory by nvidia-smi (read at most every 5 s; left out where there is none)
glyd_ready, glyd_draining, glyd_uptime_seconds, glyd_build_info{version,model}gaugethe server's own state

The lossy levels (no scheduler) count tokens, the two latencies and the ends too, from the start of the reply, so their first token excludes the wait in line. glyd service answers /ready and /metrics with its own state (glyd_service_models_loaded, requests, refusals, in flight); a model's tokens and latencies are on that model's own glyd serve.

SIGTERM drains: the server stops taking requests (every new one for an API is 503 with Retry-After: 1, /ready is 503 draining; /health, the model list and /metrics still answer), lets the requests in flight end, and exits 0 when the last has ended, or 1 when --drain-timeout SECS (default 30) passes with some still running (they end with the process). A second SIGTERM exits at once (143). Ctrl-C is not a drain. glyd service drains the same way and then unloads its models. Not done yet: the experts' cache usage.

Traces: with OTEL_EXPORTER_OTLP_ENDPOINT (a base URL; /v1/traces is added) or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT (the whole URL) set, every sequence sends a span glyd.request (attributes gen_ai.request.model, glyd.prompt_tokens, glyd.generated_tokens, glyd.finish_reason; status error where it ended in an error) with the children glyd.queue (waiting for room; absent at a level that has no scheduler's queue), glyd.prefill (the prompt, to the first token) and glyd.decode (first token to the end), as OTLP over HTTP with JSON, batched by a thread of their own (up to 100 spans or a second). OTEL_EXPORTER_OTLP_HEADERS (k=v,k2=v2) carries a collector's key, OTEL_SERVICE_NAME (default glyd) names the service, OTEL_SDK_DISABLED=true turns it off. Off with no endpoint: nothing is sent. A collector that is down is said on stderr at most every 30 s, the spans are dropped and counted (glyd_trace_spans_dropped_total, glyd_trace_spans_exported_total), and no request is slowed. Only http/json is sent (the protocol variable is read and said where it asks for another); a request's incoming traceparent is not yet its span's parent.

Connections

The connections are tasks of an async front end (tokio; glyd-engine/src/server/frontend.rs), not threads: there is no cap on how many are open, and a connection that waits for its request, for its reply or for a slow client to read costs a task. What the client sends is read within bounds (the head within 30 s of the first byte, in 64 KiB and 256 headers; the body within 120 s; an answer's write within 60 s), and a connection that sends nothing is answered 408 and closed by its time. A client that sends Connection: keep-alive and gets an answer with a Content-Length keeps the connection for its next request (60 s idle); an answer that streams (server-sent events, Ollama's lines) ends its connection, and a client that sends no word of it is answered and closed, as before. What a client sends while it is answered is held to 64 KiB (past it the connection is let go); the bodies of requests share 1 GiB; there are at most 50,000 open connections and 8,192 requests in flight, and the next is answered 503 with Retry-After. A request with a repeated or non-numeric Content-Length, or with a Transfer-Encoding, is refused 400. A client that disconnects while its reply is being made ends the sequence: the engine does not go on generating for nobody. A client that reads slowly holds back the thread that writes its answer (a pipe of 64 chunks sits between them), not memory.

Every API front end (OpenAI's completions, Anthropic's Messages, OpenAI's Responses, Ollama's) asks the engine through one request-level interface (glyd-engine/src/engine_api.rs: submit a request, read its Stream, cancel it, stats). The load test (a_thousand_streaming_connections_all_end_without_an_error) holds 1,000 streaming connections at once on a scheduler over a CPU fake model: all are answered 200 with their events and their [DONE].

Endpoints

key
GET /healthno{"status":"ok"}: the process is up (a load balancer's liveness probe)
GET /readyno{"status":"ready"} where the model is loaded and the server takes requests; 503 {"status":"loading"} while it loads, 503 {"status":"draining"} after SIGTERM (readiness probe)
GET /metricswith a keyPrometheus text (version 0.0.4): see Operations
GET /v1/models, GET /v1/models/IDyesthe one model: id is MODEL as typed (with its tag, or the directory's path), max_model_len the context; another id is 404
POST /v1/chat/completionsyesa chat, JSON or SSE
POST /v1/completionsyesa plain completion, JSON or SSE; suffix makes it a fill in the middle (see below)
POST /v1/responsesyesOpenAI's Responses API, stateless: JSON or SSE (see below)
/api/chat, /api/generate, /api/tags, /api/show, /api/ps, /api/version, /api/pull, /api/deleteyesOllama's API (see below); /api/embed and the model-making calls answer 501
POST /v1/messages, /v1/messages/count_tokensyesAnthropic's Messages API, JSON or SSE (see below; not tracked by id)
POST /v1/glyd/tokenizeyesa request's prompt counted, nothing run
GET /v1/glyd/infoyeswhat the server is and holds
GET /v1/glyd/requests/IDyeshow a request stands
POST /v1/glyd/requests/ID/cancelyesa request asked to end
GET /v1/glyd/kv/eventsyesthe cache's blocks stored and removed by name, with their tokens (see below; 404 unless the operator turns them on)
GET /statsnothe lossless engine's scheduler counts (zero at a level)

A method a path does not take is 405, a path there is not 404.

Every error is OpenAI's: {"error": {"message", "type", "param", "code"}} with the status a client keys on. type is invalid_request_error (400, 404, 405, 413), authentication_error (401), permission_error (403), rate_limit_error (429) or server_error (5xx); code is null except invalid_api_key (401) and context_length_exceeded (a prompt, or a prompt and its length, past the context). stream_options.include_usage puts "usage": null in every chunk of a stream and the usage in a last chunk with no choices, as OpenAI's does. Where the server found some of a prompt's tokens in its cache (a conversation's earlier turns, a prompt it has run before), the usage has prompt_tokens_details.cached_tokens: they are among prompt_tokens, and were not run again. The Responses API has them as input_tokens_details.cached_tokens.

The cache is one for every caller of a server: a request finds what any request before it left (a conversation's earlier turns, a prompt it has run before), and by what it finds, or by how soon its first token comes, a caller can tell whether a prompt that begins as its own was run before. Callers who are not to learn that of each other each send a cache_salt (vLLM's field: any string that is not empty; a gateway before the callers sets it): a request with one finds only what requests with the same one left, and what it leaves is found by them alone; requests with none are a scope of their own. The usage tells a request how many tokens it found only where the request has a cache_salt: the others' usage has no cached tokens, though the cache serves them. A server whose callers are all one user can be told so (GLYD_ENGINE_CACHED_USAGE=1 in its environment, which glyd service passes to the models it starts) and then tells every request. The server's address does not decide this: one on this computer's own address may answer callers from anywhere, behind a proxy. The same holds for the server's own count of the tokens found: prefix_hit_tokens and prefix_hit_rate_percent of /stats are null, and /metrics has no glyd_prefix_cache_hit_tokens_total, unless the server was told its callers are one user.

What a finished request leaves is kept until the server needs its place, the oldest going first. cache_pin_seconds (a number up to 3600) asks that what this request leaves goes after the others' for that long; it is a preference among what is kept and never makes another request wait. The Anthropic endpoint sets it from cache_control (300, or 3600 with ttl: "1h"). A request that begins as an earlier one did has that start without running it, where the model allows: on Gemma 4 and Muse Spark the server finds the blocks of 16 tokens a prompt begins with by what they hold, whether the request that ran them is still running, is kept, has grown far past them or has ended, for as long as their memory has not been needed for something else; the Qwen3.5 layout shares a prompt another request ran to its end, from a sequence that is still there. A request that comes while another still runs the start waits for it rather than running the same tokens beside it.

Connecting tools

The default address is http://127.0.0.1:8000 (--port N for another; if 8000 is busy and no port was asked for, the server takes the next free one up to 8020 and says which at its start). glyd connect finds the server that runs here (8000 to 8020, then Ollama's 11434, or --port N) and prints the lines each tool needs, with its real port and model; it changes nothing, and never prints a key (it says $GLYD_API_KEY).

toolwhat it is givenglyd connect
OpenAI SDKs, LangChain ChatOpenAI, aiderOPENAI_BASE_URL=http://127.0.0.1:8000/v1, OPENAI_API_KEY (any, or the server's key)openai
Claude Code, Anthropic SDKs, LangChain ChatAnthropicANTHROPIC_BASE_URL=http://127.0.0.1:8000, ANTHROPIC_API_KEYanthropic
ollama libraries, LangChain ChatOllama, programs with an Ollama settingOLLAMA_HOST=http://127.0.0.1:8000 (--ollama-port 11434 for the programs that look at Ollama's own port)ollama
Open WebUI (container)its Ollama and OpenAI connections set to the server (below)open-webui
Continue~/.continue/config.yaml: a chat model through the OpenAI API, autocomplete through Ollama'scontinue

A container on Linux reaches a server on this computer's own address only from the host's network: docker run --network=host -e PORT=3000 -e OLLAMA_BASE_URL=http://127.0.0.1:8000 -e OPENAI_API_BASE_URL=http://127.0.0.1:8000/v1 ... ghcr.io/open-webui/open-webui:main. Docker Desktop (macOS, Windows) and Podman reach it as host.docker.internal and host.containers.internal; the Host check answers those two names (it still refuses every other name and every other site's Origin), and the address stays this computer's own. A server on another interface (--host 0.0.0.0) needs a key (or --insecure-no-auth), answers any Host (or those of --allowed-hosts) and still refuses another page's Origin. On Linux, Docker's host.docker.internal:host-gateway reaches the Docker bridge, not 127.0.0.1: use --host 172.17.0.1 (with a key) or --network=host. WSL reaches a server on Windows' 127.0.0.1 as localhost (mirrored networking or localhost forwarding); another name goes in --allowed-hosts.

The GPU job runs the clients against a random model made there (glyd-engine logitsmodel qwen35 DIR --servable: Qwen3.8's layout, a character-level tokenizer and Qwen3.8's chat template; tests/clients/tiny_check.py): the weights write random characters, so it checks what a client can rely on whatever they write (the shape of every reply, stream and count, and, where a grammar holds the reply, a JSON schema's document and a forced tool call's arguments being valid) through the OpenAI SDK (chat and Responses), the Anthropic SDK, the ollama library and LangChain. Open WebUI and Continue against a real model are run in the testing phase.

The clients are checked in tests/clients/: run.sh URL [KEY] runs the OpenAI, Anthropic, Ollama, LangChain and Open Responses checks (the HTTP tests of the Open Responses compliance suite, with every response and stream event checked against the specification's schema in tests/clients/openresponses/), each with the newest release of its library, against a running server; openwebui_check.py checks an Open WebUI container. Claude Code and Open WebUI were run against Qwen3-8B on an RTX 4080 SUPER for v0.34.0 (the numbers are in the pull request).

/v1/responses

The request is read as the chat request it is the same as and run as any chat request is, so its refusals, its grammar and its tools are the chat path's. Read: input (a string, or a list of message, function_call, function_call_output items; reasoning items are skipped; input_text, output_text and input_image parts), instructions, tools (function only), tool_choice, parallel_tool_calls, text.format (json_schema, json_object, text), max_output_tokens, temperature, top_p, top_k, seed, reasoning.effort, stream. The server keeps no conversations: previous_response_id, conversation, background, item_reference and the tools that run at OpenAI's end (search, code, computer) are 400 with the reason, and store is ignored (the response says store: false). The response has the thinking as a reasoning item (content[].reasoning_text), the answer as a message, each call as a function_call; status is incomplete with incomplete_details.reason max_output_tokens where the length cut it. A stream is the events response.created, response.in_progress, response.output_item.added, response.content_part.added, response.output_text.delta, .done, response.reasoning_text.delta, .done, response.function_call_arguments.delta, .done, response.output_item.done, then response.completed (or response.incomplete, response.failed), each numbered by sequence_number.

/v1/messages

Anthropic's Messages API for the Anthropic SDKs and Claude Code (ANTHROPIC_BASE_URL=http://127.0.0.1:8238 ANTHROPIC_API_KEY=any; with a server key, x-api-key: KEY or a bearer token). The request is read as the chat request it is the same as and run as any chat request is. Read: system (a string or blocks), messages (text, image, tool_use, tool_result blocks; thinking blocks of an earlier turn are skipped), tools (custom tools; the ones Anthropic runs, web_search and the like, are left out), tool_choice (auto, any, tool, none, disable_parallel_tool_use), thinking (enabled shows the model's thinking in a thinking block with an empty signature, which this server cannot make; else it is off), stop_sequences, max_tokens (required), temperature, top_p, top_k, stream; cache_control does not choose what is cached: a request finds what the server holds of its prompt whatever it marks. A request with a marker has what it leaves held before other requests' for the marker's time (5 minutes, an hour with ttl: "1h") when the server needs a place; never so long that another request waits. The usage says how many tokens a request found (cache_read_input_tokens) and, for a request with a cache_control marker, how many more it left that a request with the same start would find (cache_creation_input_tokens: the cache keeps every prompt, at no price), with input_tokens the rest; in a stream, in message_delta. Both are told as the cached count is (below). A stream is message_start, ping, each block's content_block_start, content_block_delta (text_delta, thinking_delta, signature_delta, input_json_delta) and content_block_stop, message_delta (the stop_reason: end_turn, max_tokens, stop_sequence with the string, tool_use; the usage) and message_stop, with a ping while a request waits for its turn. Errors are {"type": "error", "error": {"type", "message"}} (invalid_request_error, authentication_error, not_found_error, api_error). /v1/models carries type, display_name and created_at beside OpenAI's fields.

/api (Ollama)

For the programs that talk to Ollama (Open WebUI, Continue, LangChain, the ollama libraries). POST /api/chat and /api/generate stream JSON lines (application/x-ndjson; stream is on unless it is false) and end with done, done_reason, the durations (nanoseconds) and prompt_eval_count and eval_count; with tools the reply comes whole (a call is sent at once, its arguments an object). Read: messages (with images in base64, tool_calls, and tool messages by tool_name), prompt, system, suffix (fill in the middle) and raw, tools, format ("json" or a JSON schema), think (a boolean or a level; the thinking comes in thinking), and options: temperature, top_p, top_k, min_p, seed, stop, num_predict, repeat_penalty, presence_penalty, frequency_penalty (num_ctx is the server's --context; the others have no effect). keep_alive and model are read and ignored: the server holds one model and every request is answered by it; /api/tags and /api/ps list it by its short name in the model manifest, as Ollama writes one (qwen3:8b; the names glyd pull takes), or as REPO:latest where the manifest has none, (a GGUF served as a checkpoint is named by its file and its quantization, qwen3:8b-bf16 or my-model:f16, and answers to the same names without the tag) and /api/pull, /api/show and /api/delete take those names and /api/show says its capabilities (completion, tools, thinking, vision, insert) and its context_length. /api/pull of that model says success, of another is 404 with what to run; /api/delete of the served model is refused. Errors are {"error": "..."}. The key guards /api as it guards /v1.

Tool calls and thinking by family

The server reads each family's tool calls and reasoning from the markup its chat template shows the model, and gives them as OpenAI's tool_calls and reasoning_content and Anthropic's tool_use and thinking blocks, whole and streamed (a call's name when it is complete, its arguments as they are written; the thinking as it comes). A reader (src/reader.rs) turns a family's own markup into the shape the parsers read; the rest are read as they are.

familytool callsreasoningforced calls (tool_choice)
Qwen3, Qwen3-Coderhermes <tool_call>{json}</tool_call><think>grammar, or the prompt opens the call
Qwen3.5, Qwen3.6, Qwen3.8, Nemotron 3XML <tool_call><function=NAME><parameter=KEY>, typed by the tool's schema<think>grammar, or the prompt opens the call
GLM-5.3<tool_call>NAME<arg_key>KEY</arg_key><arg_value>VALUE</arg_value><think>the prompt opens the call
DeepSeek-V4DSML <|DSML|tool_calls> blocks<think>the prompt opens the call
Kimi-K3its tags (reader::Xtml)the think channelthe prompt opens the call
Gemma 4`<tool_call>call:NAME{key:<"
MuseATEM <atem:function_calls> blocks in a message to the tool (reader::Muse), typed by the schemaa message to selfthe prompt opens the message and the block

Qwen3.8-27B and Qwen3.8-Flash-Next ship the same chat template. A family's test (src/families.rs) renders a conversation with a call and a reasoning through its real chat template and reads both back, whole and in pieces of every size, and again token by token through the server's reader, reasoning split and tool parser with the deltas a client sees; the GPU job serves Gemma 4 at kestrel and runs the client checks against it. Where a call is forced by the prompt, the model's own arguments are not held to the tool's schema by a grammar.

Fill in the middle

POST /v1/completions with "prompt" (the text before the cursor, one string) and "suffix" (the text after) is written with the model's own tokens, <|fim_prefix|>BEFORE<|fim_suffix|>AFTER<|fim_middle|> (or StarCoder's <fim_...>, DeepSeek-Coder's <|fim▁begin|>), and the reply is the text between. A model whose tokenizer has none of them refuses suffix with 400.

/v1/glyd/info

curl -s -H "Authorization: Bearer $GLYD_API_KEY" http://127.0.0.1:8238/v1/glyd/info

From the record (served by its Hub name; the file list cut to two of sixteen):

{"object":"glyd.info","api":"glyd-serve/1",
 "build":{"version":"0.32.1","commit":"86530a29ad1096f8f116aab2578b1a911c64217d","development":true},
 "model":{"id":"Qwen/Qwen3.5-9B:swift","repo":"glyd/Qwen3.5-9B-swift","revision":"073a2132abeaa41c119678b9687092871521eb4d",
          "source":{"repo":"Qwen/Qwen3.5-9B","revision":"c202236235762e1c871ad0ccb60c8ee5ba337b9a"},"made_by":"glyd 0.29.3",
          "files":[{"name":"glyd.json","bytes":92205,"sha256":"85b27d2d4a7d31f9c3493a3dbf5f00f00469e0c67b917e8f1374900d674cc671"},
                   {"name":"model-00001-of-00007.safetensors","bytes":1004449488,"sha256":"ea1b678c4787351b59de96915373a4a2aecc9eea49df70a64baf707b3e6f3830"}]},
 "level":{"requested":"swift","effective":"swift","lossless":false},
 "precision":{"weights":"swift level: about 5.5 bits per weight, not lossless","activations":"bf16","sums":"fp32","kv":"bf16",
              "state":"fp32 (the delta rule's), bf16 (the convolution's)"},
 "device":{"ordinal":0,"name":"NVIDIA GeForce RTX 4080 SUPER","compute_capability":"8.9","cuda":"13.2","driver":"595.91.07"},
 "limits":{"context_tokens":4096,"concurrency":1,"max_choices":64,"max_body_bytes":16777216,"max_header_bytes":65536,
           "max_headers":256,"max_connections":null,"read_timeout_seconds":30},
 "fields":{"read":[...38],"no_effect":[...12],"refused":[...38]},
 "state":"ready","error":null,"requests":{"running":0,"cancelling":0},
 "memory":{"gpu":0,"measured_at":1792451421.629,"engine_bytes":6987473708,"weights_bytes":6200345608,"kv_bytes":134217728,
           "state_bytes":51511296,"scratch_bytes":601399076,"peak_bytes":6987473708,"peak_at":1792451421.367,
           "peak_since":1792451419.173,"device_total_bytes":16717119488,"device_free_bytes":7039418368,
           "not_counted":["the CUDA context and the kernels' code","cuBLAS's own workspace","the computer's memory"]}}
  • build.commit is what the build was given in GLYD_SOURCE_COMMIT (release.yml gives the tag's); null where it was given none.
  • model.repo and revision are read from the Hub cache's layout (models--ORG--NAME/snapshots/REV); null for another directory. source and made_by are glyd.json's: the model the level was made from, at its revision, and the Glyd that made it. glyd.json holds each tensor's SHA-256 too. A file's sha256 is the cache's blob name where the file is a link to one (the download checked it), else the file read at the start where it is 64 MiB or smaller, else null.
  • level.requested is the tag, --lossy (kestrel), or a glyd/NAME-LEVEL name; null where nothing asked for one (a directory runs at its own level). effective is the level loaded.
  • precision: sums is the products' accumulation. kv and state are null for the lossless engine, which does not say.
  • fields: read are the request fields this server reads (some values of some are refused, below), no_effect change nothing here, refused are refused when set to anything but null or the value that means "not asked" (false, 0, []).
  • Times are Unix seconds, to the millisecond.
  • memory.devices (not in the record above, added after it): the engine's buffers by GPU, one entry a CUDA context the engine opened or held a buffer in (gpu, engine_bytes, peak_bytes, peak_at); engine_bytes and peak_bytes above are every GPU's together.
  • costs (not in the record above, added after it): the model's cost profile at the level, as glyd-engine costs DIR prints it, with allocated (the engine's counters at load) beside the sizes from the files: what each layer holds by component, the bytes a decoded token reads, the KV and state bytes a token and a session. The fields are in docs/cost-profile.md. Where the profile cannot be made (a family it does not describe), costs is {"status": "unavailable", "error": "..."}.

Memory

  • engine_bytes: every buffer the engine holds on the GPU now, counted where the engine allocates and frees device memory (the sizes it asks for, not the driver's rounding).
  • weights_bytes, kv_bytes, state_bytes: what the model holds, made once at load and kept: the weights (the same number as the start's "GiB of weights" line), the keys and values for the whole context (bf16, --ctx positions, used or not), the states a sequence carries (zeroed at each request). scratch_bytes is the rest of engine_bytes: the activations, the products' workspaces, the logits, the rotary tables. Null where the engine does not say (lossless).
  • peak_bytes, peak_at: the most engine_bytes has been since the process started, and when. Never reset. peak_since is when the load began.
  • device_total_bytes, device_free_bytes: the driver's numbers now, for the whole GPU: every process's memory is in them.
  • not_counted: in nvidia-smi's number for this process but not in engine_bytes. The record: 7,002 MiB in nvidia-smi against 6,663.8 MiB of buffers, 338 MiB of context, code and rounding.
  • Nothing is cached between requests and nothing is allocated for one on a level's engine: a request uses the KV and state made at load. One GPU a process: the counters are the process's.

Requests

  • A field a request sets that fields.refused lists is refused, 400, in words. So are: response_format of a type other than text, json_object and json_schema, echo of a chat, best_of over n, n over 8, prompts times n over 64, n over 1 at temperature 0, stream_options without stream, continuous_usage_stats, tools where the template has none.
  • A reply can be held to a grammar, on every model the server runs: response_format (json_object, json_schema; the schema holds whether or not strict is set), vLLM's structured_outputs (json, regex, choice, grammar, json_object) and its guided_json, guided_regex, guided_choice and guided_grammar (a Lark grammar, or llguidance's grammar list as JSON), and a forced tool call (tool_choice naming a function, or required) in the call formats of Qwen, Nemotron, GLM and DeepSeek-V4 (hermes JSON, XML, GLM's <arg_key> and DSML): the function is one of the request's and the arguments follow its schema. Kimi's, Gemma's and Muse's calls are in their own markup and are opened by the prompt only. The tokens the grammar does not allow are taken out of each step's row of logits (llguidance), so the reply is valid or ends with finish_reason length. A schema or grammar that cannot be compiled, and two forms at once, are 400 in words. A request with none is sampled as before. guided_whitespace_pattern is refused.
  • On a level's engine that runs one request at a time (concurrency: 1: a model with a draft model, or split across GPUs, and the families the scheduler does not batch yet), logprobs and min_tokens are refused: it gives no log-probabilities and has no least length. fields.refused says so. Gemma 4, Qwen3.8 dense (the Qwen3.5 layout), and Muse Spark, Kimi-K3 and GLM-5.3-Flash on one GPU are served by the scheduler to --users at once (limits.concurrency), with both. GLYD_ENGINE_BATCH_PREFILL=0 makes every reply the one the same request alone gets: prompts run one a pass, and a model with experts (Muse Spark, Kimi-K3, GLM-5.3-Flash) decodes one sequence a step (its experts' products differ in the last bits at several rows). DeepSeek-V4 still runs one request at a time.
  • A field this server does not know is answered without it, and said once on stderr.
  • model is not checked: one model is served, and the reply names it.
  • The context holds the prompt and the reply. A prompt of the context's size or more is refused; with max_tokens (or max_completion_tokens), a prompt plus that is refused where it is more than the context, not cut short. Without it, a chat may run to the context's end, a plain completion stops at 16 tokens (the legacy default).
  • Sampling: temperature 0 is greedy; seed, top_p, top_k, min_p, the penalties, logit_bias, allowed_token_ids, stop, stop_token_ids, ignore_eos as vLLM takes them.
  • Thinking: Qwen3.5's template thinks unless "chat_template_kwargs":{"enable_thinking":false} or "reasoning_effort":"none". "include_reasoning":false leaves the thinking out of the reply (it is still made and counted).

Counting a prompt

curl -s -H "Authorization: Bearer $GLYD_API_KEY" -H 'Content-Type: application/json' http://127.0.0.1:8238/v1/glyd/tokenize \
  -d '{"messages":[{"role":"user","content":"Name three primary colors."}],"chat_template_kwargs":{"enable_thinking":false}}'
{"prompt_tokens":17,"max_model_len":4096}

The body is the request's (messages: a chat's; else prompt: a plain completion's), read by the same code as the request: the tokenizer, the chat template, the special tokens and the thinking setting are the reply's. It refuses what the request would be refused for, runs nothing, and its count is the reply's usage.prompt_tokens (17 and 17 in the record). Waiting for a reply that runs: it is answered between replies on a level's engine.

Usage

prompt_tokens: the prompt's tokens as the template made it. completion_tokens: every token made, the thinking, the answer and the end token where the reply ends by it. The thinking's share is not given apart.

Replies

A JSON chat (from the record; DIR is the directory served):

curl -s -H "Authorization: Bearer $GLYD_API_KEY" -H 'Content-Type: application/json' http://127.0.0.1:8238/v1/chat/completions \
  -d '{"messages":[{"role":"user","content":"Name three primary colors."}],"max_tokens":64,"temperature":0,"chat_template_kwargs":{"enable_thinking":false}}'
{"id":"chatcmpl-8","object":"chat.completion","created":1792451404,"model":"DIR","choices":[{"index":0,"message":{"role":"assistant",
 "content":"The three primary colors in traditional color theory ... (additive color mixing, such"},"logprobs":null,"finish_reason":"length"}],
 "usage":{"prompt_tokens":17,"completion_tokens":64,"total_tokens":81}}

With the thinking on, the message has reasoning_content and reasoning (the same text) beside content.

A streamed chat:

curl -sN -H "Authorization: Bearer $GLYD_API_KEY" -H 'Content-Type: application/json' http://127.0.0.1:8238/v1/chat/completions \
  -d '{"messages":[{"role":"user","content":"What is 17 times 23?"}],"max_tokens":1024,"temperature":0,"stream":true,"stream_options":{"include_usage":true}}'
data: {"id":"chatcmpl-11","object":"chat.completion.chunk","created":1792451405,"model":"DIR","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-11",...,"choices":[{"index":0,"delta":{"reasoning_content":"Thinking","reasoning":"Thinking"},"logprobs":null,"finish_reason":null}]}
...                                         (the thinking, then deltas with "content")
data: {"id":"chatcmpl-11",...,"choices":[{"index":0,"delta":{"content":"\n"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-11",...,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
data: {"id":"chatcmpl-11",...,"choices":[],"usage":{"prompt_tokens":20,"completion_tokens":662,"total_tokens":682}}
data: [DONE]
  • The first event of each choice carries the role and "content":"". A delta carries reasoning_content and reasoning (the same text), or content, or tool_calls.
  • finish_reason: stop (the end token, a stop string or stop token, or a cancel: below), length (max_tokens, or the context full), tool_calls.
  • The usage event ("choices":[]) comes only with stream_options.include_usage. Then data: [DONE], and the chunked body ends.
  • While a request waits for its turn or its prompt is read for more than a second, the stream's headers go out and an SSE comment (: waiting) comes each second.
  • An error after the stream began: data: {"error":{"message":"...","type":"server_error"}}, then data: [DONE].

Errors before a reply:

400 {"error":{"message":"logprobs is not supported by the engine this model runs on yet","type":"invalid_request_error","code":400}}
400 {"error":{"message":"This prompt has 15 tokens and asks for up to 5000 more, 5015 in all: longer than the model's context of 4096 tokens: maximum context length (a longer one: --context N)","type":"invalid_request_error","code":400}}
401 {"error":"Unauthorized"}
404 {"error":{"message":"no request has this id (the last 64 that ended are kept)","type":"invalid_request_error","code":404}}
421, 403: {"error":{"message":"...","type":"Forbidden","code":421}}     431: a header block past 64 KiB or 256 headers     503: past 64 connections

A request by its id: status and cancel

A reply's id is chatcmpl- (a chat) or cmpl- (a plain completion) and the request's request_id, or a number the process counts where it gave none. A request whose id is running refuses a second one with it (400).

curl -s -H "Authorization: Bearer $GLYD_API_KEY" http://127.0.0.1:8238/v1/glyd/requests/chatcmpl-rec-1
{"id":"chatcmpl-rec-1","state":"running","cancel":null,"began":1792451411.803,"ended":null,"how":null}
curl -s -X POST -H "Authorization: Bearer $GLYD_API_KEY" http://127.0.0.1:8238/v1/glyd/requests/chatcmpl-rec-1/cancel
{"id":"chatcmpl-rec-1","state":"cancelling","cancel":"asked","began":1792451411.803,"ended":null,"how":null}
... 0.016 s later:
{"id":"chatcmpl-rec-1","state":"ended","cancel":"asked","began":1792451411.803,"ended":1792451414.882,"how":"cancelled"}
state
runningthe request runs, or waits for its turn
cancellingasked to end (cancel: asked by the endpoint, or client gone), and the engine is not done with it yet
endedthe engine is done with every sequence of it: what they used is the next request's. how: finished, cancelled, or failed: ...
  • A cancel stops each sequence at its next token; one that waits for its turn is not run. A level's engine reads the whole prompt before it looks at a cancel: 0.633 s for a cancel 0.2 s into a 3,790-token prompt in the record, 0.016 s during a reply.
  • A client that closes its connection is cancelled the same way, seen at the next write or within a second: ended 0.031 s after curl was killed in the record.
  • A cancelled request whose client still reads gets the end of a client's stop: finish_reason stop, the usage, [DONE]. The status says cancelled.
  • ended is said once every choice's thread has seen its sequence's end from the engine, before the reply's last bytes go out. On a level's engine nothing is freed then: the KV and the state are made at load and the next request uses them.
  • The last 64 ended requests are kept; an id given again names the new request. Ids are matched as the path has them (no percent-decoding): give request_ids of letters, digits, - and _.

The cache's events

A router that sends a request to the server already holding its start reads what the cache holds by name: each step's blocks stored (their names, the name of the block before them, their tokens) and removed. Off unless the server's operator sets GLYD_ENGINE_KV_EVENTS=1: an event carries a prompt's tokens, and whoever reads the events reads every caller's prompts (with no key on the server, whoever reaches its port). The blocks are the description executor's (the families it serves); 16 tokens a block.

curl -s -H "Authorization: Bearer $GLYD_API_KEY" 'http://127.0.0.1:8238/v1/glyd/kv/events?after=41&wait=5'
{"next":43,"oldest":1,"gap":false,"batches":[{"seq":42,"ts":1795366128.125,"events":[
  {"type":"removed","blocks":["9f2c..."],"medium":"gpu"},
  {"type":"stored","blocks":["1a7e...","c03b..."],"parent":null,"tokens":[...32 ids...],"block_size":16,"medium":"gpu"}]}]}
  • after: the newest batch already read (0: all kept); wait: seconds to wait for a batch where none is new yet (at most 10). Pass next as the next call's after.
  • A block's name is 32 hexadecimal digits: the first 16 bytes of SHA-256 over the name of the block before it and its 16 token ids, a request's chain beginning at its scope's root (cache_salt). parent null: the first stored block is its sequence's first.
  • Batch 1 is {"type":"cleared"}: the cache holds nothing when the server starts. The last 1,024 batches are kept; gap: true says some after after are not, and a reader takes what it knew as cleared.
  • The schema is part of glyd-serve/1: a change that breaks it is a new API version.

Limits

A body of 16 MiB; a header block of 64 KiB and 256 headers (431 past them, read no further); 64 connections at once (503 past them); a read of the request's head or body waits 30 s at most. No time limit on a reply: cancel it, or close the connection.

Differences from Glyd-Compute's service adapter

Against docs/service-adapter.md at Sigbound/glyd-compute 24baad6dba877e37e4d80a53ea8b341bc8115079, what an adapter must do on purpose:

  1. Loading: the port is bound only once the model is loaded. Before that a connection is refused; there is no 503 while loading. The status file (--status-file) says ready, or the reason of a refusal.
  2. /health is open: it answers 200 with or without the key. The refusal without a key holds for every path under /v1.
  3. There is no /props. /v1/glyd/info has the build, the context per request (limits.context_tokens), the requests it runs at once (limits.concurrency) and the model; it has no chat-template capability flags.
  4. /v1/models's id, and every reply's model, is MODEL as typed: the directory's path where a directory is served. There is no served-model-name flag, and a request's model is not checked.
  5. The final usage needs stream_options: {"include_usage": true}.
  6. A stream that waits sends : waiting comment lines.
  7. Deltas carry the thinking twice, as reasoning_content and reasoning.
  8. A cancelled stream ends with finish_reason stop, the usage and [DONE]; /v1/glyd/requests/ID says it was cancelled.
  9. Cancel by id (POST /v1/glyd/requests/ID/cancel), then ended before the memory is reused, in place of stopping the process; stopping the process still frees everything.
  10. The key's variable is GLYD_API_KEY (or VLLM_API_KEY). With the environment not inherited, give GLYD_GPU_LIB where the library is not beside the program, and HF_HUB_OFFLINE=1.
  11. A level's engine refuses logprobs and min_tokens, and every engine refuses a max_tokens the context has no room for, rather than cutting it.

Known limits

  • The lossless engine (Qwen3 dense; glyd serve of Qwen3.5 penguin is vLLM's) gives no memory parts or KV and state precision (null); its engine_bytes and peak are counted.
  • /v1/messages requests are not tracked by id; they stop when their client goes.
  • A Hub name needs the network for the base model's config.json; offline, serve the directory.
  • One process serves one GPU; a model split across GPUs is not served.
  • completion_tokens is not split into the thinking and the answer.

The background service

glyd service keeps one program running that owns the API port, loads a model when a request names it, unloads it after it has been idle, and holds more than one model at a time. After install.sh on Linux with an NVIDIA GPU it is a user unit of your account: it answers on 127.0.0.1:11434 from then on and at every login, with no command typed (GLYD_NO_SERVICE=1 in front of sh leaves it out; glyd service uninstall takes it out).

glyd pull gemma4:12b:wren                      # download a model (by name or Hub id)
curl localhost:11434/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"gemma4:12b:wren","messages":[{"role":"user","content":"hi"}]}'    # loads it; the answer streams as with glyd serve
glyd ps                              # what is loaded, for how long, and when it is unloaded
glyd stop gemma4:12b:wren                      # unload it now (glyd stop --all)
glyd run gemma4:12b:wren                       # a chat through the service (its model, no second copy on the GPU)
glyd service install | uninstall | status | stop

The service is a supervisor: each model is a glyd serve of its own on a loopback port, so a model has the server's behaviour as it is (constrained decoding, tools, the lossless KV cache) and leaves the GPU by its program ending, which frees all of its memory. The service passes the request through and streams the answer back.

--port NThe port. Fixed (11434, where Ollama's clients also look). A port in use is an error that names the program that has it, never a move to another port. glyd ps, stop and run read --port N or GLYD_SERVICE_PORT=N.
--keep-alive THow long a model stays loaded after its last request: 90s, 5m (the default), 2h, 0 (unload at once), never.
--max-loaded NThe most models held at once. Where the GPU's memory can be read (nvidia-smi) models are held by memory: a load first unloads the least recently used idle models until the model's footprint (measured when it first loaded) fits beside what is free, and this is only a ceiling (16). Where it cannot (a Mac, AMD), it is the count (2). A request for a model when every loaded one is busy waits up to 30 s, then is answered 503; a load that fails for want of memory is tried again once with the idle models unloaded.
--context N, --users NPassed to each model's glyd serve.
--host HAn address of your choice. One that is not this computer's own needs GLYD_API_KEY or --insecure-no-auth (else the service does not start), and gives the warning glyd serve gives. --allowed-origins and --allowed-hosts as for glyd serve.

Probes, metrics and stopping

GET /health (up) and GET /ready (takes requests; 503 while draining) are open; GET /metrics (Prometheus text: models loaded, requests, refusals, in flight) needs the key where one is set. SIGTERM drains: no new request for a model is taken (503), the ones in flight finish, up to --drain-timeout SECS (30), then the models are unloaded and the service exits 0 (1 if some were still running at the bound). glyd service stop is the immediate stop.

What is open

  • It listens on 127.0.0.1 unless --host says otherwise. On its own address, a loopback --host too, it refuses a Host that is not a loopback or container name and an Origin that is not its own, as glyd serve does; CORS is off. Requests are bounded as glyd serve's are (headers 64 KiB and 30 s, body 128 MB and 120 s).
  • It loads only models that are downloaded already (glyd pull): a request cannot make it fetch a model, and it takes no path.
  • GLYD_API_KEY (in the unit's environment) guards /v1, as for glyd serve.
  • glyd stop and glyd service stop carry a MAC (HMAC-SHA256, good for one request and a minute) made with a secret in a file only your account can read (~/.local/state/glyd/service.secret, mode 0600; the secret is never sent), so another user of the computer cannot stop your models. The same secret lets glyd ps, stop and run know that the program on the port is your service, for that port, before they send it a key or a prompt: a program that took the port first cannot prove it (and glyd run then runs a copy of its own).
  • Each model's program binds a port the system chooses (port 0) and says it in its log, so no other program can take it between a choice and the bind.
  • Without an API key, another user of a shared computer who can reach 127.0.0.1 can send the models prompts, as with any server on a loopback port. On a shared computer set GLYD_API_KEY.

Files

Each model's program writes ~/.local/state/glyd/logs/service-MODEL-TIME.log; when a model does not come up, the answer to the request says why, with the log's last lines.

glyd service install writes ~/.config/systemd/user/glyd.service (Linux; loginctl enable-linger $USER starts it at boot rather than at login) or ~/Library/LaunchAgents/com.getglyd.glyd.plist (macOS), or on Windows a scheduled task GlydService of your own account that runs at every logon with your rights (no administrator; glyd service uninstall removes it). glyd ps shows each model's GPU memory where it is known.

Models

This page is generated from glyd-engine/src/support.rs, levels.rs and machine.rs by scripts/gen_models.py at commit 4aa21e92 of main. It is the table glyd fit, run and serve read, so it says what they do. Version 0.34.2.

Families the engine runs

FamilyLevelsContext where none is askedWeights split over GPUs atExperts in RAM at
Qwen3penguin8,192 tokensnono
Qwen3.5kestrel, swift, wrenwhat fits, up to 32,768nono
Nemotron-Hpenguin, kestrel, swift, wren, hummingbird (pre-packed)what fits, up to 32,768penguinkestrel, swift, wren, hummingbird
Gemma 4penguin, kestrel, swift, wrenwhat fits, up to 32,768nono
Kimi-K3penguin, hummingbird (pre-packed)8,192 tokenspenguin, hummingbirdpenguin, hummingbird
GLM-5.3-Flashpenguin, hummingbird (pre-packed)8,192 tokenspenguin, hummingbirdpenguin, hummingbird
DeepSeek-V4penguin, hummingbird (pre-packed)8,192 tokenspenguin, hummingbirdpenguin, hummingbird
Muse Sparkpenguin, hummingbird (pre-packed)8,192 tokenspenguin, hummingbirdpenguin, hummingbird
Qwen3.8-Flash-Nextnone: Condor runs it-nono
  • The engine tells a family apart by its config.json, not by its name. Qwen3 dense is Qwen3ForCausalLM; Qwen3.5, 3.6 and 3.8 dense are Qwen3_5ForCausalLM, Qwen3_5ForConditionalGeneration. Any other kind is refused with exit 3 and the reason.
  • Every build runs every level a family lists, wren included (since v0.34.0). On a quantization-aware checkpoint (Google's -qat- releases) wren is exact: the release's own four-bit weights.
  • A level a family does not list is refused: glyd run zai-org/GLM-5.3-Flash:swift stops and says GLM-5.3-Flash runs at penguin.
  • The context is at most 40,960 tokens (the KV tables' largest tier), and never more than the model's own limit.
  • glyd supports MODEL answers for one model: exit 0 where the engine runs its kind, 3 where it does not.

Levels

LevelBits a weightLossless
penguinabout 10.8yes
kestrel6.5no
swift5.5no
wren4.5no
hummingbird2-4 on expertsno

What each level costs in quality and memory: Choosing a level.

The machine

  • NVIDIA, compute capability 8.0 or newer (Ampere and later), a driver for CUDA 13 (driver 580 or newer).
  • Computer architecture: x86_64, aarch64.
  • glyd run hands a model to the engine by default only on the GPUs below, which are the (GPU, model family) pairs the engine was measured on against vLLM (machine.rs, GPUS; the lossy levels are the engine's wherever it runs). glyd-engine itself runs on any GPU that fits the first rule.
    • RTX 4080 SUPER (compute capability 8.9): Qwen3 models
  • AMD GPUs run in development builds only (GLYD_HIP=1). Apple GPUs and a machine with no GPU are refused with the reason. Nothing is built or tested for Windows or macOS.

The model catalog

What is listed, who owns it, what a model needs before it is listed, and how a change is reviewed. Short on purpose.

What the catalog is

  • The families the engine runs and the levels each runs at: glyd-engine/src/support.rs, shown on the Models page.
  • Each level's definition: glyd-engine/src/levels.rs.
  • The cards: cards/NAME-LEVEL.json, the measured numbers a model's Hugging Face card is made from (huggingface/model_card.py), and the pre-packed repos glyd/NAME-LEVEL on the Hub.
  • The manifest of short names to Hub repos and sizes, glyd-engine/models.json (P4, #153).

The engine tells a family apart by its config.json, so a new size of a listed family runs without a catalog entry. An entry is for a new family, a new level of a family, or a pre-packed repo.

What we test and showcase

Models released in the last six months. The guide's examples, new measured runs and new cards use them; the cutoff moves with the date (on 2026-11-20 it is 2026-05-20, RECENT_CUTOFF in glyd-engine/src/models.rs). Short names default to models inside it. An older model that already runs keeps running and keeps its entry. It gets no new showcase.

Who owns an entry

  • The catalog owner is the maintainer who covers the engine in MAINTAINERS. Today that is @surya-koritala, who covers all areas.
  • Each entry has an entry owner, named in the pull request that adds it. The entry owner can re-run its checks on a machine, re-measures it when the engine changes in a way that moves its numbers, and answers issues about it. Until a second maintainer joins, the catalog owner is the entry owner.
  • .github/CODEOWNERS lists the catalog files, so a change to one asks the owner for review.
  • An entry whose owner has left goes back to the catalog owner, who finds a new owner or removes the entry in a pull request.

Before a model is listed

Every item is a file or a command in the pull request.

NeedsWhat counts
The kind runsglyd supports MODEL exits 0, and the family has a row in support.rs with its test (every_family_is_told_apart in the same file reads a fixture config.json).
A logits testThe engine's top-k logits and KL against a stored reference on a fixed prompt, for a small checkpoint of the family. The per-family harness is R7 (#146) and is not merged. Until it is, attach the output of the family's check command (glyd-engine kcheck, check; CONTRIBUTING.md) and say so.
A measured runglyd run or serve on named hardware, in benchmarks/gpu/MACHINE-MODEL-DATE/ with a README: the machine, the driver, the engine's commit, the command, the tokens/s, the memory in use, and the log. The entry's measured points at it. benchmarks/gpu/rtx4080s-qwen3-8b-engine-2026-11-20 is the form to copy; the model in a new run is one from the last six months.
Quality, for a lossy levelKL from bf16 and top-1 agreement on the pinned WikiText-2 text, by research/lossy-2026/kld_study.py as in benchmarks/weights/kld-q56-2026-10-09, with the FP8 checkpoint beside it where one exists.
License and gatingThe model's license, its link, and whether the Hub gates it, recorded in the manifest entry (license, gated). If the license allows redistributing derived weights, a pre-packed repo may be published and its card carries the base license (as cards/nemotron-3-hummingbird.LICENSE does). If it does not, the model is listed as run-from-the-original-repo only. A gated model's message names the license page and glyd login.
A cardcards/NAME-LEVEL.json with size_gb, the speed on each GPU measured, kl_bf16, the date and the Glyd version and commit. A card has only what was measured.

The Models page needs no edit: it is generated from support.rs.

Every entry in glyd-engine/models.json carries three fields, and a test in glyd-engine/src/models.rs (every_entry_says_its_license_whether_it_is_gated_and_where_it_was_measured) fails CI if one is missing:

FieldWhat it says
licenseThe model's license, as the Hub names it (apache-2.0, mit, or the license's own name where the Hub says other).
gatedfalse, or "auto" or "manual" as the Hub says: the download needs a login and an accepted license.
measuredA record in this repository where the engine ran this model, which must exist, or null where there is none.

A null is the honest answer for a model nobody has run the engine on, and it keeps that entry from being shown. A manifest from before these fields still loads: the program only checks that a field, where it is there, is well formed.

How a review goes

  1. The pull request is labeled area: models and uses the pull request template. It names the entry owner.
  2. .github/CODEOWNERS asks the owner for review. The Build & Test check must pass.
  3. The reviewer goes down the table above and confirms each item: the command was run (re-run supports and fit), every number on the card has a log in the pull request, the license line is right.
  4. Where there is a second maintainer, a maintainer does not merge their own catalog change without that review.
  5. A number that cannot be repeated is removed from the card, not softened.

Asking for a model

Open a Model request. Run glyd supports MODEL first and paste what it says; the form also asks for the architecture, the license, whether the Hub gates it, the size you would run and the hardware.

  • If supports says the kind runs, the reply is the command to run it. A catalog entry is only needed for a pre-packed repo or a card.
  • If it does not, the request becomes an engine issue labeled area: models. A maintainer decides if it joins the ROADMAP, and says why if not.
  • Someone who can test on the hardware, or who sends the logits fixture and the measured run, moves a request fastest.

Checking a machine: the M1 gate

benchmarks/gates/m1-gate.sh checks one clean machine end to end: install, first token, the plan, the refusals, the tools. m1-gate.ps1 is its PowerShell twin for Windows. This page says what each step checks. A test (scripts/check_gate_docs.py) fails CI if the script has a step this page does not name.

benchmarks/gates/m1-gate.sh --tier 16gb                       # on the machine: GPU tier 8gb, 16gb or 24gb
benchmarks/gates/m1-gate.sh --plan-only --machine rtx4080s    # no GPU: the planner's answers against the model list

It prints one line a step (PASS, FAIL or SKIP), writes results.tsv and m1-gate.json, and exits 0 only where nothing failed and every required step has a result.

The models

benchmarks/gates/m1-models.txt lists the pinned models and, for each machine tier, whether the engine runs it (run) or refuses it (refuse). A model that is refused still has to be refused well: a few lines and a non-zero exit. Only models released in the last six months are on the list.

The steps

StepWhat it checksRead more
machineThe GPU, its tier, the RAM and the OS, as facts for the record.First run
installThe install command runs, timed (curl -LsSf https://getglyd.com/install.sh | sh).Install
vendor-one-lineOn a machine with no NVIDIA driver (Apple, AMD), run answers in one or two lines and exits non-zero.Install, Troubleshooting
plan:MODELThe planner's answer (run or refuse) is what m1-models.txt expects for the tier.First run
refusal:MODELA model the planner refuses gives a refusal of at most three lines and a non-zero exit.Troubleshooting
first-token:MODELserve starts and the first streamed token arrives within 120 seconds of starting it, the download and packing included.First run, Serving
plan-is-load:MODELThe level the plan printed is the level that loaded, and the weights are within 10% of the plan, read from /v1/glyd/info.First run, Serving
json-schema:MODELA request with a JSON schema returns an object that is valid against it.Serving
no-pythonNothing called python or pip during the run: both are shimmed to fail.Install

Checks other runs measured

These come in as result files (--ext DIR, one NAME.result each). A required one that is missing fails the gate.

StepWhat it isRead more
driver-r535, driver-r550, driver-r570The engine bundle on a machine with only that NVIDIA driver (the CUDA 12 build): version, doctor, a first answer, serve, and the message for a driver that is too old. p6-driver-check.sh makes them.Troubleshooting
p2a-no-oomFor each model of the list on the reference GPU, run does not run out of memory at the planned context, and the plan matches what loaded (scripts/ci_plan_check.py).First run
r5a-schema-real-weightsJSON-schema output is valid on real weights.Serving
r8-reference-gpu-resultsThe reference results of glyd bench on the reference GPU.benchmarks/
p17-open-webui, p17-continue, p17-openai-sdkOpen WebUI, Continue and an OpenAI SDK client connect with default settings.Connecting tools

The Windows twin is m1-gate.ps1. It has not been run on a Windows machine yet.