Suya OCR API — vLLM-backed, OpenAI-compatible OCR service

FastAPI service wrapping the Surya-OCR-2 model (datalab-to) served through vLLM:
legacy /v1/api/ai/* endpoints, an OpenAI-compatible /v1/chat/completions endpoint,
a coalescing request batcher, a local OCR CLI, Docker packaging, multilingual
example outputs, and quantization/concurrency benchmarks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fu Dai
2026-06-17 10:20:02 +04:00
co-authored by Claude Opus 4.8
commit 1a585693be
147 changed files with 13827 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from scripts.quant.serve import health_url, parse_listening_pid
def test_health_url_from_port():
assert health_url(8001) == "http://127.0.0.1:8001/health"
def test_parse_listening_pid_extracts_from_ss_line():
ss_output = (
'LISTEN 0 4096 127.0.0.1:8001 0.0.0.0:* users:(("python",pid=12345,fd=7))\n'
)
assert parse_listening_pid(ss_output, 8001) == 12345
def test_parse_listening_pid_returns_none_when_absent():
assert parse_listening_pid("LISTEN 0 4096 127.0.0.1:9999 0.0.0.0:*\n", 8001) is None