# Surogate Engine

Source: https://docs.surogate.ai/engine/

Surogate Engine trains and serves language models on your own NVIDIA GPUs. It is written in C++ and CUDA, so one tool takes you from a first fine-tune on a single card to a model answering many people at once, in BF16, FP8, NVFP4 or GGUF.

You describe a run in one YAML file and start it with one command, such as `surogate sft config.yaml`. The same engine then serves the result behind an OpenAI-compatible API.

## Start here

| You want to | Start with |
|---|---|
| Install it and check your GPU | [Installation](/engine/getting-started/installation/), then [Compatibility](/engine/appendix/compatibility/) |
| Pick the right kind of training | [Training modes](/engine/getting-started/training-modes/): SFT, pretraining, DPO, GRPO and distillation side by side |
| Teach a model new behaviour from examples | [Quickstart: SFT](/engine/getting-started/quickstart-sft/) |
| Teach a model to prefer better answers | [Quickstart: DPO](/engine/getting-started/quickstart-dpo/) |
| Train a model against a reward, with reinforcement learning | [Quickstart: GRPO](/engine/getting-started/quickstart-grpo/), then the [GRPO kits](/engine/examples/kits/) |
| Train a model from scratch | [Quickstart: pretraining](/engine/getting-started/quickstart-pretraining/) |
| Serve a model you trained | [Serving models](/engine/inference/serving-models/) |

## Learn by doing

The [GRPO kits](/engine/examples/kits/) are the fastest way to see what the engine does. Each kit teaches a small model (0.8B, or 2B for the two agents) one job on one GPU in about an hour or less, and scores the model before and after on questions it never trained on:

- [Countdown](/engine/examples/kits/countdown/): reach a target number with arithmetic, reasoning step by step.
- [Phone actions](/engine/examples/kits/phone/): turn a request into the right function calls.
- [Policy guard](/engine/examples/kits/guard/): decide whether a message breaks a written policy.
- [Document extraction](/engine/examples/kits/extract/): fill the JSON a schema asks for from a document.
- [MCP agent](/engine/examples/kits/mcp/): answer questions by calling the tools of an MCP server.
- [Pocket researcher](/engine/examples/kits/research/): answer questions by searching a private document collection.

For other models and methods, the [examples library](/engine/examples/) has ready configs for Qwen3 with LoRA and QLoRA, a Qwen3 MoE model, pretraining and GRPO, and the recipes cover DPO, distillation, serving and more.

## Find your way

| When you need to | Read |
|---|---|
| Write a config and prepare data | [Configuration](/engine/guides/configuration/), [Datasets](/engine/guides/datasets/) |
| Train with less memory | [LoRA and QLoRA](/engine/guides/qlora/), [Precision](/engine/guides/precision-and-recipes/), [Fit in memory](/engine/guides/memory/), [Offloading](/engine/guides/offloading/) |
| Go faster or bigger | [Speed](/engine/guides/performance/), [Multiple GPUs](/engine/guides/multi-gpu/), [Multiple machines](/engine/guides/multi-node/), [Pipeline parallelism](/engine/guides/dispatch-pp/) |
| Train special models | [Mixture-of-experts](/engine/guides/moe/), [Long context](/engine/guides/long-context/), [MiniCPM5 and Spark-X2.5](/engine/guides/minicpm5-spark/), [Distillation](/engine/guides/distillation/) |
| Do reinforcement learning | [GRPO training](/engine/guides/rl-training/), [Environments and rewards](/engine/guides/rl-environments/), [GRPO on one GPU](/engine/guides/rl-colocate/) |
| Watch a run and fix it | [Metrics](/engine/guides/metrics/), [Debugging](/engine/guides/debugging/) |
| Serve and call a model | [Inference](/engine/inference/), [Command line](/engine/inference/cli/), [OpenAI-compatible API](/engine/inference/api/) |
| Look up a setting | [Config options](/engine/reference/config/), [CLI](/engine/reference/cli/), [Python API](/engine/reference/python-api/) |
| Understand how it works inside | [How it works](/engine/about/how-it-works/), [the model DSL](/engine/about/dsl/), [automatic differentiation](/engine/about/automatic-differentiation/), [adaptive training](/engine/about/adaptive-training/) |
| Check a number or a word | [Benchmarks](/engine/reference/benchmarks/), [Glossary](/engine/appendix/glossary/), [FAQ](/engine/appendix/faq/), [Release notes](/engine/appendix/release-notes/) |

