Skip to content

solvi.models

solvi models: the published and cached deciders, pull, check; naming a model (solvi ask --decider).

solvi models: the published deciders, the ones in the local cache, downloading one, and a quick check of any decider.

solvi models [list] [--json]                       solvi-ai/solvi-base, solvi-ai/solvi-large and every decider cached
solvi models pull solvi-ai/solvi-base [--backend onnx|torch|all]      download (huggingface_hub; only this command does)
solvi models check MODEL [--examples labels.jsonl --task "Which team?" [--options a,b,c]] [--json]

MODEL (here, and solvi ask --decider): a local checkpoint folder; a Hugging Face id already in the local cache (nothing is downloaded outside pull); systemone:URL#model — a System One service (--api-key, or $SOLVI_SYSTEMONE_API_KEY); llm:URL#model — an OpenAI-compatible chat-completions server (solvi.llm), e.g. llm:http://127.0.0.1:8080/v1#qwen2.5-7b (--api-key, or $SOLVI_LLM_API_KEY); or module:attr / file.py:attr — a DecideModel your code builds.

check prints what the checkpoint declares (solvi_decide.json: format, question kinds, act head, questions per pass, state serialization), its fingerprint, and — with labelled examples (JSON lines or CSV: label plus text / input or the other columns as a state; the question from --task / --options or each row's "task" / "options") — the latency of one decision (first call apart) and the accuracy, the share it escalates and the accuracy of what it answers alone. Exit status: 0 — loaded (and, with --min-accuracy, accurate enough); 1 — cannot be loaded or run here, or below --min-accuracy; 2 — usage errors (an id that is not downloaded, a bad file).

ModelError

Bases: Exception

A model that cannot be named or found (exit status 2).

cached_path

cached_path(repo_id, revision='main')

The local snapshot folder of a Hugging Face model id (its revision ref, else the newest snapshot), or None.

cached

cached()

Every decider in the local cache (a snapshot with solvi_decide.json) → [{"id", "path", "bytes", "onnx", "torch"}] (onnx / torch: whether the snapshot holds that backend's weights).

kind_of

kind_of(spec)

How a MODEL spec is read: "systemone", "llm", "folder", "code" (module:attr / file.py:attr) or "hub" (a Hugging Face id).

resolve

resolve(spec)

A MODEL spec → (kind, where): a folder for "folder" and a cached "hub" id, (url, model) for "systemone" and "llm", the spec for "code". A Hugging Face id that is not in the cache raises ModelError (run solvi models pull ID); so does a spec written as a path ("./x", "../x", "/x", "~/x") that is not a folder — "no such folder", never "pull".

load

load(spec, backend='auto', api_key=None)

A MODEL spec → a DecideModel (see the module docs). Never downloads. ModelError for a name that cannot be read (a file.py:attr whose file or attribute is missing included — never SystemExit); other exceptions (a missing runtime, a broken checkpoint, an error inside your module) pass through.

pull

pull(repo_id, backend='onnx', revision=None)

Download a decider into the local cache (huggingface_hub) → its folder.

cmd_models

cmd_models(a)

solvi models (see solvi.cli) → exit status.