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.
$ 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 downloadintura-ai --version prints the installed version, and intura-ai <command> --help lists a command's flags.
predict
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.
| Flag | What it does |
|---|---|
--field NAME | Print a single value instead of the whole answer: label, decision, or 0.type for the first span's type |
--lines | One compact JSON value per line, even for a single text |
--version VERSION | Pin one version you own. Default: the newest one already downloaded |
--refresh | Ask for the recommended version and download it if it is newer |
--cache-dir DIR | Where models are kept. Defaults to $INTURA_CACHE_DIR, then the default cache |
--version and --refresh can't be used together.
library
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
intura-ai models [--json]Lists the models you may download: slug, recommended version, language and name.
download
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
| Flag | What it does |
|---|---|
--api-key KEY | Your download key. Defaults to $INTURA_API_KEY |
--base-url URL | The API root. Defaults to $INTURA_BASE_URL, then https://ai.intura.co/api |
--timeout SECONDS | Seconds 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.
| Code | When |
|---|---|
0 | Success |
1 | The service refused or failed: a wrong key, a model you don't own, a dropped download |
2 | No download key, a bad argument, no text to predict, or a folder that isn't a downloaded model |
130 | Interrupted with Ctrl-C |