Environment variables
Every URNA_* environment variable urna reads, plus the other variables that change its behavior, with the component that reads each, its default and effect.
This page lists every URNA_* variable read anywhere in the urna code, grouped by who reads it, and then the other environment variables that change urna's behavior. Unless a row says otherwise, an empty value counts as unset.
Install and setup
| Variable | Read by | Default | Effect |
|---|---|---|---|
URNA_RELEASE_BASE | install.sh, install.ps1, urna setup | the GitHub release: the latest one for the installers (or --version), the binary's own version for setup (or --version) | URL prefix the release files are fetched from, used as given (setup trims a trailing /). When set, the version flags of all three are ignored. urna setup accepts only https:// and file://; install.sh accepts any URL curl does. See air-gapped install. |
URNA_BIN_DIR | install.sh, install.ps1 | ~/.local/bin (~\.local\bin on Windows) | Where the installers put the binary. The binary itself never reads it. |
URNA_DATA_DIR | install.sh, install.ps1, urna setup, and every urna command that looks for the embedder, the build tool or the setup venv | unset | The first data directory searched, and the directory urna setup and the installers write into. The payload lands in $URNA_DATA_DIR/urna/forge, the venv in $URNA_DATA_DIR/urna/venv. Keep it set for every later urna run, or the binary looks only in the default locations. See paths. |
The urna binary
| Variable | Read by | Default | Effect |
|---|---|---|---|
URNA_PYTHON | ask, retrieve, search-text, build, doctor, the explorer, urna setup | unset | The interpreter that runs the query embedders and the build tool, used verbatim. It wins over the setup venv, any .venv and python3. When it points at an interpreter without numpy and tokenizers, urna setup blocks its Python step (exit 14) instead of building a venv this variable would hide. |
URNA_COLOR | urna tui, urna setup, urna doctor | unset (the terminal is probed) | none: no color. 256: the xterm 256-color palette. truecolor or 24bit: 24-bit color. Any other value falls through to the probe. NO_COLOR wins over it. See colors and links. |
URNA_FORCE_SCALAR | the runtime (every search, in the binary and in the Python extension) | unset | Any value except 0, including an empty one, disables SIMD and uses the scalar code path. urna doctor and urna stats then report scalar. For before and after benchmarks on one binary. |
Python embedders and the build (repo checkout)
These are read by the Python side, which runs from a repo checkout: the forge behind urna build, the registry query embedder, and search-text's embedder. The installed payload's potion embedder reads none of them.
| Variable | Read by | Default | Effect |
|---|---|---|---|
URNA_ALLOW_DOWNLOAD | python/embed_query.py (search-text), python/model_fingerprint.py, python/convert_legacy.py, python/tools/urna_build_corpus.py, python/forge/embed_st.py | unset | Exactly 1 allows Hugging Face downloads of model weights. Any other value keeps HF_HUB_OFFLINE, TRANSFORMERS_OFFLINE and HF_DATASETS_OFFLINE at 1 (unless you set them yourself). |
URNA_ALLOW_REMOTE_CODE | python/forge/embed_query_model.py (ask and retrieve on registry-model corpora), python/tools/urna_model_bench.py, python/tools/urna_ui_bridge.py | unset | Comma-separated preset names allowed to run the model's remote code (trust_remote_code), for example wemm-2b,jina-v5-omni-nano. A query against such a preset without it fails. At build time the spec's [output] allow_remote_code plays this role. |
URNA_ALLOW_HEAVY | python/forge/embed_query_model.py | unset | Exactly 1 lets the query embedder load a preset flagged too heavy for this machine (wemm-4b, wemm-9b). At build time, use urna build --allow-heavy. |
URNA_CACHE_DIR | the forge (urna build) | ${XDG_CACHE_HOME:-~/.cache}/urna | Root of the shared embed cache and model probes. [output] cache_dir in the spec and --cache-dir take precedence. ~ is expanded. |
URNA_MODEL_DIR_<NAME> | the model registry (build and registry query embedder) | unset | Local directory of a preset's model. <NAME> is the preset name upper-cased with - as _: URNA_MODEL_DIR_WEMM_2B. An explicit model path (model_path in the spec, --model-path on ask and retrieve) wins over it; it wins over the preset's own local directory and the Hugging Face cache. |
URNA_ST_DEVICE | the forge's sentence-transformers workers | cuda if available, else mps, else cpu | Device for embedding. Recorded as device in the build lock (auto when unset). |
URNA_ST_DTYPE | the forge's sentence-transformers workers | bfloat16 on cuda, float16 on mps, float32 on cpu | Model dtype for embedding. |
URNA_ENABLE_FAKE_PRESET | the model registry | unset | Exactly 1 enables the fake-test preset, used by the test suite. |
The model presets and their requirements are in the model registry; the cache layout is in build artifacts.
Examples
| Variable | Read by | Default | Effect |
|---|---|---|---|
URNA_FILE | examples/fastapi/main.py, examples/flask/app.py | demo_fastapi.urna, demo_flask.urna | The corpus the demo server opens; a demo corpus is built there when the file does not exist. |
Development and tests
| Variable | Read by | Default | Effect |
|---|---|---|---|
URNA_PYTHON | scripts/release_check.sh, scripts/ruff_check.sh | release_check.sh: ./.venv/bin/python if present, else python3; ruff_check.sh: python3 | The interpreter the gate builds the extension against and runs the Python suites and ruff with. |
URNA_BASELINE | scripts/release_check.sh | data/measure/baseline.json | Baseline JSON the measurement is compared against. |
URNA_QUERIES | scripts/release_check.sh | 100 | Query count for measure_presets.py. |
URNA_K | scripts/release_check.sh | 10 | Top-k for measure_presets.py. |
URNA_OUT | scripts/release_check.sh | /tmp/release_check_post.json | Where the post-run measurement JSON is written. |
URNA_MUTATION_ITERS | crates/urna-format/tests/mutation_fuzz.rs, crates/urna-runtime/tests/mutation_fuzz.rs | 1500 (format), 250 (runtime) | Iterations per fixture of the mutation harness. CI sets 6000 and 800. |
URNA_FUZZ_SEED_DIR | the same two harnesses | unset | Output directory: the harness writes its base fixtures there, to seed the cargo-fuzz corpus. |
URNA_FUZZ_TARGETS | scripts/fuzz_soak.sh | urna-view section-decoders runtime-indexes mmap-open-search | Space-separated cargo-fuzz targets for a local soak. |
URNA_FORGE_TEST_DATA | tests/test_forge_spec.py | set by the test | Fixture for the spec's ${VAR} expansion. |
URNA_FORGE_UNSET_X | tests/test_forge_spec.py | kept unset | Checks the error for an unset ${VAR}. |
The contributor workflow is in contributing.
Other variables urna reads
| Variable | Read by | Effect |
|---|---|---|
NO_COLOR | urna tui, urna setup, urna doctor | A non-empty value disables color. An empty NO_COLOR is ignored. |
COLORTERM, TERM_PROGRAM, TERM | the color probe | Pick 24-bit color when they name a truecolor terminal; the list is in colors and links. |
WT_SESSION | the color probe, the explorer's links | Set by Windows Terminal: selects 24-bit color and enables OSC 8 links on Windows. |
XDG_DATA_HOME | the binary, install.sh | Second data directory searched; the install root when URNA_DATA_DIR is unset (after LOCALAPPDATA on Windows). |
HOME | the binary, install.sh, install.ps1 | $HOME/.local/share is a data directory; ~ in displayed paths. |
LOCALAPPDATA | the binary, install.ps1 | A data directory on every OS; the install root on Windows when URNA_DATA_DIR is unset. |
PATH, PATHEXT | urna setup | Finding curl, uv and a base Python (PATHEXT suffixes on Windows). |
XDG_CACHE_HOME | the forge | Default parent of the embed cache: $XDG_CACHE_HOME/urna. |
HF_HOME | python/model_fingerprint.py | Where the Hugging Face cache is looked up (default ~/.cache/huggingface). |
HF_HUB_OFFLINE, TRANSFORMERS_OFFLINE, HF_DATASETS_OFFLINE | set by the potion embedder and the sentence-transformers scripts | Set to 1 when you have not set them, so Hugging Face libraries stay offline. |
TOKENIZERS_PARALLELISM | set by the potion embedder | Set to false when you have not set it. |
any ${VAR} in a build spec | the forge | Expanded in spec strings; unset or empty is a spec error. See the spec file. |
PYO3_PYTHON | set by scripts/release_check.sh | Pins the interpreter the extension is built against. |
HTTPS_PROXY, HTTP_PROXY, NO_PROXY | the npm wrapper of @urna/cli | Proxy for its download. curl, which the installers and urna setup use, reads its own proxy variables. |
Names such as URNA_MAGIC, URNA_HEADER_SIZE, URNA_FORMAT_VERSION or URNA_BIN that appear in the code are constants, not environment variables.
Compatibility
Which .urna files a 0.5.1 reader accepts, how format v1 grows without breaking old files, legacy NEST files and what makes two builds byte-identical.
Paths and resolution order
Where urna keeps the embedder payload, the setup venv and the embed cache, and the exact order it searches for data directories, scripts and Python.