## All pages

The full list, in reading order.

### Getting started

- [Installation](/engine/getting-started/installation/)
- [Training Modes](/engine/getting-started/training-modes/)
- [Quickstart: Supervised Fine-Tuning (SFT)](/engine/getting-started/quickstart-sft/)
- [Quickstart: Pretraining (PT)](/engine/getting-started/quickstart-pretraining/)
- [Quickstart: RL Training (GRPO)](/engine/getting-started/quickstart-grpo/)
- [Quickstart: Preference Fine-Tuning (DPO)](/engine/getting-started/quickstart-dpo/)

### User guides

- [Configuration](/engine/guides/configuration/)
- [Datasets](/engine/guides/datasets/)
- [Precision & Recipes](/engine/guides/precision-and-recipes/)
- [Quantized LoRA (QLoRA)](/engine/guides/qlora/)
- [Optimizers](/engine/guides/optimizers/)
- [Memory](/engine/guides/memory/)
- [Offloading](/engine/guides/offloading/)
- [Performance](/engine/guides/performance/)
- [Multi-GPU Training](/engine/guides/multi-gpu/)
- [Multi-Node Training](/engine/guides/multi-node/)
- [Dispatch Pipeline Parallelism](/engine/guides/dispatch-pp/)
- [Long Context Training](/engine/guides/long-context/)
- [Mixture-of-Experts (MoE) Models](/engine/guides/moe/)
- [Fine-tuning MiniCPM5 and Spark-X2.5](/engine/guides/minicpm5-spark/)
- [Knowledge Distillation](/engine/guides/distillation/)
- [RL Training (GRPO)](/engine/guides/rl-training/)
- [RL Environments](/engine/guides/rl-environments/)
- [Single-GPU GRPO](/engine/guides/rl-colocate/)
- [Training Metrics & Monitoring](/engine/guides/metrics/)
- [Debugging Training Issues](/engine/guides/debugging/)

### Inference and serving

- [Overview](/engine/inference/)
- [Serving Models](/engine/inference/serving-models/)
- [Inference CLI](/engine/inference/cli/)
- [OpenAI-compatible API](/engine/inference/api/)

### Examples

- [Examples Library](/engine/examples/)
- [Qwen 3 Pre-training (PT)](/engine/examples/pt/qwen3/)
- [Qwen 3 LoRA Fine-Tuning (SFT)](/engine/examples/sft/qwen3-lora/)
- [Qwen 3 QLoRA Fine-Tuning](/engine/examples/sft/qwen3-qlora/)
- [Qwen 3 MoE Fine-Tuning](/engine/examples/sft/qwen3moe-lora/)
- [GRPO: Teach a Model to Reverse the Prompt](/engine/examples/grpo/grpo/)
- [GRPO Kits: One Model, One Job, One GPU](/engine/examples/kits/)
  - [Document Extraction](/engine/examples/kits/extract/)
  - [Phone Actions](/engine/examples/kits/phone/)
  - [Policy Guard](/engine/examples/kits/guard/)
  - [Countdown](/engine/examples/kits/countdown/)
  - [Pocket Researcher](/engine/examples/kits/research/)

### Technical reference

- [Configuration Reference](/engine/reference/config/)
- [CLI Reference](/engine/reference/cli/)
- [Python API](/engine/reference/python-api/)
- [Benchmarks](/engine/reference/benchmarks/)

### About

- [How Surogate Works](/engine/about/how-it-works/)
- [Python DSL](/engine/about/dsl/)
- [Automatic Differentiation](/engine/about/automatic-differentiation/)
- [Adaptive Training](/engine/about/adaptive-training/)

### Appendix

- [Compatibility](/engine/appendix/compatibility/)
- [FAQ](/engine/appendix/faq/)
- [Glossary](/engine/appendix/glossary/)
- [Release Notes](/engine/appendix/release-notes/)
