Skip to content

Drop-in Rust ports of Python libraries

Same results, bit for bit. 30–950× faster.

We rewrite popular pure-Python libraries in Rust and test every output against the original, down to the last bit of every float. Change one import: your scores, languages and rankings stay exactly the same.

rouge-score → rouge-score-rs

ROUGE for summarization and LLM evaluation

30–80×

faster on one core, up to 353× with score_batch

The implementation behind Hugging Face Evaluate, with the same tokenizer, Porter stemmer and rougeLsum. Unicode tokenizers for other languages.

pip install rouge-score-rs

langdetect → langdetect-rs

Language detection with the same probabilities

40–52×

faster on one core, 245–315× with detect_batch

Every probability matches, random walk included, in a third of the memory. install() speeds up libraries that import langdetect themselves.

pip install langdetect-rs

rank_bm25 → rank-bm25-rs

BM25 search for retrieval and RAG

635–952×

faster per query on 10k–100k documents, 4–6× faster to index

BM25Okapi, BM25L and BM25Plus with identical scores. install() speeds up LangChain's BM25Retriever without changing its code.

pip install rank-bm25-rs

How we check

“The same” means the same bits

A faster library that gives slightly different numbers changes every result built on it. So each port is compared with the original without any tolerance, and a single differing float fails the tests.

Read how langdetect was ported, and why Python 3.12 changes its answers →
  • Exact comparison

    Every score, probability and ranking is compared with the Python original on real data and random inputs, with no tolerance.

  • Same API

    The same classes, options and return types, so a migration is one import. Known differences are listed on each page.

  • Reproducible benchmarks

    Speed is measured on public datasets with pinned versions, and the commands to rerun it are published.

Libraries

Also maintained here

All libraries →

rust-lstm

Rust

LSTM, GRU and BiLSTM networks with full backpropagation through time, gradients checked against finite differences and PyTorch.

crates.io versioncrates.io downloadsGitHub stars
cargo add rust-lstm

engram

Ruby
Pre-1.0

Long-term memory for AI agents in Ruby: recall the facts that matter and add them to the prompt, stored in your own Postgres.

Gem versionGem downloads
gem install engram

irt_ruby

Ruby

Item response theory in Ruby: Rasch, 2PL and 3PL models with missing-data strategies and adaptive optimisation.

Gem versionGem downloads
gem install irt_ruby

Research

Code and data you can rerun

Each study ships with its code, prompts, raw outputs and a DOI on Zenodo.

All studies →

Oct 2026 · O. Kholodniak, O. Prokhorov

Gradient reach in recurrent networks: code and training runs

How dropout, zoneout and gate initialisation change how far gradients reach back in time in LSTM and GRU networks, and whether that reach, measured early in training, predicts which runs learn long-range dependencies. Trained with rust-lstm.

Oct 2026 · O. Kholodniak

Comparing IRT models and simple baselines for budget-constrained LLM evaluation

Item response models against simple estimators on public model × item correctness matrices: how well each estimates item difficulty, a new model's capability and its full-benchmark accuracy when only 0.5–80% of the items are run.

Oct 2026 · O. Kholodniak

QoS-aware orchestration of local and cloud large language models in distributed information systems

Choosing per request between a small on-device model, a larger LAN server and a cloud API: latency model, routing policies, a netem testbed and the measurement data.

Updates

Latest releases

Who is behind this

SyntaxSpirits is maintained by Oleksandr Kholodniak, a software engineer and PhD researcher at the National Aerospace University “Kharkiv Aviation Institute” in Ukraine. The libraries come out of production Ruby work and research on evaluating language models.

Is there a slow Python library you would like ported, or a result that differs? Open an issue on the library's GitHub page, or write to hello@syntaxspirits.dev.