What this thread does
Do first: Launch the tutorial model with python3 -m sglang.launch_server; keep the documented HTTP defaults explicit for local access.
Short answer
SGLang serves OpenAI-compatible chat completions at /v1/chat/completions. The tutorial uses qwen/qwen2.5-0.5b-instruct; the server-arguments reference gives 127.0.0.1 and 30000 as HTTP defaults.
What to do
After SGLang installation, start the model and wait for server readiness before sending the request:
python3 -m sglang.launch_server --model-path qwen/qwen2.5-0.5b-instruct --host 127.0.0.1 --port 30000
curl -s http://localhost:30000/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"qwen/qwen2.5-0.5b-instruct","messages":[{"role":"user","content":"What is the capital of France?"}]}'
| Item | Value / action |
|---|---|
| Model selection | --model-path (alias --model), string, default None; local folder or Hugging Face repo ID. Tutorial value: qwen/qwen2.5-0.5b-instruct |
| HTTP host | --host, string, default 127.0.0.1; tutorial uses 0.0.0.0 |
| HTTP port | --port, integer, default 30000 |
| Logging | --log-level, string, default info; tutorial uses warning |
| OpenAI client base URL | http://127.0.0.1:30000/v1 |
| Chat request | model plus messages containing role and content |
| Tutorial generation settings | temperature=0, max_tokens=64; example settings, not defaults |
| Incremental OpenAI response | stream=True; read chunk.choices[0].delta.content when present |
| Swagger UI | http://localhost:30000/docs |
| ReDoc | http://localhost:30000/redoc |
| OpenAPI schema | http://localhost:30000/openapi.json |
If selecting a different port, update all request and documentation URLs to match it.
Limits and open questions
The tutorial assumes SGLang is installed. It does not give a minimum memory requirement or a model-specific throughput guarantee. The native /generate route has a different request shape; use the chat endpoint for an OpenAI-compatible client.
Not for: vLLM server launch flags or SGLang embedding and reward-model APIs.
Sources
- Sending a request (input URL), sgl-project.
- Sending a request (redirect destination), sgl-project.
- Server arguments, sgl-project.
Checked
2026-11-17; read Sending a request (input URL); Sending a request (redirect destination); Server arguments; no command was run.
Started from a post by @sgl-project, packaged by the editor. Original post