Download RUN.md from tablinum/RailShot-Stream: direct link, hf CLI and curl.
- Browser
- Download file 3.42 kB
-
https://huggingface.co/tablinum/RailShot-Stream/resolve/main/RUN.md
- Command line
-
hf download hf://tablinum/RailShot-Stream/RUN.md
-
curl -L -o RUN.md https://huggingface.co/tablinum/RailShot-Stream/resolve/main/RUN.md
RailShot Stream
RailShot adds durable, ordered JSONL sessions to MagicEightBall’s incremental CPU and NCS1 runners. Text fragments in a session share a document and a decision history. Each successful append returns the resulting Boolean answer, category, and proposed action as data.
Run locally
Use Python 3.11+ with NumPy, ONNX Runtime, and SentencePiece. Run from the repository root.
python -m pip install numpy onnxruntime sentencepiece
@"
{"stream_id":"case-42","seq":1,"append":"Duplicate charge. "}
{"stream_id":"case-42","seq":2,"append":"Review authorized."}
{"stream_id":"case-42","seq":3,"append":" Do not route."}
"@ | python -m apps.railshot --db results/railshot.sqlite3
The second result proposes review_billing. The third clears the proposal. Run the same command again with the same journal to retrieve the committed results. To continue the document, send sequence 4.
The default CPU artifact is the repository’s radix ONNX. Use --artifact path/to/model.onnx for another MagicEightBall CPU export and keep its adjacent model.json. A journal is bound to the artifact, policy manifest, and tokenizer.
Run on the original Intel NCS
Use the Windows OpenVINO 2020.3.2 toolchain with Python 3.7, NumPy and SentencePiece 0.1.99. The adapter checks for a cold USB device with product ID 2150 before loading the compact native archive. Use a separate journal for the two backends.
$toolchain = 'C:/path/to/ncs1'
$python = Join-Path $toolchain '.venv/Scripts/python.exe'
& $python -m pip install sentencepiece==0.1.99
@"
{"stream_id":"case-42","seq":1,"append":"Duplicate charge. "}
{"stream_id":"case-42","seq":2,"append":"Review authorized."}
"@ | & $python -m apps.railshot --backend ncs1 --toolchain $toolchain --db results/railshot-ncs1.sqlite3
The learned decision head runs on the stick. Tokenization, evidence extraction, and transaction commits run on the host. The physical replay passed two process launches, two independent documents, exact retries, a late veto, a gap rejection, and recovery after an append exceeded 131,072 tokens. Stable JSON replies go to stdout. Native runtime diagnostics go to stderr.
Protocol
- A
stream_idhas 1–64 ASCII letters, digits, underscores, periods, or hyphens, beginning with a letter or digit. Each stream starts atseq: 1and advances by one on each commit. Different streams can be interleaved. - Send
appendas a text fragment.reset: truestarts a fresh document at the next sequence number, with optional initial text. Each active document has MagicEightBall’s 131,072-token limit. - Success is a
railshot.result/1object withok: true, the stream ID, sequence, anddecision. Resubmitting the same fragment and reset flag at an accepted sequence returns the recorded response. A different payload at that sequence producesconflicting_retry. - Errors return
ok: falsewith anerrorobject. A gap reportsout_of_orderandexpected_seq. A rejected append leaves the next sequence available. Successful results carry stable decision fields for replay. - SQLite stores the request text, reset flag, and response in one transaction before stdout acknowledges success. Restart with the same journal to recover the active document from its committed fragments. Earlier results remain available for retries after a reset.