Model commands

Feature set: Inference Contact our support for access.

The akka models commands deploy models in Akka’s inference regions and serve them through the gateway. The akka optimize models commands read the model versions in the artifact registry, together with their training, serving, routing, and price, and deprecate or retire a version. See Serving models for the tasks these commands support, and Model descriptor for the file they apply.

Every command supports --help. Most support -o json for output consumed by another program, and --region to act on a region other than the project’s primary region. The singular alias model is accepted.

Accelerator pools

Every inference-capable region declares pools of accelerator devices. A pool name is a regional identifier only: two regions can name the same hardware differently. Compare the PRODUCT and MIG PROFILE columns, not the name, across regions. The alias pool is accepted.

Command Description

akka models pools list

List the accelerator pools available to the organization.

akka models pools list --region REGION

List the pools of one region. Repeat --region to list several.

The listing is discovery only. The region decides how many devices a project can draw when it admits an allocation.

Accelerator allocations

An accelerator allocation claims devices from a region’s pools for the project. Models place onto an allocation’s entries by name. The alias allocation is accepted.

Command Description

akka models allocations list

List the project’s accelerator allocations in the region.

akka models allocations get NAME

Describe one accelerator allocation, entry by entry.

DEVICES is what the entries ask for. BOUND is how many devices the region has bound to claims. An allocation is usable when Ready is True and the two values agree.

Models

A model is one checkpoint served by an engine on an allocation entry.

Command Description

akka models list

List the project’s models in the region.

akka models get NAME

Describe one model. When the model is not ready, this prints the reason from its Ready condition.

akka models get NAME --wait

Wait until the model is ready. --wait-timeout sets how long to wait, 10 minutes by default. The first deployment of a model pulls the engine image and the checkpoint, so several minutes are normal.

Applying and deleting descriptors

A model descriptor is multi-document YAML. Each document declares an AcceleratorAllocation, a Model, or a ModelEndpoint. When -f is omitted, both commands read the descriptor from standard input.

Command Description

akka models apply -f FILE

Create or update every resource the descriptor names, by name.

akka models apply -f FILE --dry-run

Run the region’s full admission without persisting anything.

akka models delete -f FILE

Delete every resource the descriptor names. Endpoints are deleted first, then models, then allocations. A resource that is already absent is skipped, so the command is safe to repeat.

akka models delete -f FILE --force

Delete without asking for confirmation.

The CLI checks the shape of the descriptor before it sends anything and reports every problem at once. Whether the devices fit the pool is decided by the region when it admits the change.

Service, Route, and Secret resources belong to the project descriptor. Apply them with akka projects apply.

Model endpoints

A model endpoint serves one or more models through the gateway. The alias endpoint is accepted.

Command Description

akka models endpoints list

List the project’s model endpoints in the region.

akka models endpoints get NAME

Describe one model endpoint. When the endpoint is not ready, this prints the reason.

API keys

An endpoint must name an apiKeySecret. Keys are stored as entries of that secret, one entry per client. The alias key is accepted.

Command Description

akka models endpoints keys add ENDPOINT CLIENT

Add an API key for one client. The key is printed once and cannot be read back.

akka models endpoints keys list ENDPOINT

List the clients that hold a key. The key values are never printed.

akka models endpoints keys remove ENDPOINT CLIENT

Remove one client’s key. The secret remains, so requests without a valid key are refused.

To rotate a key, add a key under a new client name, move the client to it, and then remove the old key.

akka models delete does not delete the secret an endpoint names. The keys remain valid for any endpoint that names the same secret. Delete the secret with akka secrets delete when the keys must be destroyed.

Model directory

akka optimize models is the model directory. A model in the directory is a model version in the artifact registry. The list and get commands read each version from the registry and add what the trainer, the gateway router, and the portfolio service know about it. The alias model is accepted.

A model reference is one string:

  • NS/NAME or NS/NAME:latest names the newest version.

  • NS/NAME:v2 names a version number.

  • NS/NAME:serving names the version that the alias serving points at.

  • NS/NAME@sha256:DIGEST names a version by its digest.

Command Description

akka optimize models list

List every model version in the registry, one row each, with its hosting (self-hosted or the provider), served name, and lifecycle. Then list the served names that no version accounts for.

akka optimize models list --namespace NS

List the versions of one namespace, archived or not. The command lists no unregistered served names, because they belong to no namespace.

akka optimize models list --lifecycle LIFECYCLE

Keep the rows in one lifecycle: active, deprecated, or retired.

akka optimize models list --archived

Also list the versions of archived namespaces.

akka optimize models get NS/NAME[:REF]

Show one version with its training, serving, routing, and price. The command takes every reference form.

akka optimize models deprecate NS/NAME:vN --reason TEXT

Mark a version for replacement. Routes to the version keep serving.

akka optimize models retire NS/NAME:vN --reason TEXT

End the use of a version. Retiring a version is final.

Served names without a model version

akka optimize models list lists a served name as unregistered when no version accounts for it, and either the pricing catalog in force prices it or the portfolio service recorded traffic to it in the last 30 days. A hosted version is a provider’s model in the registry. It accounts for the name that the provider serves it under. A trainer endpoint accounts for each name it answers under. To bring an unregistered name into the directory, register a version with akka optimize registry models register.

The versions of archived namespaces and the endpoints of archived training projects account for their served names with or without --archived.

Reading one model version

akka optimize models get shows the version and one part for each service that owns a fact about it:

  • Training, from the trainer: the run that produced the version, its dataset, and the newest score for each dataset and grader.

  • Serving, from the trainer: the endpoints that serve the version, and the name that a request calls it by.

  • Routing, from the gateway router: the destination records that name the version, the rules that send to those destinations, and the manifest in force when a rule sends to one of them.

  • Price, from the portfolio service: the pricing catalog version in force, and its entry for each served name.

Reading the directory when a service does not answer

akka optimize models list and get need the registry. When the registry does not answer, the command fails. When another service does not answer within 10 seconds, or within --timeout when you set it, the command shows that part as unavailable and still succeeds.

With -o json, the command prints each part as its service answered it. list prints models, unregistered, and unavailable. get prints model, training, serving, routing, and price.

Deprecating and retiring a model version

akka optimize models deprecate and retire take a version number only, such as NS/NAME:v2, and require --reason. The registry records who made the move, when, and the reason.

The command reads the version first. Before it asks anything, it refuses an alias, latest, a digest, and a version that the registry does not hold. It then lists each destination record, rule, and manifest that still reaches the version. It prints the list beside the question, or on standard error after the move when it asks no question. When the command cannot read the gateway router, it states that it does not know what still routes to the version, and it makes the move.

deprecate marks the version for replacement. Routes to a deprecated version keep serving. The gateway router accepts a routing write that reaches the version, and returns a warning. The command asks a yes or no question that defaults to no. --force or --disable-prompt skips the question.

Retiring a version is final. You cannot deprecate a retired version or move an alias onto it. The gateway router refuses a routing write that makes the version newly reachable. A route that reaches the version now keeps serving. The command asks you to type the reference again. With --disable-prompt, the command refuses instead of asking. Only --force skips the question.

Registering and choosing a model version

The akka optimize registry models commands register a version and choose the version to use.

Command Description

akka optimize registry models register NS/NAME -f FILE

Register a version. A version is active once you register it.

akka optimize registry models alias set NS/NAME:ALIAS --version vN

Point an alias, such as serving, at the version to use.

The features described in this section are an add-on to Akka Automated Operations. They are not included in the base product.