explaingit

efschu/htsglang

Analysis updated 2026-05-18

2PythonAudience · developerComplexity · 5/5Setup · hard

TLDR

A fork of sglang that lets a large AI model be split unevenly across mismatched GPUs and adds GGUF loading with speculative decoding for Qwen3.5/3.6 models.

Mindmap

mindmap
  root((htsglang))
    What it does
      Uneven GPU model splitting
      GGUF loading for Qwen models
      Speculative decoding
    Tech stack
      Python
      sglang
      GGUF
      Docker
    Use cases
      Mismatched GPU serving
      Multi rank GPU sharing
      Compressed model loading
    Audience
      ML infrastructure engineers
      Model serving developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run a large language model split proportionally across GPUs that have different amounts of memory.

USE CASE 2

Co-locate multiple model shards on a single physical GPU when there is spare memory.

USE CASE 3

Load a Qwen3.5 or Qwen3.6 model from a compressed GGUF file, which upstream sglang cannot do.

USE CASE 4

Deploy the server quickly using one of the two prebuilt Docker images instead of building from source.

What is it built with?

PythonsglangGGUFDockerNCCL

How does it compare?

efschu/htsglang0-bingwu-0/live-interpreter0cm-labs/tokenizer-benchmark
Stars222
LanguagePythonPythonPython
Setup difficultyhardmoderatemoderate
Complexity5/52/52/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires multiple GPUs, CUDA, and NCCL 2.30 or newer, prebuilt Docker images are provided to simplify setup.

The README does not state a license for this fork's own changes.

In plain English

htsglang is a modified version of an existing project called sglang, which is a serving system that runs large AI language models so they can answer requests quickly. This fork focuses on one specific hard problem: making a language model run efficiently when it is split across graphics cards, called GPUs, that do not all have the same amount of memory, or when more than one slice of the model shares a single physical GPU. Normally, when a large model is split across several GPUs to share the work, each GPU is given an equal sized piece of the model. That works fine if every GPU is identical, but it wastes the extra memory on a bigger card if the cards do not match. This project's main feature lets the model be split unevenly instead, giving a bigger slice of the model to a GPU with more memory and a smaller slice to a GPU with less, calculated automatically based on how much free memory each card actually reports. This uneven splitting is applied carefully across every part of the model that needs to be divided, including its attention mechanism and its memory cache for ongoing conversations. A related feature lets a user explicitly choose which physical GPU each piece of the split model runs on, including letting two pieces share the same card if there is room. The project also adds support for loading a particular family of models, called Qwen3.5 and Qwen3.6, from a compressed file format called GGUF, something the original sglang project cannot do for these particular models. Loading these compressed files correctly requires undoing several changes a conversion tool makes to the internal structure of the model, which this fork handles automatically. It also supports a speed up technique called speculative decoding using a smaller draft model bundled inside the same GGUF file, and it supports a tiered memory cache system that can spill older cached data out to system memory and disk instead of losing it. The project ships two ready made Docker container images so a user does not need to build anything from source, and it includes example commands for launching a model server with these features enabled. The project is written in Python and builds on top of the original sglang project.

Copy-paste prompts

Prompt 1
Help me launch this server with uneven tensor parallelism across GPUs of different memory sizes.
Prompt 2
Explain how the --rank-tp-ratio auto flag decides how much of the model each GPU gets.
Prompt 3
Walk me through running the prebuilt Docker image to serve a Qwen3.6 GGUF model with speculative decoding.
Prompt 4
Show me how to pin specific model shards to specific physical GPUs using --rank-gpu-id.
Prompt 5
Help me enable the hierarchical KV cache so evicted data spills to disk instead of being lost.

Frequently asked questions

What is htsglang?

A fork of sglang that lets a large AI model be split unevenly across mismatched GPUs and adds GGUF loading with speculative decoding for Qwen3.5/3.6 models.

What language is htsglang written in?

Mainly Python. The stack also includes Python, sglang, GGUF.

What license does htsglang use?

The README does not state a license for this fork's own changes.

How hard is htsglang to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is htsglang for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.