ersilia.cli.commands package

Subpackages

Submodules

ersilia.cli.commands.auth module

ersilia.cli.commands.auth.auth_cmd()[source]

Creates auth command

ersilia.cli.commands.catalog module

ersilia.cli.commands.catalog.catalog_cmd()[source]

Creates the catalog command for the CLI.

This command allows users to list a catalog of models available either locally or in the model hub. It provides options to display the catalog in various formats(such as tables by default or json), show more detailed information, and view model cards for specific models.

Returns:

The catalog command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples


Display model card for a specific model ID and show catalog in json format: $ ersilia catalog –card <model_id> –as-json

ersilia.cli.commands.close module

ersilia.cli.commands.close.close_cmd()[source]

Closes the current session of the served model.

This command allows users to close the current session and clean up any resources.

Returns:

The close command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples

Close the current session:
$ ersilia close

ersilia.cli.commands.delete module

ersilia.cli.commands.delete.delete_cmd()[source]

Deletes a specified model.

This command allows users to delete a specified model from the local storage.

Returns:

The delete command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples

Delete a specific model:
$ ersilia delete <model_id>

Delete all models:
$ ersilia delete --all

ersilia.cli.commands.example module

ersilia.cli.commands.example.example_cmd()[source]

Create example command

ersilia.cli.commands.fetch module

ersilia.cli.commands.fetch.fetch_cmd()[source]

Fetches a specified model.

This command allows users to fetch a specified model from the model hub (dockerhub, repo, s3 etc…).

Returns:

The fetch command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples

Fetch a model by its ID:
$ ersilia fetch <model_id> [auto model source decider] or ersilia fetch <model_id> --from_github/--from_dockerhub

Fetch a model from a local directory:
$ ersilia fetch <model_id> --from_dir <path>

ersilia.cli.commands.info module

ersilia.cli.commands.info.info_cmd()[source]

Provides information about a specified model.

This command allows users to get detailed information about a current active session.

Returns:

The info command function to be used by the CLI.

Return type:

function

Examples

Get information about active session as json:
$ ersilia info  --as_json

ersilia.cli.commands.publish module

ersilia.cli.commands.publish.publish_cmd()[source]

Publishes a specified model.

This command allows users to publish a specified model to the model hub.

Returns:

The publish command function to be used by the CLI.

Return type:

function

Examples

Publish a model by its ID:
$ ersilia publish create <model_id>

Rebase a model:
$ ersilia publish rebase <model_id>

ersilia.cli.commands.run module

ersilia.cli.commands.run.run_cmd()[source]

Runs a specified model.

This command allows users to run a specified model with given inputs.

Returns:

The run command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples

Run a model by its ID with input data:
$ ersilia run -i <input_data> --as-table

Run a model with batch size:
$ ersilia run -i <input_data> -b 50

ersilia.cli.commands.serve module

ersilia.cli.commands.serve.serve_cmd()[source]

Serves a specified model.

This command allows users to serve a specified model as an API.

Returns:

The serve command function to be used by the CLI and for testing in the pytest.

Return type:

function

Examples

Serve a model by its ID:
$ ersilia serve <model_id> --port 8080

Serve a model and track the session:
$ ersilia serve <model_id> --track

ersilia.cli.commands.setup module

ersilia.cli.commands.setup.setup_cmd()[source]

Sets up the environment.

This command allows users to set up the environment for using the CLI.

Returns:

The setup command function to be used by the CLI.

Return type:

function

Examples

Set up the environment with full installation:
$ ersilia setup --full

Set up the environment with base installation:
$ ersilia setup --base

ersilia.cli.commands.test module

ersilia.cli.commands.test.test_cmd()[source]

Test a model and obtain performance metrics.

This command allows you to test a model using various options to customize the testing process.

The command performs the following steps: - Sets up the model tester with the specified model and options. - Executes tests to evaluate the model’s performance, metadata check, output consistency and more. - Generates and outputs performance metrics.

Examples

With basic testing:/
$ ersilia test eosxxxx --from_dir /path/to/model

With different sources to fetch the model:
$ ersilia test eosxxxx --from_github/--from_dockerhub/--from_s3

With different levels of testing:
$ ersilia test eosxxxx --shallow --from_github/--from_dockerhub/--from_s3

ersilia.cli.commands.uninstall module

ersilia.cli.commands.uninstall.uninstall_cmd()[source]

Uninstalls all Ersilia artifacts present locally on the user’s system

Module contents

class ersilia.cli.commands.ErsiliaCommandGroup(name: str | None = None, commands: MutableMapping[str, Command] | Sequence[Command] | None = None, **attrs: Any)[source]

Bases: Group

Command group for Ersilia CLI commands.

NUMBER_OF_COMMON_PARAMS = 2
static bentoml_common_params(func)[source]

Add common parameters to the command.

command(*args, **kwargs)[source]

Register a new command with common parameters.