Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run a pass

Run col.tune() to produce a TuningPlan, and control whether the pass applies its result with the dry_run flag.

A tuning pass asks the collection's tuner to inspect the data and emit a TuningPlan. Run it with one call, col.tune(...); the dry_run flag decides whether the pass also applies what it found.

Before you start

  • The signed runtime is installed and verified (telys runtime install, then telys runtime verify).

  • The collection has a concrete tuner attached. The base Tuner raises NotImplementedError; use HeuristicTuner (bundled, runtime-only) or AlgentaTuner (from the telys-algenta adapter).

  • A partition is large enough to matter — past roughly 20,000 live rows. See Why tune.

Attach the tuner at create time: db.create_collection("notes", dim=384, partition_by="scope", tuner=HeuristicTuner()). open_collection re-attaches the default HeuristicTuner, not a custom tuner you saved — so run tune() in the same session where you attached one.

The signature

col.tune(workload=None, objectives=None, dry_run=None) -> TuningPlan
Parameter
Type
Meaning

workload

tuner-specific, or None

Representative queries the tuner fits to. HeuristicTuner ignores it; AlgentaTuner uses it.

objectives

tuner-specific, or None

The recall / latency / memory goals the tuner should optimize toward. Shape is defined by the tuner.

dry_run

bool or None

Whether the pass applies its plan. See the table below.

What dry_run does

dry_run

Behavior

True

Compute a plan and never apply it. Nothing on the collection changes.

False

Compute a plan and always apply it immediately.

None (default)

Compute a plan; apply it only if tuner.mode == "suggest_then_apply", otherwise suggest only.

col.tune(...) always returns the TuningPlan, regardless of dry_run. The flag governs only whether the plan's settings are written onto the collection during the call.

Run it

1

Open the collection and run a dry pass

Start with dry_run=True so you can read the plan before anything changes.

2

Inspect the plan

3

(Optional) fit to a workload

With AlgentaTuner, pass a sample of representative queries so the plan matches your access pattern.

Expected result

col.tune(dry_run=True) returns a TuningPlan and changes nothing on disk or in the live collection. The printed fields look like:

Exact numbers depend on your data, tuner, and hardware, but you always get a populated TuningPlan: a plan_id, a target_recall, an exact_crossover_rows, an ivf layout, and an expected metrics dict. Because this was a dry run, col.stats() is unchanged until you apply the plan.

Next steps

Last updated

Was this helpful?