{
  "generator": {
    "matra": "0.3.0",
    "udpipe_model": {
      "name": "english-ewt-ud-2.5-191206",
      "sha256": "784bd0fa85e3d831fd02a55290d0acfd05c953159dc38cc33d52e1b28add9957"
    }
  },
  "page": "tutorials/installation.md",
  "paragraphs": [
    {
      "compression_ratio": 0.5976,
      "kind": "paragraph",
      "lexical_density": 0.541,
      "readability_grade": 8.0089,
      "sentences": 3,
      "text": "Install matra as a Rust library, a command-line binary or a Python package, then check that it works. Each route is one command; take the one for the language you call matra from, or more than one. Platforms and models lists what each route needs and installs, and One core, three install routes explains why the commands look as they do.",
      "words": 62
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5294,
      "readability_grade": 11.1694,
      "sentences": 1,
      "text": "To check a release file before you install it, follow Verifying a release in the security policy.",
      "words": 17
    },
    {
      "compression_ratio": 0.6055,
      "kind": "paragraph",
      "lexical_density": 0.5273,
      "readability_grade": 7.0073,
      "sentences": 2,
      "text": "For the Rust library and the CLI, and for the Python package on a platform with no wheel, install Rust 1.88 or later (check with rustc --version) and a C++ compiler. A C compiler on its own is not enough: without C++ the build stops with error occurred in cc-rs: failed to find tool \"c++\".",
      "words": 59
    },
    {
      "compression_ratio": 0.5698,
      "kind": "paragraph",
      "lexical_density": 0.5965,
      "readability_grade": 10.0375,
      "sentences": 2,
      "text": "For the Python package, use Python 3.12 or later (check with python3 --version, or python --version inside an activated virtual environment; stock macOS has only python3). Python wheels lists the platforms with a prebuilt wheel; on any other, and on a free-threaded interpreter, pip builds from source and needs the Rust toolchain and the C++ compiler above.",
      "words": 59
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.55,
      "readability_grade": 11.975,
      "sentences": 2,
      "text": "The default features include udpipe, so matra::Engine::new() builds the pinned UDPipe parser without a feature flag. The UDPipe adapter itself is private to the crate: you reach it through Engine, and a parser of your own reaches it through Engine::with_parser.",
      "words": 43
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5152,
      "readability_grade": 9.7965,
      "sentences": 3,
      "text": "--features cli is required: the binary is gated behind it. This compiles from source and places the binary in your cargo bin directory, which can take a minute or more. Confirm it landed:",
      "words": 33
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 1,
      "readability_grade": null,
      "sentences": 1,
      "text": "Expected output:",
      "words": 2
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5263,
      "readability_grade": 11.0726,
      "sentences": 1,
      "text": "The second line names the features this build was compiled with, so the Python package's banner below is longer.",
      "words": 20
    },
    {
      "compression_ratio": 0.5877,
      "kind": "paragraph",
      "lexical_density": 0.5091,
      "readability_grade": 7.1507,
      "sentences": 2,
      "text": "This installs the library and the matra command together; the command is the same program as the CLI binary above, so uvx 'matra>=0.3' analyze essay.md and the installed binary do the same thing. Keep the version floor in the line: why the install lines name a version says what an unpinned one can give you.",
      "words": 56
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5,
      "readability_grade": 5.8843,
      "sentences": 2,
      "text": "On a platform with a wheel this installs in seconds. Its version banner reads:",
      "words": 15
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5263,
      "readability_grade": 9.8305,
      "sentences": 1,
      "text": "The verify step below doubles as the check: if import matra fails there, the package did not install correctly.",
      "words": 19
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.561,
      "readability_grade": 9.0229,
      "sentences": 2,
      "text": "There is nothing to install. The library, the CLI and the Python package each download the English UDPipe model (about 16 MB) on first use, verify it against a pinned hash, and cache it in the model directory, by default ~/.local/share/matra/models.",
      "words": 41
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.6279,
      "readability_grade": 11.1302,
      "sentences": 3,
      "text": "To keep it somewhere else, set MATRA_MODEL_DIR, pass --model-dir to the CLI, or pass the directory through Config::with_model_dir in Rust. Python reads MATRA_MODEL_DIR. The model directory gives the full resolution order, and the model download what happens when a download fails its check.",
      "words": 45
    },
    {
      "compression_ratio": 0.5817,
      "kind": "paragraph",
      "lexical_density": 0.5526,
      "readability_grade": 8.3485,
      "sentences": 4,
      "text": "matra's code is MIT, and the two models it downloads are separate works with licenses of their own. The English parsing model comes from LINDAT under CC BY-NC-SA 4.0, which does not permit commercial use; read it before you use matra commercially. The embedding model, potion-base-8M, comes from Hugging Face under MIT per its model card, and is used for semantic clusters only. Model licenses has both in a table, with links to the license texts.",
      "words": 82
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.6538,
      "readability_grade": 6.2723,
      "sentences": 2,
      "text": "The command line, the config file, Rust and Python always use this model. No surface loads a different UDPipe model file: the model is a pin.",
      "words": 26
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5,
      "readability_grade": 14.9588,
      "sentences": 2,
      "text": "Run this once. No arguments and no environment: it resolves the model directory, downloads and caches the model on this first run, then parses a sentence through it and prints two results:",
      "words": 32
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5217,
      "readability_grade": 6.8515,
      "sentences": 2,
      "text": "To name the directory, set MATRA_MODEL_DIR before the call. Use a real path: the value is used unchanged, so ~ is not expanded.",
      "words": 23
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 1,
      "readability_grade": null,
      "sentences": 1,
      "text": "Expected output:",
      "words": 2
    },
    {
      "compression_ratio": 0.5427,
      "kind": "paragraph",
      "lexical_density": 0.5,
      "readability_grade": 8.5633,
      "sentences": 5,
      "text": "That first run fetches the model from a university server in Prague, and before it does, matra.Engine() writes two lines to standard error: what is downloading, its size and where to, then the model's licence. They are the lines the command line prints for the same download. Cold starts measured on a fast connection ranged from 3 to 35 seconds; on a slow network it takes longer, and the call is waiting on the network rather than working. Every run after that loads the cached file and touches no network, in about a second.",
      "words": 96
    },
    {
      "compression_ratio": 0.5261,
      "kind": "paragraph",
      "lexical_density": 0.5513,
      "readability_grade": 9.4492,
      "sentences": 5,
      "text": "If matra.Engine() raises OSError (a matra.IoError), either the download never arrived or the model directory could not be written, and the message says which by naming the URL or the path, as details[\"url\"] or details[\"path\"] do. Check your network connection first; then run matra config show to see which directory matra resolved and check the permissions on it. If it raises RuntimeError (a matra.ModelInvalidError), bytes did arrive and then failed the pinned hash check; run the snippet again.",
      "words": 80
    },
    {
      "compression_ratio": null,
      "kind": "list_item",
      "lexical_density": 0.5238,
      "readability_grade": 4.559,
      "sentences": 1,
      "text": "matra installed as a Rust crate, a CLI binary, a Python package, or some combination, all from the same 0.3.x core.",
      "words": 22
    },
    {
      "compression_ratio": null,
      "kind": "list_item",
      "lexical_density": 0.7333,
      "readability_grade": 13.0733,
      "sentences": 1,
      "text": "The English UDPipe model cached in the resolved model directory, verified against a pinned hash.",
      "words": 15
    },
    {
      "compression_ratio": null,
      "kind": "list_item",
      "lexical_density": 0.5455,
      "readability_grade": 6.9368,
      "sentences": 2,
      "text": "A confirmed working call from matra.Engine() through analyze() to a result.",
      "words": 11
    },
    {
      "compression_ratio": null,
      "kind": "paragraph",
      "lexical_density": 0.5,
      "readability_grade": 9.0117,
      "sentences": 1,
      "text": "Next: Your first analysis walks through what that result holds, or go to Rust, Python or CLI for the surface you are calling from.",
      "words": 24
    }
  ]
}
