Model commands
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 |
|---|---|
|
List the accelerator pools available to the organization. |
|
List the pools of one region. Repeat |
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 |
|---|---|
|
List the project’s accelerator allocations in the region. |
|
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 |
|---|---|
|
List the project’s models in the region. |
|
Describe one model. When the model is not ready, this prints the reason from its |
|
Wait until the model is ready. |
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 |
|---|---|
|
Create or update every resource the descriptor names, by name. |
|
Run the region’s full admission without persisting anything. |
|
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. |
|
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 |
|---|---|
|
List the project’s model endpoints in the region. |
|
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 |
|---|---|
|
Add an API key for one client. The key is printed once and cannot be read back. |
|
List the clients that hold a key. The key values are never printed. |
|
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.
|
|
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/NAMEorNS/NAME:latestnames the newest version. -
NS/NAME:v2names a version number. -
NS/NAME:servingnames the version that the aliasservingpoints at. -
NS/NAME@sha256:DIGESTnames a version by its digest.
| Command | Description |
|---|---|
|
List every model version in the registry, one row each, with its hosting ( |
|
List the versions of one namespace, archived or not. The command lists no unregistered served names, because they belong to no namespace. |
|
Keep the rows in one lifecycle: |
|
Also list the versions of archived namespaces. |
|
Show one version with its training, serving, routing, and price. The command takes every reference form. |
|
Mark a version for replacement. Routes to the version keep serving. |
|
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 |
|---|---|
|
Register a version. A version is active once you register it. |
|
Point an alias, such as |
| The features described in this section are an add-on to Akka Automated Operations. They are not included in the base product. |