← Back to Leaderboard
Msgl-project

sgl-project/mini-sglang

Compact SGLang engine for studying and self-hosting GPU LLM inference

View on GitHub ↗
Engineering Health (Methodology)
B · 55/100
Maintenance Activity
● Updated 6mo ago
Latest Release
Rolling commits (main)
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance6/35
Fork Adoption23/25
Release Cadence6/20
License Clarity20/20
DockerSelf-HostedLocal AICLIGPUAPI
Total Stars
★ 5,706
24h Growth
+2
7d Growth
+47
Forks
1,018

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

sgl-project/mini-sglang Star History (2025-10-12 - 2026-12-04) ALL-TIME STAR HISTORY (2025-10 – 2026-12) +5.7k in 418d · avg +14/day 6k 3k 0 2025-10-12: ★ 12025-11-08: ★ 12025-12-06: ★ 22026-01-03: ★ 2,6902026-01-31: ★ 3,2002026-02-28: ★ 3,5162026-03-28: ★ 3,7512026-04-25: ★ 4,0242026-05-23: ★ 4,2082026-06-20: ★ 4,3852026-07-18: ★ 4,5582026-08-15: ★ 4,7162026-09-12: ★ 5,0052026-10-10: ★ 5,2302026-11-05: ★ 5,5122026-12-04: ★ 5,706 ★ 5.7k 2025-10 2026-05 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Mini-SGLang is a compact SGLang implementation of roughly 5,000 lines of Python. The python -m minisgl entrypoint supports both an OpenAI-compatible API server and a terminal chat shell. The execution design combines prefix KV lookup and reuse through Radix Cache, chunked prompt prefill, and overlap between CPU scheduling and GPU work. Tensor parallelism distributes model execution across GPUs when enabled.

The minisgl package depends on PyTorch <2.10.0 and Transformers >=4.56.0,<=4.57.3, and integrates FlashAttention and FlashInfer. The Python layer makes the scheduling and caching logic easier to inspect, but GPU execution still depends on native CUDA kernels. The OpenAI-compatible API is the client integration boundary; compatibility should be tested against the calls an application actually makes.

Key Capabilities & Differentiators

The examples cover Qwen3-0.6B on one GPU and Llama-3.1-70B-Instruct with --tp 4. Radix Cache targets traffic with repeated prefixes, while chunked prefill lowers peak memory pressure from processing long prompts without removing the need to hold active KV state. The interactive shell supports /reset, and --model-source modelscope provides an alternate download path when Hugging Face is hard to reach.

The offline benchmark runs 256 sequences on one H200 with Qwen3-0.6B and Qwen3-14B, sampling input and output lengths between 100 and 1,024 tokens. The online benchmark replays the first 1,000 Qwen trace requests against Qwen3-32B on four NVLink-connected H200s. That comparison uses --cache naive for Mini-SGLang and --disable-radix for SGLang, so it is not a test of the benefit of radix prefix reuse. The configurations establish test scope, not performance on other hardware or traffic.

Trade-offs & Limitations

Mini-SGLang is a better fit than full SGLang when the goal is to trace or modify scheduling, prefill, and cache code. It is not a drop-in substitute just because both expose similar serving concepts. Evaluate full SGLang when broader serving functionality matters, and verify API coverage and behavior under load before selecting either engine. The benchmark configurations are useful starting points, but they do not establish production readiness or a general throughput or latency advantage.

Compared with the OpenAI API, self-hosting gives you control over model selection and where inference runs, but shifts GPU capacity planning, driver compatibility, and service operations to your team. VRAM depends on weights and active KV state, so size against realistic context lengths and concurrency. Tensor parallelism adds inter-GPU communication, making topology relevant. The engine is MIT-licensed; model weights and third-party dependencies have separate terms.

Hardware & Deployment Guide

Use Linux on x86_64 or aarch64 with an NVIDIA GPU, Python 3.10 or newer, and a CUDA Toolkit compatible with the NVIDIA driver for JIT-compiled kernels. Source installation uses uv pip install -e . inside a virtual environment; python -m minisgl --model Qwen/Qwen3-0.6B starts the server, and --shell switches to local terminal interaction. Windows users can use WSL2 with CUDA GPU support; native Windows and macOS are not supported.

