sglang plugin
Browse files
plugins/pyproject.toml
CHANGED
|
@@ -5,16 +5,10 @@ build-backend = "setuptools.build_meta"
|
|
| 5 |
[project]
|
| 6 |
name = "glm5v-serve"
|
| 7 |
version = "0.1.0"
|
| 8 |
-
description = "Serve GLM-5.2-Vision (GLM-5.2 text + MoonViT vision + PatchMerger projector) on
|
| 9 |
readme = "README.md"
|
| 10 |
requires-python = ">=3.10"
|
| 11 |
license = { text = "Apache-2.0" }
|
| 12 |
|
| 13 |
-
# vLLM discovers plugins through this entry-point group and calls them during
|
| 14 |
-
# engine init — so `pip install glm5v-serve` is all that stands between a stock
|
| 15 |
-
# `vllm serve baseten/GLM-5.2-Vision-FP8` and a working VLM. No flags, no patches.
|
| 16 |
-
[project.entry-points."vllm.general_plugins"]
|
| 17 |
-
glm5v = "vllm_glm5v.register:register"
|
| 18 |
-
|
| 19 |
[tool.setuptools]
|
| 20 |
-
packages = ["
|
|
|
|
| 5 |
[project]
|
| 6 |
name = "glm5v-serve"
|
| 7 |
version = "0.1.0"
|
| 8 |
+
description = "Serve GLM-5.2-Vision (GLM-5.2 text + MoonViT vision + PatchMerger projector) on SGLang"
|
| 9 |
readme = "README.md"
|
| 10 |
requires-python = ">=3.10"
|
| 11 |
license = { text = "Apache-2.0" }
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
[tool.setuptools]
|
| 14 |
+
packages = ["sglang_glm5v"]
|
plugins/sglang_glm5v/glm5v.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
| 2 |
"""glm5v on SGLang: MoonViT (Kimi-K2.5) vision tower + trained PatchMerger
|
| 3 |
projector + GLM-5.2 (GlmMoeDsa) text decoder.
|
| 4 |
|
| 5 |
-
|
| 6 |
-
``KimiK25ForConditionalGeneration`` with the same three swaps we made on vLLM:
|
| 7 |
|
| 8 |
1. text backbone ``DeepseekV3ForCausalLM`` -> ``GlmMoeDsaForCausalLM``
|
| 9 |
(GLM-5.2; SGLang ships it natively in ``glm4_moe.py``, DSA path included).
|
|
|
|
| 2 |
"""glm5v on SGLang: MoonViT (Kimi-K2.5) vision tower + trained PatchMerger
|
| 3 |
projector + GLM-5.2 (GlmMoeDsa) text decoder.
|
| 4 |
|
| 5 |
+
It is SGLang's in-tree ``KimiK25ForConditionalGeneration`` with three swaps:
|
|
|
|
| 6 |
|
| 7 |
1. text backbone ``DeepseekV3ForCausalLM`` -> ``GlmMoeDsaForCausalLM``
|
| 8 |
(GLM-5.2; SGLang ships it natively in ``glm4_moe.py``, DSA path included).
|
plugins/sglang_glm5v/processor.py
CHANGED
|
@@ -6,7 +6,7 @@ placeholder: ``<|image|>`` (id from ``config.media_placeholder_token_id``,
|
|
| 6 |
154854) instead of Kimi's ``<|media_pad|>``. The GLM chat template
|
| 7 |
(``chat_template.jinja`` in the assembled checkpoint) wraps each image as
|
| 8 |
``<|begin_of_image|><|image|><|end_of_image|>``; only the inner ``<|image|>``
|
| 9 |
-
run is expanded to per-patch tokens
|
| 10 |
|
| 11 |
All preprocessing (NaViT resize math, GPU patchify, grid_thw handling) is
|
| 12 |
inherited unchanged — it is the same MoonViT pipeline the projector was
|
|
|
|
| 6 |
154854) instead of Kimi's ``<|media_pad|>``. The GLM chat template
|
| 7 |
(``chat_template.jinja`` in the assembled checkpoint) wraps each image as
|
| 8 |
``<|begin_of_image|><|image|><|end_of_image|>``; only the inner ``<|image|>``
|
| 9 |
+
run is expanded to per-patch tokens.
|
| 10 |
|
| 11 |
All preprocessing (NaViT resize math, GPU patchify, grid_thw handling) is
|
| 12 |
inherited unchanged — it is the same MoonViT pipeline the projector was
|