Skip to main content
Use SGLang for ultra-low latency, high-throughput production serving with many concurrent requests.
SGLang requires a CUDA-compatible GPU. For CPU-only environments, consider using llama.cpp instead.

Supported Models

All LFM model types are supported as of SGLang v0.5.10.

Installation

Install SGLang following the official installation guide. The recommended method is (requires sglang>=0.5.10):

Launching the Server

By default the model runs in bfloat16. To use float16 instead, add --dtype float16 and set export SGLANG_MAMBA_CONV_DTYPE=float16 before launching.

Usage

SGLang exposes an OpenAI-compatible API.
For more details on tool use with LFM models, see Tool Use.

Vision Models

Launch a vision-language model:
Query with an image:

Offline Inference

SGLang’s Engine class provides a simple interface for offline inference without launching a server. This is useful for scripts, notebooks, and batch processing.
In Jupyter notebooks, you must apply nest_asyncio before creating the engine, because SGLang uses an async event loop internally.

Text Generation

Vision Models

Low Latency on Blackwell (B300)

Running a 1.2B model on a B300 may sound counterintuitive, but combining --enable-torch-compile with Blackwell’s architecture unlocks extremely low latency — ideal for latency-sensitive workloads like RAG, search, and real-time chat.
We recommend --enable-torch-compile for workloads with concurrency under 256. For pure throughput batch processing at very high concurrency, skip this flag.
Key flags for low latency:
  • --enable-torch-compile: Compiles the model with Torch for faster execution. Adds startup time but significantly reduces per-token latency.
  • --chunked-prefill-size -1: Disables chunked prefill, processing the full prompt in one pass. This lowers TTFT at the cost of slightly reduced throughput under high concurrency.
On B300/CUDA 13, use the dedicated Docker image:
Example benchmark on a B300 GPU with CUDA 13 (256 prompts, 1024 input tokens, 128 output tokens, max concurrency 1):