> ## Documentation Index
> Fetch the complete documentation index at: https://ladygraph.io.vn/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

> Every environment variable the ladyGraph scripts and tests read.

Endpoints, the database and the Google Cloud project are never written in the code. The scripts read them from environment variables. The repository's `.env.example` lists them with placeholder values. Copy it, fill in your own values, and keep your copy out of version control.

## Services

| Variable | Meaning |
| - | - |
| `PG_DB_URL` | The Postgres URL used by the source configs (`env:PG_DB_URL`), for example `postgresql+psycopg://user:password@host:5432/dbname`. No default. |
| `GEMMA_URL` | The base URL of the Gemma endpoint, without `/v1`. Required by `--llm gemma` and the Gemma demos. |
| `CLEF_URL` | The base URL of the Clef endpoint. Required by `--decider clef`, the Clef demos and the live Clef test. |
| `VERTEX_PROJECT` | Your Google Cloud project id. `GOOGLE_CLOUD_PROJECT` is the fallback. Required by the Vertex options. |
| `LADYGRAPH_READ_TOKEN`, `LADYGRAPH_WRITE_TOKEN` | The login for a Flight server, used by the build, search and benchmark scripts. |

> [!NOTE]
>
> With `psycopg` 3 installed, use the URL form `postgresql+psycopg://`. A plain `postgresql://` URL makes SQLAlchemy load `psycopg2`.

## Models and files

| Variable | Meaning |
| - | - |
| `EMBEDDING_MODEL_PATH` | Path to the EmbeddingGemma `.litertlm` file. Set it if the scripts do not find the model. |
| `LITERT_LLM_MODEL` | A `.litertlm` LLM file, for the real-model test of `LiteRtLlmClient` and the real-model option of lessons 3 and 7. Unset, those lessons use a stand-in. |
| `LITERT_LLM_DEVICE` | The backend for that file: `cpu` (the default), `gpu` or `npu`. |
| `LADYBUG_FLIGHT_SERVER` | Path to the `ladybug-flight-server` binary, for the Flight tests and `tutorial/10_stores/run_db.sh`. |
| `GLINER_TFLITE`, `GLINER_TOKENIZER`, `GLINER_DEVICE` | Tests only. The GLiNER `.tflite`, its tokenizer checkpoint (a name or a folder) and `cpu` or `gpu`, for the real-model test of `LiteRtGliner`. |

> [!WARNING]
>
> The backend must match how the model file was built. A `-gpu` file on `cpu` fails with `tf_lite_prefill_decode not found in the model`.

## Gateway and term-list builder

| Variable | Meaning |
| - | - |
| The variable named in `glossary_builder.gateway.api_key_env` | The key the term-list builder sends to your model endpoint. Optional: leave the setting out if the endpoint does not check keys. |
| `TAVILY_SEARCH_API` | The default name of the search key variable (`glossary_builder.search.api_key_env`). Needed only with `search.provider: tavily`. |
| `CLAUDE_GATEWAY_URL`, `CLAUDE_MODEL` | `hello_compare.py` in lesson 7 only. The address of a LiteLLM gateway you run, for example `http://localhost:4000/v1`, and the model alias it serves. ladyGraph reaches Claude only through such a gateway. Unset, that side uses a stand-in. |
| `LITELLM_MASTER_KEY` | The gateway key. The lesson 7 proxy script starts the proxy with it (default `sk-anything`), and `hello_compare.py` sends the same value. |
| `LADYGRAPH_REAL_AGENT` | Set to `1` to make `hello_build.py` in lesson 13 use the real agent instead of the scripted one. |

## Tests

| Variable | Meaning |
| - | - |
| `LADYGRAPH_LIVE` | Set to `1` to run the live test on real documents (`tests/test_real_finance.py`). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.