CLI Reference#

unionml#

unionml command-line tool.

unionml [OPTIONS] COMMAND [ARGS]...

Options

--install-completion <install_completion>#

Install completion for the specified shell.

Options:

bash | zsh | fish | powershell | pwsh

--show-completion <show_completion>#

Show completion for the specified shell, to copy it or customize the installation.

Options:

bash | zsh | fish | powershell | pwsh

activate-schedules#

Activate training and prediction schedules specified in your UnionML app.

unionml activate-schedules [OPTIONS] APP

Options

-v, --app-version <app_version>#

App version

--name <schedule_names>#

Name of the schedule to activate. This option can be specified multiple times.

Arguments

APP#

Required argument

deactivate-schedules#

Deactivate training and prediction schedules specified in your UnionML app.

unionml deactivate-schedules [OPTIONS] APP

Options

-v, --app-version <app_version>#

app version

--name <schedule_names>#

Name of the schedule to deactivate. This option can be specified multiple times.

Arguments

APP#

Required argument

deploy#

Deploy model to a Flyte backend.

unionml deploy [OPTIONS] APP

Options

--allow-uncommitted#

Deploy uncommitted changes in the unionml project

Default:

False

--patch#

Bypass Docker build process and update the UnionML app source code using the latest available image.

Default:

False

--schedule, --no-schedule#

Indicates whether or not to deploy the training and prediction schedules.

Default:

True

Arguments

APP#

Required argument

fetch-model#

Fetch a model object from the remote backend.

unionml fetch-model [OPTIONS] APP

Options

-v, --app-version <app_version>#

app version

-m, --model-version <model_version>#

model version

Default:

latest

-o, --output-file <output_file>#

output file path

--kwargs <kwargs>#

json string of kwargs to pass into model.save

Arguments

APP#

Required argument

fetch-predictions#

Fetch a model object from the remote backend.

unionml fetch-predictions [OPTIONS] APP

Options

-v, --app-version <app_version>#

app version

-m, --prediction-id <prediction_id>#

prediction id

Default:

latest

-o, --output-file <output_file>#

output file path

-f, --output-format <output_format>#

Output format of the file. Currently only json-serializable prediction outputs are supported.

Default:

PredictionOutputFormats.json

Arguments

APP#

Required argument

init#

Initialize a UnionML project.

unionml init [OPTIONS] APP_NAME

Options

-t, --template <template>#

template to use for initializing your app.

Default:

AppTemplate.basic

Options:

basic | basic-aws-lambda | basic-aws-lambda-s3 | basic-bentoml | quickdraw

Arguments

APP_NAME#

Required argument

list-model-versions#

List all model versions.

unionml list-model-versions [OPTIONS] APP

Options

-v, --app-version <app_version>#

app version

--limit <limit>#

Maximum number of model versions to list, sorted in descending order of time of execution.

Default:

10

Arguments

APP#

Required argument

list-prediction-ids#

List all batch prediction identifiers.

unionml list-prediction-ids [OPTIONS] APP

Options

-v, --app-version <app_version>#

app version

--limit <limit>#

Maximum number of model versions to list, sorted in descending order of time of execution.

Default:

10

Arguments

APP#

Required argument

list-scheduled-prediction-runs#

List scheduled prediction runs by schedule name.

unionml list-scheduled-prediction-runs [OPTIONS] APP SCHEDULE_NAME

Options

-v, --app-version <app_version>#

app version

--limit <limit>#

number of

Default:

5

Arguments

APP#

Required argument

SCHEDULE_NAME#

Required argument

list-scheduled-training-runs#

List scheduled training runs by schedule name.

unionml list-scheduled-training-runs [OPTIONS] APP SCHEDULE_NAME

Options

-v, --app-version <app_version>#

app version

--limit <limit>#

number of

Default:

5

Arguments

APP#

Required argument

SCHEDULE_NAME#

Required argument

predict#

Generate prediction.

unionml predict [OPTIONS] APP

Options

-i, --inputs <inputs>#

json string of inputs tp pass into predict workflow

-f, --features <features>#

generate predictions for this feature

-v, --app-version <app_version>#

app version

-m, --model-version <model_version>#

model version

-w, --wait#

whether or not to wait for remote execution to complete.

Default:

False

Arguments

APP#

Required argument

serve#

Serve an unionml model using uvicorn. This command uses the main uvicorn entrypoint with an additional --model-path argument.

For more information see: https://www.uvicorn.org/#command-line-options

unionml serve [OPTIONS] APP

Options

--host <host>#

Bind socket to this host.

Default:

127.0.0.1

--port <port>#

Bind socket to this port. If 0, an available port will be picked.

Default:

8000

--uds <uds>#

Bind to a UNIX domain socket.

--fd <fd>#

