LPCompact for vLLM
This integration serves the LPCompact text models on NVIDIA GPUs. It pins the
served checkpoint and downloads the selector directly from Hugging Face.
Serving uses BF16 compute and KV. For an offline deployment, prewarm the base checkpoint's
Hugging Face cache and LatentPort's selector cache under
LATENTPORT_HOME/huggingface, or supply --lpcompact-weights-path with the pinned
selector file.
Build from the repository root with vLLM 0.34.0's upstream image.
docker build -f integrations/vllm/Dockerfile -t latentport-vllm:dev .
docker run --gpus all --ipc=host -p 8000:8000 latentport-vllm:dev \
serve Qwen/Qwen3.8-27B \
--lpcompact latentport/LPCompact-Qwen3.8-27B --lpcompact-ratio 8
For Flash-Next on a single RTX PRO 6000, the launcher can use the pinned Inferact NVFP4 checkpoint with disk-backed embedding lookups. Put the Hugging Face cache on fast local NVMe and mount it into the container.
docker run --gpus all --ipc=host -p 8000:8000 \
-e LATENTPORT_HOME=/root/.cache \
-v /path/to/huggingface:/root/.cache/huggingface latentport-vllm:dev \
serve Inferact/Qwen3.8-Flash-Next-NVFP4 \
--lpcompact latentport/LPCompact-Qwen3.8-Flash-Next
The same selector is used with the Qwen/Qwen3.8-Flash-Next BF16 profile. Its full
checkpoint needs substantially more memory and still requires full-weight
qualification. See the
vLLM hardware recipe for
tested base-model hardware combinations.
Install in an existing vLLM environment
In a dedicated Linux environment with vLLM 0.34.0 and its CUDA dependencies installed, install the adapter from this checkout and apply its bundled patch once.
python -m pip install ./integrations/vllm
vllm_site="$(python -c 'import importlib.util; from pathlib import Path; print(Path(importlib.util.find_spec("vllm").origin).parent.parent)')"
patch="$(python -c 'from importlib.resources import files; print(files("latentport_vllm") / "patches" / "vllm-0.34.0.patch")')"
(cd "$vllm_site" && git apply --check "$patch" && git apply "$patch")
latentport-vllm serve Qwen/Qwen3.8-27B --lpcompact latentport/LPCompact-Qwen3.8-27B
NF4 and GGUF weights
Use --weight-format bf16 for the default Hugging Face weights. Install the
NF4 extra in the same environment to quantize those pinned weights on load.
NF4 uses one GPU rank per model replica.
python -m pip install './integrations/vllm[nf4]'
latentport-vllm serve Qwen/Qwen3.8-27B --weight-format nf4 \
--lpcompact latentport/LPCompact-Qwen3.8-27B
For GGUF, install the pinned vLLM GGUF plugin with a CUDA toolkit that matches
the vLLM environment. The launcher selects the pinned GGUF file for the base
model and uses the base model's pinned config and tokenizer. For a local copy,
pass --gguf-path with the original filename of the first part. Keep all parts
in the same directory.
python -m pip install './integrations/vllm[gguf]' 'setuptools>=77,<81' wheel ninja
python -m pip install --no-build-isolation --no-deps \
'vllm-gguf-plugin @ git+https://github.com/vllm-project/vllm-gguf-plugin.git@497542d12327a67f806345438238ea702cadd824'
latentport-vllm serve Qwen/Qwen3.8-27B --weight-format gguf \
--lpcompact latentport/LPCompact-Qwen3.8-27B
All formats use the same BF16 KV cache and published selector. Flash-Next stages n-gram rows from disk in NF4 and GGUF mode. Quantized profiles are experimental and have not been qualified on GPU for this update.
Model profiles
Use a base model and its selector from the same row. Every row accepts
bf16, nf4, and gguf.
| Base checkpoint | Hugging Face selector | Pinned GGUF format | Default trigger |
|---|---|---|---|
Qwen/Qwen3.5-4B |
latentport/LPCompact-Qwen3.5-4B |
Q4_K_M | 65,536 |
Qwen/Qwen3.5-9B |
latentport/LPCompact-Qwen3.5-9B |
Q4_K_M | 65,536 |
Qwen/Qwen3-14B |
latentport/LPCompact-Qwen3-14B |
Q4_K_M | 32,768 |
Qwen/Qwen3.6-35B-A3B |
latentport/LPCompact-Qwen3.6-35B-A3B |
UD-Q4_K_M | 65,536 |
Qwen/Qwen3.8-27B |
latentport/LPCompact-Qwen3.8-27B |
Q4_K_M | 65,536 |
Qwen/Qwen3.8-Flash-Next |
latentport/LPCompact-Qwen3.8-Flash-Next |
Q2_K | 65,536 |
google/gemma-4-31B-it |
latentport/LPCompact-Gemma-4-31B-it |
Q4_K_M | 65,536 |
The launcher limits Qwen3-14B to its native 40,960 positions by default. Gemma 4 compacts its global attention layers and keeps its sliding-window cache on the logical token timeline.
The launcher selects eager, synchronous, text-only serving with hybrid cache
management enabled. Startup checks require BF16 cache, no automatic prefix
caching, and sufficient pages for the configured maximum sequence length,
concurrency, and one staged compaction. Lower --max-num-seqs or
--max-model-len if the configuration exceeds cache capacity. The trigger
and supported 4×/8× ratios follow each selector's manifest.
Each committed event logs the artifact and its revision, the logical token count, attention rows before and after, elapsed time, and net pages returned to the vLLM pool. The attention-row ratio describes the request's attention cache. GPU allocation also includes weights, recurrent state, and the remaining cache pool.
The shared scheduler transaction handles capacity and page ownership. The worker selects the model-specific cache views from the pinned profile. Flash-Next compacts whole QSA groups, moving the compressed index and K/V together while leaving the raw-key ring and recurrent state in place.
Use tests/gpu_smoke.py against a local test server to check generated tokens,
prompt accounting, and allocator page reclamation. On a single RTX PRO 6000
Blackwell Server Edition with --max-num-batched-tokens 2048, the real-weight
8× smoke runs observed:
| Checkpoint | Attention rows | Allocator pages reclaimed | Generated after compaction |
|---|---|---|---|
| Qwen3.5-4B BF16 | 65,536 → 8,192 | 99 | 16 tokens |
| Qwen3.5-9B BF16 | 65,536 → 8,192 | 99 | 16 tokens |
| Qwen3-14B BF16 | 32,768 → 4,096 | 448 | 16 tokens |
| Qwen3.6-35B-A3B BF16 | 65,536 → 8,192 | 53 | 16 tokens |
| Qwen3.8-27B BF16 | 131,072 → 16,384 | 138 | 16 tokens |
| Flash-Next NVFP4 | 65,536 → 8,192 | 35 | 16 tokens |
| Gemma 4 31B IT BF16 | 65,536 → 8,192 | 448 | 16 tokens |
With the default prefill batch size on that GPU, Qwen3.6-35B-A3B also passed at 8×. Gemma 4 served a 114,707-token prompt, compacted twice at 4×, returned 384 pages to the allocator each time, and generated 16 tokens.
The Flash-Next fixture also exercised repeated compaction and an incomplete four-token QSA group with the real GPU cache kernels and dummy weights.
Two synthetic archive lookups per checkpoint used identical 65,552-token prompts and greedy decoding in dense and compacted serving. The record appeared near the beginning or the middle of the archive.
| Checkpoint | Exact answers dense / 8× | Median first-token latency dense / 8× |
|---|---|---|
| Qwen3.8-27B BF16 | 2/2 / 2/2 | 12.24 s / 12.31 s |
| Flash-Next NVFP4 | 2/2 / 2/2 | 5.65 s / 5.49 s |
These two-prompt runs check continuation and report the observed latency for that workload.
Profiles use the core model and selector catalog for checkpoint identity, feature layers, KV head count, and positions. A new cache layout needs a worker binding for its attention and auxiliary cache views.
Metadata
Release files for latentport-vllm 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| latentport_vllm-0.1.1.tar.gz | 34.2 kB | Without provenance | Details for latentport_vllm-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| latentport_vllm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for latentport_vllm-0.1.1-py3-none-any.whl |
Total release size: 65.6 kB
Release files / latentport_vllm-0.1.1.tar.gz
| Download URL | latentport_vllm-0.1.1.tar.gz |
|---|---|
| Size | 34.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d29058e316d3a17a5c848e38121ec19c8e7215a3ada6e3def7190c5308b4db8
|
|
BLAKE2b-256 checksum How to use checksums |
79aaaae4287b2e46eaa310e5b0d6835cf349412f536e7ec47d1f437634c2eae4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / latentport_vllm-0.1.1-py3-none-any.whl
| Download URL | latentport_vllm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d94714624b96d4c8b57458da11869e2ee906f4126d84230d4cb4e9c7faac7cf
|
|
BLAKE2b-256 checksum How to use checksums |
b110d50ed7650c0acb620e18e0889b7ada7fdcfd0778fa63c425d776f16d890f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Security for latentport-vllm 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.