Migrating from other tools¶
gmlx runs the same GGUF files as llama.cpp, LM Studio and Ollama, so a model needs no conversion. Most of those tools' commands, flags and settings have a gmlx equivalent, and an LM Studio library runs without a new download.
llama.cpp¶
gmlx chat model.gguf is the equivalent of llama-cli -m model.gguf, and
gmlx serve model.gguf is the equivalent of llama-server -m model.gguf,
on the same default port 8080. gmlx run model.gguf --prompt "..."
generates one reply and exits.
Most flags have a direct equivalent:
| llama.cpp | gmlx | Notes |
|---|---|---|
-m model.gguf |
The model as the first argument | For a model split into shards, give the first shard. |
-n N |
--max-tokens N |
Both generate until end-of-sequence by default. |
--temp, --top-k, --top-p, --min-p |
The same names | The defaults come from the model's family defaults. |
-c N |
--max-kv-size N |
The context length comes from the GGUF, and this flag limits it. On run and chat, the cache also becomes a rotating window. |
--rope-scaling, --rope-scale, --rope-freq-base, --rope-freq-scale, --yarn-* |
The same flags | On run, chat and a positional serve. In a config, the model's rope_scaling block. |
-ngl N |
None | Every layer runs on the GPU. A model larger than memory runs with --stream-experts or --stream-cpu. |
--cache-type-k q8_0, --cache-type-v q8_0 |
--kv-bits 8 |
--kv-group-size sets the group size. |
--draft-model, --spec-draft-n-max M |
--draft-gguf, --draft-block-size M+1 |
The block also counts the token that the drafts extend. A model with an MTP head needs no drafter. |
--chat-template |
--chat-template |
The value is a template or the path of one. |
--ignore-eos |
--ignore-eos on serve |
The flag has the same effect, for benchmarks at a fixed length. |
--api-key K |
server.api_key |
The key is set only in the configuration file, so it never shows in process listings or shell history. |
--parallel N |
None | The server batches concurrent requests with no setting, and --budget-gb limits the memory of loaded models. |
--lora FILE |
--adapter FILE |
Repeat the flag for each adapter. LoRA adapters covers adapter files in both directions. |
--lora-scaled FILE:SCALE |
--adapter FILE:STRENGTH |
The same scale. A negative strength subtracts the adapter. |
--lora-init-without-apply |
--adapter FILE:0 |
The adapter loads at strength 0, and each request sets its own strength. |
--reasoning-budget N |
--thinking-budget N |
-1 sets no budget in both. In a config, the thinking_budget key sets it. |
--reasoning-budget-message MESSAGE |
thinking_budget_message |
A sampling key in the configuration file, with no flag. |
The server answers the OpenAI, Anthropic Messages and OpenAI Responses APIs on one port, and the HTTP API lists the fields that each one accepts. These llama-server request fields carry over:
| llama-server | gmlx | Notes |
|---|---|---|
lora: [{"id": 0, "scale": 0.5}] |
The same | The id is the adapter's index in /v1/models. Each item needs its scale. A bad or repeated id gets a 400. |
reasoning_budget_tokens, reasoning_budget_message |
The same | gmlx also names them thinking_budget and thinking_budget_message. |
| A last assistant message, which llama-server continues | continue_final_message: true and add_generation_prompt: false |
Send both fields to llama-server too. In gmlx, only some chat templates can continue a message. |
logprobs: true |
logprobs: true and top_logprobs: 20 |
llama-server returns 20 alternatives by default. gmlx returns them only when the request sets top_logprobs. |
Mixing adapters per request,
Thinking budget,
Assistant prefill and
Logprobs describe the fields. gmlx has no
/lora-adapters route, so each request sets the adapter strengths it needs.
Assistant prefill¶
gmlx continues a message in the prompt that llama-server renders, with these differences:
- Prefill is opt-in. llama-server continues a last assistant message by
default, and gmlx continues it only when the request sets
continue_final_message. With that field, llama-server continues a last message of any role, and gmlx needs an assistant message. - gmlx merges all system messages into one system message at the start. llama-server keeps each one where the client sent it.
- gmlx gives the template a system message as one string, also when the client sends it as text parts. llama-server can give the template the parts, and a Gemma 4 template renders parts with a space before the end of the turn.
- The reply holds only the new text. A llama-server reply that is not streamed also holds the prefill.
- llama-server turns thinking on when the template has a switch, and gmlx
keeps the template's default. Send
chat_template_kwargswithenable_thinkingto get the same prompt from both servers.
KL divergence¶
llama-perplexity measures the KL divergence in two runs. The first saves
the reference model's log-probabilities, and the second compares the test
model with them. gmlx kld does both in one command:
llama-perplexity -m Qwen3.5-9B-BF16.gguf -f page.txt -c 512 --kl-divergence-base base.kld
llama-perplexity -m Qwen3.5-9B-Q4_K_M.gguf -c 512 --kl-divergence-base base.kld --kl-divergence
gmlx kld Qwen3.5-9B-Q4_K_M.gguf --reference Qwen3.5-9B-BF16.gguf --text page.txt
-c N is --ctx N, which is 512 by default, and --chunks N has the same
name. gmlx reports the same Mean KLD and Same top p. To score adapters,
give one --adapter FILE:STRENGTH flag for each strength, as
gmlx kld shows.
Ollama¶
Ollama stores its models as blobs named by their hash, not as .gguf
files, and gmlx init finds only .gguf files. Download the models that
you use again with gmlx pull. Before you download,
gmlx validate hf:<org>/<repo> lists a repository's files.
gmlx does not implement the Ollama API. A client that can use an OpenAI-compatible endpoint works with no changes, and an app built for Ollama needs its OpenAI mode, pointed at port 8080.
A Modelfile's settings map to the configuration file:
| Modelfile | gmlx |
|---|---|
PARAMETER num_predict |
sampling.max_tokens |
PARAMETER temperature, top_k, top_p, min_p, seed, stop |
The sampling keys of the same names |
PARAMETER repeat_penalty, repeat_last_n |
sampling.repetition_penalty, sampling.repetition_context_size |
PARAMETER num_ctx |
load.max_kv_size |
SYSTEM |
system |
Each of these goes in a profile or in a model
entry's overrides. A Modelfile
TEMPLATE does not carry over, because gmlx uses the Jinja chat template
in the GGUF.
Ollama's keep-alive setting corresponds to the server's idle timeout. A
model unloads after ttl_s seconds
without a request, or when the memory budget needs the room that the model
takes. pin keeps a model loaded.
Memory and residency explains the rules.
LM Studio¶
LM Studio stores plain GGUF files, so your library runs as it is:
The -r flag scans the folders inside the library too. When you have no
~/models or ~/gguf folder, the gmlx init wizard offers the LM Studio
folder by itself. You can then rename the models and set a default model in
the configuration file.
A client that used LM Studio's OpenAI-compatible endpoint works with gmlx after you change its port from 1234 to 8080.