Scriptor
Scriptor, Latin for "scribe", is a server that reads scanned pages into text. Scriptor runs the GLM-OCR model on the NVIDIA DGX Spark, entirely on your own computer, and answers in the same way as the OpenAI API, so software you already use can send pages to Scriptor without changes.
Get Scriptor on GitHub Download the Latest Release See the Measured Speed
What Scriptor Is
Scriptor is our own engine for the GLM-OCR model, written from the ground up for the NVIDIA DGX Spark. Most people run GLM-OCR with vLLM, a general-purpose server made to run many models on many kinds of computer. Scriptor is made for one job on one computer: reading pages quickly.
- Speed
- About 1.92 times as many pages an hour as vLLM
- Pace
- About 5,600 pages an hour
- Same Text
- 97.69% of words recovered, the same as vLLM at 97.67%
What Scriptor Does
-
Reads Pages Into Text
Send a picture of a page and Scriptor returns the words on the page. Scriptor reads many pages at the same time and can send each answer back as the answer is written.
-
Works With Software You Already Have
Scriptor accepts the same requests as the OpenAI chat API and reports the same measurements as a vLLM server, so programs and dashboards built for either one keep working.
-
Stays on Your Computer
Scriptor uses only the model folder and the network address you name. Scriptor downloads nothing, looks for nothing, and sends your pages nowhere else.
-
Starts Clean Every Time
Scriptor prepares everything needed at each start and keeps the result in memory only, so nothing saved from an earlier run can go stale.
-
Protects the Computer
Scriptor checks that the model fits in memory before starting, watches memory while running, and turns new work away with a request to retry before the computer runs short.
-
Stops Safely
When asked to stop, Scriptor finishes the pages in progress first. After a hardware fault, Scriptor exits with a code that tells the supervising program whether a restart will help.
One Program for Pages and Documents
Scriptor is one program. A single command, scriptor serve, runs the engine that reads pages and the document bridge that reads whole documents together, in one process.
scriptor serve --model /path/to/glm-ocr
- Engine
- Answers in the same way as the OpenAI API, so software you already use can send pages to it. It listens on port 8002 by default.
- Document Bridge
- Takes PDFs and PNG, JPEG, and WebP images, finds the text regions on each page with the PP-DocLayoutV3 layout model, reads each region with the engine, and returns the assembled text on its own port, 8765 by default.
- Engine Alone
- Add --no-bridge to scriptor serve to run the engine without the document bridge.
- Bridge Alone
- scriptor bridge runs a document bridge against an engine running elsewhere, such as a vLLM server.
Scriptor Compared With vLLM
We read the same 15 public example documents, 368 pages in all, with Scriptor and with vLLM, again and again, on one NVIDIA DGX Spark, using the same model and the same settings. Total time and pages an hour were better in every one of the 10 runs, and start-up time was better in every one of the 9 runs measured after the first start. The other timings pool all 10 runs, so they have no run-by-run range; for every timing shown, the 95% confidence interval of the gain lies entirely beyond the 5% margin that counts as a tie.
How We Tested
- Runs
- 10 runs for each of Scriptor and vLLM, run in pairs with the order swapped each time and a fresh start for every run
- Pages
- 15 documents, 368 pages per run, 3,680 pages for each engine
- Requests
- About 46,500 requests for each engine, 32 at a time
- Typical (p50)
- Half of requests were faster than this
- Slowest 1 in 100 (p99)
- 99 in 100 requests were faster than this
Time to Read 368 Pages
A shorter bar is better.
Typical (p50)
About 48% less time
Slowest Run (p99)
About 47% less time
Pages Read in an Hour
A longer bar is better.
Typical (p50)
About 1.92 times as many
The pages an hour are worked out from the times measured for 368 pages, on one computer running without a break. For the whole job, the slowest run is the p99.
Time to the First Text
A shorter bar is better.
Typical (p50)
About 45% less time
Slowest 1 in 100 (p99)
About 25% less time
Time for a Whole Request
A shorter bar is better.
Typical (p50)
About 37% less time
Slowest 1 in 100 (p99)
About 29% less time
Time Spent Writing a Request's Text
A shorter bar is better.
Typical (p50)
About 47% less time
Slowest 1 in 100 (p99)
About 56% less time
A request is one page region sent to the server. The first text is the moment a request starts to answer, and the whole request runs until the last text arrives.
Time to Get Ready to Read
A shorter bar is better.
After the First Start
About 10.8 times sooner
Answers Cut Off at the Length Limit
A shorter bar is better.
Out of About 46,500 Requests Per Engine
90 fewer
Start-up time is counted after the first start, once the model files are already in memory.
Words Recovered From the Documents
A longer bar is better.
Against the Text Stored in the Documents
The same result
Same Text From Run to Run
A longer bar is better.
Page Regions With Identical Text
More repeatable
Memory Held While Running
A shorter bar is better.
Both Engines Running
About the same, with Scriptor holding about 2% more.
Accuracy was checked against the text stored in the documents. Repeatability is how often the same page region gave the same text from one run to the next. Scriptor and vLLM tie on accuracy and on memory.
What Scriptor Needs
- Computer
- An NVIDIA DGX Spark running Linux
- Model
- A copy of the GLM-OCR model that you supply; the model is not bundled with Scriptor
- Layout Model
- For the document bridge, a PP-DocLayoutV3 layout model in ONNX form and an onnxruntime library that you supply; neither is bundled with Scriptor
- Installation
- A ready-to-run aarch64 Linux CUDA build from the releases page, or build from source with Rust and the NVIDIA CUDA toolkit
Licensing
Scriptor is dual-licensed. You may use Scriptor under the GNU Affero General Public License, version 3 only (AGPL-3.0-only), or under a commercial license from Chiron Courseworks.
Frequently Asked Questions
- Can I use Scriptor without paying?
- Yes. The AGPL-3.0-only license lets you use, study, change, and share Scriptor. In return, if you distribute Scriptor, or let others use a modified version over a network, you must make the corresponding source code available under the same license.
- When do I need a commercial license for Scriptor?
- When those conditions do not work for you: for example, building Scriptor into a product or service whose source you will not release, or working in an organization whose policies do not permit AGPL software. A commercial license releases you from the AGPL obligations.
- How do I get Scriptor?
- Scriptor is released on GitHub at github.com/mdmurphy822/Scriptor, the official source for releases and source code. The releases page has a ready-to-run build for aarch64 Linux with CUDA, made for the NVIDIA GB10 in the DGX Spark. For a commercial license, contact us.
- Does Scriptor need an internet connection?
- No. Scriptor runs entirely offline, and your pages never leave your computer.
- Does Scriptor work with SemantiK?
- Yes, but Scriptor does not need SemantiK. Scriptor's own document bridge reads whole documents, and SemantiK can also send pages to Scriptor to be read, like any other program that uses the OpenAI chat API.