Bind to socket from this file descriptor.

--reload#

Enable auto-reload.

--reload-dir <reload_dirs>#

Set reload directories explicitly, instead of using the current working directory.

--reload-include <reload_includes>#

Set glob patterns to include while watching for files. Includes ‘*.py’ by default; these defaults can be overridden with –reload-exclude. This option has no effect unless watchfiles is installed.

--reload-exclude <reload_excludes>#

Set glob patterns to exclude while watching for files. Includes ‘.*, .py[cod], .sw.*, ~*’ by default; these defaults can be overridden with –reload-include. This option has no effect unless watchfiles is installed.

--reload-delay <reload_delay>#

Delay between previous and next check if application needs to be. Defaults to 0.25s.

Default:

0.25

--workers <workers>#

Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with –reload.

--loop <loop>#

Event loop implementation.

Default:

auto

Options:

auto | asyncio | uvloop

--http <http>#

HTTP protocol implementation.

Default:

auto

Options:

auto | h11 | httptools

--ws <ws>#

WebSocket protocol implementation.

Default:

auto

Options:

auto | none | websockets | wsproto

--ws-max-size <ws_max_size>#

WebSocket max size message in bytes

Default:

16777216

--ws-max-queue <ws_max_queue>#

The maximum length of the WebSocket message queue.

Default:

32

--ws-ping-interval <ws_ping_interval>#

WebSocket ping interval

Default:

20.0

--ws-ping-timeout <ws_ping_timeout>#

WebSocket ping timeout

Default:

20.0

--ws-per-message-deflate <ws_per_message_deflate>#

WebSocket per-message-deflate compression

Default:

True

--lifespan <lifespan>#

Lifespan implementation.

Default:

auto

Options:

auto | on | off

--interface <interface>#

Select ASGI3, ASGI2, or WSGI as the application interface.

Default:

auto

Options:

auto | asgi3 | asgi2 | wsgi

--env-file <env_file>#

Environment configuration file.

--log-config <log_config>#

Logging configuration file. Supported formats: .ini, .json, .yaml.

--log-level <log_level>#

Log level. [default: info]

Options:

critical | error | warning | info | debug | trace

--access-log, --no-access-log#

Enable/Disable access log.

--use-colors, --no-use-colors#

Enable/Disable colorized logging.

--proxy-headers, --no-proxy-headers#

Enable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info.

--server-header, --no-server-header#

Enable/Disable default Server header.

--date-header, --no-date-header#

Enable/Disable default Date header.

--forwarded-allow-ips <forwarded_allow_ips>#

Comma separated list of IPs to trust with proxy headers. Defaults to the $FORWARDED_ALLOW_IPS environment variable if available, or ‘127.0.0.1’.

--root-path <root_path>#

Set the ASGI ‘root_path’ for applications submounted below a given URL path.

--limit-concurrency <limit_concurrency>#

Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses.

--backlog <backlog>#

Maximum number of connections to hold in backlog

--limit-max-requests <limit_max_requests>#

Maximum number of requests to service before terminating the process.

--timeout-keep-alive <timeout_keep_alive>#

Close Keep-Alive connections if no new data is received within this timeout.

Default:

5

--timeout-graceful-shutdown <timeout_graceful_shutdown>#

Maximum number of seconds to wait for graceful shutdown.

--ssl-keyfile <ssl_keyfile>#

SSL key file

--ssl-certfile <ssl_certfile>#

SSL certificate file

--ssl-keyfile-password <ssl_keyfile_password>#

SSL keyfile password

--ssl-version <ssl_version>#

SSL version to use (see stdlib ssl module’s)

Default:

17

--ssl-cert-reqs <ssl_cert_reqs>#

Whether client certificate is required (see stdlib ssl module’s)

Default:

0

--ssl-ca-certs <ssl_ca_certs>#

CA certificates file

--ssl-ciphers <ssl_ciphers>#

Ciphers to use (see stdlib ssl module’s)

Default:

TLSv1

--header <headers>#

Specify custom default HTTP response headers as a Name:Value pair

--version#

Display the uvicorn version and exit.

--app-dir <app_dir>#

Look for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.

Default:

--h11-max-incomplete-event-size <h11_max_incomplete_event_size>#

For h11, the maximum number of bytes to buffer of an incomplete event.

--factory#

Treat APP as an application factory, i.e. a () -> <ASGI app> callable.

Default:

False

--model-path <model_path>#

model path to use for serving

Arguments

APP#

Required argument

train#

Train a model.

unionml train [OPTIONS] APP

Options

-i, --inputs <inputs>#

json string of inputs to pass into training workflow

-v, --app-version <app_version>#

app version

-w, --wait#

whether or not to wait for remote execution to complete.

Default:

False

Arguments

APP#

Required argument