Skip to main content
Mini-SGLang provides an OpenAI-compatible API server that allows you to deploy large language models and integrate them with existing tools and clients.

Launching the API Server

1

Start the server

Launch the API server with a single command. The server will be available on port 1919 by default.
To use a custom port:
2

Wait for server initialization

The server will download the model (if not already cached) and compile necessary kernels. You should see output indicating the server is ready:
3

Verify the server is running

Check available models:
Expected output:

Sending Requests

Chat Completions

The /v1/chat/completions endpoint accepts OpenAI-compatible requests:

Supported Parameters

string
required
Model identifier (must match the deployed model)
array
required
Array of message objects with role and content fields
integer
default:"16"
Maximum number of tokens to generate
float
default:"1.0"
Sampling temperature (higher values = more random)
integer
default:"-1"
Top-k sampling parameter
float
default:"1.0"
Nucleus sampling parameter
boolean
default:"false"
Enable streaming responses

Response Format

Streaming responses return Server-Sent Events (SSE) with the following format:

OpenAI Client Compatibility

You can use the official OpenAI Python client to interact with Mini-SGLang:

Server Configuration

Custom Host and Port

Using ModelScope

If you have network issues with HuggingFace, use ModelScope as the model source:
For production deployments with multiple GPUs, see the Distributed Serving guide.