The Dockerfile defaults to CUDA 12.8.1, Ubuntu 24.04, and Python 3.12. Build with docker build -t minisgl ., run with NVIDIA Container Toolkit and --gpus all, and publish 1919:1919 for the example that binds to 0.0.0.0. Mount /app/.cache/huggingface, /app/.cache/tvm-ffi, and /app/.cache/flashinfer to retain caches between runs. Package metadata marks version 0.1.0 as alpha, with no published GitHub release listed; pin a tested commit and record the working driver and dependency versions.

Implementation: The minisgl CLI exposes OpenAI-compatible serving and interactive --shell mode.
Prefix reuse: Radix Cache shares KV state across requests with common prefixes; --cache naive provides a comparison configuration.
Execution: Chunked prefill limits peak prefill memory pressure, and overlap scheduling runs CPU scheduling alongside GPU computation.
GPU scaling: --tp selects tensor parallelism across GPUs, with FlashAttention and FlashInfer integrated as optimized kernels.
Benchmarking: Offline and online scripts are separate; MINISGL_DISABLE_OVERLAP_SCHEDULING=1 supports an offline scheduling ablation.
Container deployment: The Docker build defaults to CUDA 12.8.1, Ubuntu 24.04, and Python 3.12, with separate cache mounts for Hugging Face, TVM FFI, and FlashInfer.
Best For

CUDA-equipped teams studying serving internals, testing scheduling and KV-cache changes, or prototyping a self-hosted API with Qwen or Llama models.

Skip If

You need native macOS or Windows support, have no NVIDIA CUDA environment, or require a managed or production-ready service without owning compatibility and load testing.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedLocal AICLI
# Create a virtual environment (Python 3.10+ recommended)
uv venv --python=3.12
source .venv/bin/activate

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
mini-sglang ★5.7k+47PythonMITCompact SGLang engine for studying and self-hosting GPU LLM inference
OmniRoute92.2k+1.4kTypeScriptMITSelf-hosted OpenAI-compatible gateway for multi-provider routing and fallback
ollama189.1k+741GoMITGo-based LLM serving layer for local model management and inference
nano-vllm16.7k+95PythonMITA compact vLLM-style Python engine for offline GPU batch inference

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/sgl-project/mini-sglang.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

sgl-project/mini-sglang Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about mini-sglang

How do I connect an existing OpenAI-compatible client?

Run python -m minisgl --model Qwen/Qwen3-0.6B on a supported CUDA host, then point your OpenAI-compatible client at the local server. Verify the endpoints and request options your client uses before switching: API compatibility does not imply access to OpenAI-hosted models or full feature parity. For terminal-only testing, add --shell.

What GPU and VRAM budget should I plan for?

Use Qwen3-0.6B as the documented single-GPU starting point. Size larger deployments for model weights, the KV cache at your target context length and concurrency, and runtime headroom for PyTorch and CUDA. A 16 GB GPU is not a blanket fit guarantee. Tensor parallelism can spread work across GPUs, but the online benchmark used four NVLink-connected H200s; measure your own topology rather than assuming similar scaling.

Can we use Mini-SGLang in a commercial self-hosted service?

Yes. The MIT license permits commercial use; retain the copyright and license notices when distributing copies or substantial portions. Check model-weight terms and dependency licenses separately. Self-hosting also makes your team responsible for access control, request logging, and data retention.

When should I choose Mini-SGLang over full SGLang or the OpenAI API?

Choose Mini-SGLang when you want a compact implementation you can read or modify, especially for scheduler and KV-cache experiments. Evaluate full SGLang when you need broader serving functionality, and compare the two with matched cache settings, models, and traffic. Choose the OpenAI API when avoiding GPU operations matters more than controlling the serving runtime, and its hosted models meet your requirements.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining sgl-project/mini-sglang? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature sgl-project/mini-sglang on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare