Skip to content

CLI Reference

Global options

  • --debug: Show logs for debugging.
  • --help (-h): Show the help message and exit.

build

This command is for containerizing your model.

tungsten build .
will create a docker image with tungsten_model.py in the current directory.

Options

  • --name (-n): Name of the model in <repo name>[:<tag>] format
    • Default: BUILD_DIRECTORY_NAME:MODEL_ID (e.g. current-directory:41ea3bf)
  • --model-module (-m): Model module (e.g., some.example.module)
    • Default: tungsten_model
  • --model-class (-c): Model class (e.g., MyModel)
    • Default: the class decorated with tungstenkit.define_model
  • --copy-files: Copy files to the container in <src in host>:<dest in container> format

models

The models command displays all the available models.

tungsten models

serve

The serve command runs a REST API server with a model.

tungsten serve mymodel:v1

If you want to run with the latest model in a repository, you can omit the tag.

tungsten serve mymodel

If you want to run with the latest model, you can omit the model name.

tungsten serve

Options

  • --port (-p): Bind socket to this port.
    • Default: 3000
  • --batch-size: Max batch size for adaptive batching.
    • Default: Declared value in tungsten_model.py
  • --log-level: Log level of the server.
    • Default: info
    • Available values: trace, debug, info, warning, error

demo

The demo command runs an interactive web demo with a model.

tungsten demo mymodel:v1

If you want to run with the latest model in a repository, you can omit the tag.

tungsten demo mymodel

If you want to run with the latest model, you can omit the model name.

tungsten demo

Options

  • --port (-p): The port on which the demo server will listen.
    • Default: 3300
  • --host: The host on which the demo server will listen
    • Default: localhost
  • --batch-size: Max batch size for adaptive batching.
    • Default: Declared value in tungsten_model.py
  • --log-level: Log level of the server.
    • Default: info
    • Available values: trace, debug, info, warning, error

predict

This command is for running a prediction with a model.

tungsten predict stable-diffusion:1.5 -i prompt="astronaut" -i seed=1234

Options

  • --input (-i): Input field in the format of <NAME>=<VALUE>
  • --output-file-dir: Output file directory
    • Default: .

tag

The tag command adds a new name of a model.

tungsten tag mymodel:v1 mymodel:v1.1

remove

The remove command removes a model.

tungsten remove mymodel:v1

clear

The clear command removes all models.

tungsten clear

If you want to remove all models in a repository (e.g. all models whose name starts with mymodel), you can put the repository name.

tungsten clear mymodel

login

This command is for logging in to tungsten.run.

tungsten login

push

This command is for pushing a model to tungsten.run. Before running this command, you should login to tungsten.run using login command.

tungsten push exampleuser/exampleproject:exampleversion

If you already logged in with the username of exampleuser, the above command is equivalent to:

tungsten push exampleproject:exampleversion

If you want to push the latest model, you can omit the model name.

tungsten push

pull

This command is for pulling a model from tungsten.run.

tungsten pull exampleuser/exampleproject:exampleversion