Quick Start
1
Serve a trained model
Point at a GGUF and get an OpenAI-compatible endpoint on
127.0.0.1:8080.2
Use it from any OpenAI client
The endpoint is OpenAI-compatible, so
praisonaiagents (and every other OpenAI SDK) talks to it out of the box.3
Benchmark and see the MTP win
--benchmark is a one-shot: it prints tokens-per-second plus draft acceptance for Gemma-4, then exits.4
Export the GGUF with its MTP drafter
Pass
--mtp-draft when exporting a Gemma-4 model — the stock drafter is fetched and placed next to the GGUF so serve picks it up automatically.How It Works
MTP proposes several tokens with a small drafter, then the fine-tuned model verifies them in one pass — so the output is bitwise identical to plain serving. The drafter is a separate artifact and is never contained in a plainq4_K_M GGUF — that is why the fetch step exists. Verification is done by the fine-tuned target model, so the generation is lossless: identical output, fewer forward passes.
Configuration Options
Two surfaces: CLI flags onserve, and config-file keys the trainer accepts when you export --mtp-draft.
CLI flags — praisonai-train serve
Provide either --gguf or --model-dir to pick the target.
Provide
--gguf or --model-dir — without either, serve exits with Nothing to serve: provide --gguf or --model-dir. The server binds to 127.0.0.1 (there is no --host flag).Config keys — export --mtp-draft
These keys are accepted by the trainer’s config (config.yaml) alongside export.
mtp_draft_repo and mtp_draft_file are recognized config keys reserved for a custom drafter; the current fetch path resolves the repo and filename automatically from the Gemma-4 family + size.Common Patterns
Serve any GGUF (non-Gemma-4)
Plain serving works for every fine-tuned model. A non-Gemma family falls back to plain serving with a clear message.Serve from a model directory
Point at a directory and the target GGUF is auto-detected (drafter files are skipped).Benchmark before you ship
--benchmark prints raw tokens/sec and (for Gemma-4) draft acceptance in one line — confirm the MTP win on your box before flipping traffic over.
Talk to it from praisonaiagents
Any Agent that already speaks OpenAI works — point base_url at http://<host>:<port>/v1.
Supported models
Only Gemma-4 ships a stock MTP drafter. Verified mapping (from_mtp.py):
The drafter precision is
Q8_0 by default; bf16 and f16 variants resolve to BF16 / F16 filenames.
Non-Gemma models (Llama / Qwen / Mistral / Phi / DeepSeek) do not ship MTP drafters. serve --gguf still works on them — just without the speculative-decoding pathway. Do not expect a 1.4× on a Qwen fine-tune.
Field notes
Old GGUF converters may be incompatible. A
q4_K_M GGUF exported by an older converter may be tensor-incompatible with current llama.cpp. Re-export from merged weights with an up-to-date converter before serving.llama.cpp is required at runtime. The
serve path shells out to llama-server (auto-discovered via find_llama_binary(), or set LLAMA_CPP_BIN). Grab a build from llama.cpp releases — Homebrew, apt, or a manual cmake -B build && cmake --build build all work. MTP needs the --spec-type draft-mtp support from ggml-org/llama.cpp#25148.“Lossless” means bitwise-identical. MTP only changes how the tokens are produced (draft + verify), not which tokens — a served GGUF returns the same output as plain serving. The 1.4× figure above is measured on the HF-Transformers path; the llama.cpp path lights up as its Gemma-4 support matures.
Best Practices
Serve first, benchmark second, ship third
Serve first, benchmark second, ship third
--benchmark catches drafter compatibility and llama.cpp version drift before real traffic hits the endpoint. Run it once on your box, confirm the tok/s and draft-acceptance line, then serve.Keep MTP opt-in on export
Keep MTP opt-in on export
--mtp-draft on export adds a ~95 MB artifact next to your GGUF. Leave it off for size-constrained deploys — you can always fetch the drafter later by serving with --mtp-draft (the default).Match the drafter's quantization to your compute budget
Match the drafter's quantization to your compute budget
The default
Q8_0 drafter fits comfortably on CPU inference. For edge devices, consider a smaller variant if a matching one is published upstream.Non-Gemma-4? Plain serve is still useful
Non-Gemma-4? Plain serve is still useful
Any GGUF from
praisonai-train export gguf can be served by this command — MTP is the bonus, not the point. A non-Gemma family falls back to plain serving with a clear message.Related
Train
Training overview and fine-tuning setup.
Train CLI
Full flag reference for every subcommand.
praisonai-train Package
The standalone package guide.
Speed Benchmark
Rank deployments by generation speed (distinct from
serve --benchmark).Multi-GPU Training
Fine-tune across multiple GPUs with torchrun.
Installation Extras
The train install matrix.

