Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

perf(server): use SGLang's fast image processor for GLM-OCR (#678)

svonava2d2090d097a2
diff --git a/packages/sie_server/models/zai-org__GLM-OCR.yaml b/packages/sie_server/models/zai-org__GLM-OCR.yaml
index 3a463ccf0..3098428c5 100644
--- a/packages/sie_server/models/zai-org__GLM-OCR.yaml
+++ b/packages/sie_server/models/zai-org__GLM-OCR.yaml
@@ -30,9 +30,9 @@ profiles:
mem_fraction_static: 0.85
served_model_name: zai-org/GLM-OCR
max_concurrent_requests: 64
- processor_use_fast: false
- extra_launch_args:
- - --disable-fast-image-processor
+ # SGLang's default fast (torch) image processor. The slow PIL processor runs
+ # single-threaded in SGLang's tokenizer process and capped throughput on a
+ # 4-vCPU lane.
default_prompt: "Text Recognition:"
runtime:
max_new_tokens: 8192
diff --git a/packages/sie_server/tests/config/test_sglang_ocr_image_processor.py b/packages/sie_server/tests/config/test_sglang_ocr_image_processor.py
new file mode 100644
index 000000000..6232398e2
--- /dev/null
+++ b/packages/sie_server/tests/config/test_sglang_ocr_image_processor.py
@@ -0,0 +1,15 @@
+"""GLM-OCR's SGLang profile keeps SGLang's fast image processor."""
+
+from pathlib import Path
+
+import yaml
+
+_CONFIG = Path(__file__).resolve().parents[2] / "models" / "zai-org__GLM-OCR.yaml"
+
+
+def test_glm_ocr_default_profile_uses_the_fast_image_processor() -> None:
+ default = yaml.safe_load(_CONFIG.read_text())["profiles"]["default"]
+ assert default["adapter_path"].endswith(":SGLangVisionExtractAdapter")
+ loadtime = default["adapter_options"]["loadtime"]
+ assert "--disable-fast-image-processor" not in loadtime.get("extra_launch_args", [])
+ assert "processor_use_fast" not in loadtime