# Milvus Lite and Zilliz Cloud tutorial: code and outputs

Run date: 2026-11-06 (the container clock showed 2026-11-05 23:xx UTC). Everything ran in Docker. Nothing is installed on the host or in this repo.

Scripts (each `X.py` has its saved output in `X.out`, except the helpers):
- `Dockerfile`, `requirements.txt`, `pip-freeze.txt`: the image. `run.sh` runs a script in it against Milvus Lite, `zilliz_run.sh` runs the same scripts against Zilliz Cloud, `standalone_run.sh` against a Milvus server. `common.py` is the shared helper (connect, chunks, query embedding).
- `version_check.py` (`setup.out`, `pipgrep.out`), `load.py` (`load.out`), `files.sh` (`files.out`, `files_after_writes.out`), `query.py`, `filters.py`, `partition_key.py`, `upsert.py`, `index_types.py`, `gotchas.py`, `gotchas.sh` (`gotchas_env.out`).
- Lite limits: `lite_lock.sh` with `lite_hold.py`, `lite_try.py` and `lite_persist.py` (`lite_lock.out`).
- Zilliz Cloud: the same scripts, outputs saved as `zilliz_load.out`, `zilliz_query.out`, `zilliz_filters.out`, `zilliz_partition_key.out`, `zilliz_upsert.out`. Host, cluster id and token are replaced with `YOUR_CLUSTER_HOST`, `in03-xxxx` and `YOUR_ZILLIZ_API_KEY` in every saved output.
- Standalone: `standalone_up.sh` (plain-docker translation of the official script, plus Attu), outputs `standalone_*.out`, `standalone_stats.out`, and `standalone_health.out` (a clean re-run: Docker health time, memory at start, Attu 401 without `ATTU_AUTH_MODE`).
- `build_chunks.py` (builds `chunks.jsonl` from a crawl, copied unchanged from the Chroma tutorial), `questions.json`, `cleanup.sh`.

Run order: `docker build -t kb-milvus:3.0.2 .`, then with `DATA_DIR` set to a host folder that holds `chunks.jsonl`:
`./run.sh version_check.py`, `./run.sh load.py` (then `./files.sh`), `query.py`, `filters.py`, `partition_key.py`, `upsert.py` (then `./files.sh` again), `index_types.py`, `gotchas.py`, `./lite_lock.sh`, `./gotchas.sh`.
Zilliz: put `ZILLIZ_URI=...` and `ZILLIZ_TOKEN=...` in a mode-600 file, `export ZILLIZ_ENV_FILE=<that file>`, then `./zilliz_run.sh load.py`, `query.py`, and so on. The file reaches the container only through `--env-file`.
Standalone: run `standalone_up.sh` from a scratch folder, then `./standalone_run.sh load.py` and the others.

Versions: `pymilvus` 3.0.2 (PyPI, uploaded 2026-09-18), `milvus-lite` 3.2.2 (PyPI, uploaded 2026-10-13), installed through the `pymilvus[milvus_lite]` extra and pinned explicitly. Python 3.11.18 (`python:3.11-slim`, aarch64), Docker 24.0.6. Image `kb-milvus:3.0.2` is 530 MB.
Server side: `milvusdb/milvus:v3.0.5` (digest sha256:b9b79b4a284b41cd12d60abc418310f84621fa4c977d409b38f501519a7ccf8a, arm64, 1.45 GB) pulled OK on 2026-11-06. `zilliz/attu:v3.0.1` (the `latest` tag on 2026-11-06, digest sha256:40ecd43583e6cfd8bc98c7cf1627012e2069be65a63a419403595ad6a7d1129c, arm64, 366 MB) pulled OK.
Zilliz Cloud: Free plan, serverless, region gcp-us-west1, "Compatible with Milvus 3.0.x" in the console, no card added. The cluster id, endpoint and token are not in any file here.
Full dependency list: `pip-freeze.txt`.

Sources read on 2026-11-06 (with `webcr`): milvus.io/docs/milvus_lite.md (limits, supported index types, "creates a directory"), milvus.io/docs/install_standalone-docker.md (embedded etcd script), github.com/milvus-io/milvus (Apache 2.0), zilliz.com/pricing (Free: $0, 5 GB, 2.5M vCUs per month, up to 5 collections), docs.zilliz.com/docs/limits (1 Free cluster per organization, 5 GB per cluster, 5 collections), docs.zilliz.com/docs/free-trials (console session expires after 6 hours of inactivity), github.com/zilliztech/attu (auth modes), PyPI pages of both packages.
The Free plan inactivity or auto-pause policy was not found in those pages.

Input: `chunks.jsonl` is NOT included (3.4 MB with embeddings). It has 304 rows, sha256 7c62db9258ba7b33bc75bf3e0593b0a7ffc73d0b0fb11da68db0eb27ebe4e145 (verified before the run), the same file as the Chroma, Qdrant and LanceDB tutorials.
`build_chunks.py` builds your own from a WebCrawlerAPI crawl (key in env `WEBCRAWLERAPI_API_KEY`). Queries need Ollama with `nomic-embed-text`; from the container it is reached at `host.docker.internal:11434`. `questions.json` has the 6 smoke-test questions.

Notes on the saved outputs:
- `*.out` files are the real output of the final run. The terminal screenshots drop some rows and long lines.
- `zilliz_partition_key.out` contains a full pymilvus traceback from a 60-second `drop_collection` timeout (DEADLINE_EXCEEDED), which is real behavior on the Free cluster. The drop did complete.
- `files.out` and `files_after_writes.out` replace my user name with `user`.
- The Zilliz console screenshots (`z1`, `z2`) were taken in a logged-in browser. Before the screenshot I replaced the account email, the organization name and the cluster id on the page with placeholders by editing the page text, so those three strings in the pictures are not what the console showed. Nothing else was changed.
- The Attu screenshot (`a1`) was taken from a local Attu 3.0.1 with login disabled (`ATTU_AUTH_MODE=none`) on 127.0.0.1.
- `index_types.out`: the second part lists the files in an IVF_PQ collection folder.

Clean up: `cleanup.sh`. The Zilliz collection, cluster and account are removed by hand after the article is checked (see plan.md, Execution notes).
