CLI

LF AI Platform command line interface (CLI) is distributed as a lightweight Python package that allows programmatic interface for using LF AI Platform

You can use --help with any command of the CLI to understand what it does and what are its arguments.

lf --help
lf <command> --help

General

configure Configure AI Platform CLI options.
switch Switch AI app context.
status Shows the current AI app context and the saved AI Platform CLI options.
init Initialize a project in the current directory.
run Create one or more evaluations from a run config file along with their dependencies and run them as an evaluation run or evaluation plan run.
rerun Rerun an evaluation run with a given ID.
skills Load LatticeFlow AI Platform agentic skills and download supporting resources.
dump Dump an AI app with its evaluation runs, or all entities to a directory.
restore Restore an AI app with its evaluation runs, or global entities from a directory.

Entity & Evaluation Management

add Create/update entities from run config or entity YAML files.
set Set entities from run config (policies, risk-policies).
list List entities as JSON or in a table.
delete Delete entities by key (or ID for evaluation runs).
overview Show overview of entities (currently policies, risk policies, evaluation runs, and evaluation plan runs are supported).
export Export entities or download evaluation run results.
cancel Cancel evaluation run by ID.
test Test models, dataset generation, and task specifications.
regenerate Regenerate datasets using a dataset generator.

Administration

user User commands.
secret Secret management commands.
integration Third-party integration commands.
tenant Control plane (tenant & user) commands.

Environment Variables

Environment variables can be used in YAML files to pass sensitive or repetitive information that you might want to reuse. These can be specified in an .env. The CLI reads the .env in the current working directory.

For example, you can define the following .env file:

.env
MY_API_KEY="my_api_key"

and then use it within the configuration files as follows:

...
config:
  ...
  api_key: $MY_API_KEY