Routing commands

Feature set: Inference Contact our support for access.
This functionality evolves quickly, the behavior and APIs might change between releases without further notice.

These commands govern how the gateway router chooses a model provider for a request. See Routing requests to models for the tasks they support.

Every command on this page is a subcommand of akka optimize. Documents sent with -f FILE are JSON. Passing -f - reads the document from standard input instead.

Static routing rulesets

A ruleset holds the attribute-matching rules that choose a destination for a request. See Routing ruleset for the predicates and attributes a rule can use.

The singular forms ruleset and rule are accepted as aliases.

Listing and reading rulesets

To list every ruleset with its revision and priority:

akka optimize rulesets list

To print the current document for one ruleset:

akka optimize rulesets get NAME

To read a past revision instead of the current one:

akka optimize rulesets get NAME --revision 3

Applying and deleting rulesets

To create or replace a ruleset in full:

akka optimize rulesets apply NAME -f ruleset.json

To write only while the ruleset is still at a known revision, pass --if-revision. The write fails if another author has changed the ruleset in the meantime:

akka optimize rulesets apply NAME -f ruleset.json --if-revision 3

To retire a ruleset:

akka optimize rulesets delete NAME

The record of a retired ruleset survives its deletion.

Editing a single rule

To add or replace one rule without sending the rest of the ruleset:

akka optimize rulesets rules apply RULESET RULE -f rule.json

To remove one rule:

akka optimize rulesets rules delete RULESET RULE

Testing a ruleset

To see what a ruleset would decide for a sample request, with no traffic involved:

akka optimize rulesets test NAME -f request.json

Execution order and history

Rulesets are evaluated in priority order. To read the order set for a ruleset:

akka optimize rulesets priority NAME

To change it:

akka optimize rulesets priority NAME --set 10

To list every change made to a ruleset, with its revision and who made it:

akka optimize rulesets history NAME

Routing classifiers

A classifier is a named pointer to a model provider that a rule can select. Registration is immutable, so a retrained model is registered under a new id. The forms routing-classifier, classifiers, and classifier are accepted as aliases.

Listing and reading classifiers

To list what is registered, with retired entries omitted:

akka optimize routing-classifiers list

To print one classifier as it is stored:

akka optimize routing-classifiers get ID

Registering and retiring classifiers

To register a classifier:

akka optimize routing-classifiers apply ID -f classifier.json

Registration is immutable. Sending the same document again under the same id succeeds, and reinstates the entry if it had been retired. Sending a different document under an existing id is refused. A retrained model is registered under a new id.

To retire a classifier:

akka optimize routing-classifiers delete ID

Retirement is unconditional. Nothing checks whether a rule still names the classifier, so repoint any rule that selects it before retiring it. The command asks for confirmation first.

Reading classifier history

To list the registration, retirement, and reinstatement of a classifier, with who made each change and when:

akka optimize routing-classifiers history ID

Semantic routing

The commands in this section govern the use cases a semantic router recognizes and what serves each one. See Routing on request meaning for how the routing itself works.

The working set and its manifests

akka optimize use-cases covers the use cases discovered in traffic. The aliases use-case and uc are accepted. Discovery runs against live traffic. The working set is what has been discovered so far, and a manifest fixes that set so it can enforce routing. See Defining use cases for what a use case is and how one is discovered.

Command Description

akka optimize use-cases status

The working set, and whether it can be frozen.

akka optimize use-cases working-set

The use cases currently being discovered in traffic.

akka optimize use-cases exemplars list ID|LABEL

One use case and the requests nearest its center.

akka optimize use-cases label ID LABEL

Name a use case in the working set.

akka optimize use-cases freeze --as TAG --backend LABEL=BACKEND

Fix the working set as a manifest.

akka optimize use-cases manifests list

Every manifest, and whether it can enforce.

akka optimize use-cases manifests get TAG|MANIFEST

One manifest as it was frozen.

akka optimize use-cases manifests diff TAG

A manifest against the working set as it stands now.

akka optimize use-cases manifests deploy TAG

Make a manifest the live routing policy.

akka optimize use-cases manifests delete TAG

Tombstone a manifest.

Routing policies

akka optimize routing-policies states what serves a use case, and in what share. The aliases routing-policy, policies, and policy are accepted.

Command Description

akka optimize routing-policies get USECASE

The current policy and its history.

akka optimize routing-policies apply USECASE -f FILE

Publish a policy version.

akka optimize routing-policies rollback USECASE

Republish a previous version.

akka optimize routing-policies veto USECASE

Refuse routing changes until lifted.

akka optimize routing-policies route MODEL --usecase X [--shadow N] [--canary N]

Set the shadow and canary dials. 0 removes a dial.

 

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