Skip to content
Intura

Command line

Command line

The intura-ai command: list your library, run a model on text from arguments or stdin, and download a model into a folder.

The intura-ai command

Installing the package also installs intura-ai. It reads your download key from INTURA_API_KEY, like the Python client.

bash
$ export INTURA_API_KEY=sk_...
$ intura-ai library                                   # what your account owns
$ intura-ai predict guardrails-pii-detection-id "Nama saya Budi, NIK 3171234567890001"
$ intura-ai predict chat-commerce-intent-id "paket belum sampai" "mau refund" --field label
$ cat messages.txt | intura-ai predict fraud-chat-scam-id --field decision
$ intura-ai predict ./models/guardrails-pii-detection-id/v1.0 "..."   # a downloaded folder
$ intura-ai predict chat-commerce-intent-id "..." --refresh            # fetch the newest
$ intura-ai download guardrails-pii-detection-id --dir ./models --version v1.0
$ intura-ai models                                    # what you may download

intura-ai --version prints the installed version, and intura-ai <command> --help lists a command's flags.

predict

bash
intura-ai predict MODEL [TEXT ...]

Runs a model on your CPU. MODEL is a slug from intura-ai library, or a folder that intura-ai download wrote.

predict loads the model the same way client.models.load does, so the first run downloads it and later runs work offline. With one text, it prints the result as JSON. With several texts, given as arguments or one per line on stdin, it prints one compact JSON value per line.

FlagWhat it does
--field NAMEPrint a single value instead of the whole answer: label, decision, or 0.type for the first span's type
--linesOne compact JSON value per line, even for a single text
--version VERSIONPin one version you own. Default: the newest one already downloaded
--refreshAsk for the recommended version and download it if it is newer
--cache-dir DIRWhere models are kept. Defaults to $INTURA_CACHE_DIR, then the default cache

--version and --refresh can't be used together.

library

bash
intura-ai library [--json]

Lists what your account owns: each item's code, kind, current version and title. --json prints everything the service sent.

models

bash
intura-ai models [--json]

Lists the models you may download: slug, recommended version, language and name.

download

bash
intura-ai download SLUG [--dir DIR] [--version VERSION] [--overwrite]

Downloads one model's files into <dir>/<slug>/<version>/ and prints that folder. --dir defaults to the current folder and --version to the recommended version. A complete copy already there is kept unless you pass --overwrite.

Flags every command takes

FlagWhat it does
--api-key KEYYour download key. Defaults to $INTURA_API_KEY
--base-url URLThe API root. Defaults to $INTURA_BASE_URL, then https://ai.intura.co/api
--timeout SECONDSSeconds to wait for one API response. Default 30

Exit codes

Errors exit non-zero with one line on stderr, never a traceback, so a shell script can act on them.

CodeWhen
0Success
1The service refused or failed: a wrong key, a model you don't own, a dropped download
2No download key, a bad argument, no text to predict, or a folder that isn't a downloaded model
130Interrupted with Ctrl-C