Litmus CLI
A command-line interface for deploying and managing Litmus, a tool for quickly building and testing LLMs.
Prerequisites
- Google Cloud SDK (gcloud): Ensure you have the Google Cloud SDK installed and authenticated.
- Install: https://cloud.google.com/sdk/docs/install
- Authenticate:
gcloud auth login
- Go 1.18 or higher: Required for building and running the CLI.
Installation
Fast installation
Make sure you have the Google Cloud SDK installed and configured with the correct project.
Install binary:
- Linux:
curl https://storage.googleapis.com/litmus-cloud/install/linux.sh | sudo sh
- sha256: https://storage.googleapis.com/litmus-cloud/prod/linux/litmus.sha256
- OSX:
curl https://storage.googleapis.com/litmus-cloud/install/osx.sh | sudo sh
- sha256: https://storage.googleapis.com/litmus-cloud/prod/osx/litmus.sha256
Manual Build
Clone this repository to your local machine:
bashgit clone https://github.com/google/litmus.git
Navigate to the project directory:
bashcd litmus/cli
Install Go dependencies:
bashgo mod download
Build the CLI:
bashgo build
Usage
Usage: litmus <command> [options] [flags]
Commands:
open Open the Litmus dashboard
deploy Deploy the application
destroy Destroy Litmus resources
status Show the status of the Litmus deployment
version Display the version of the Litmus CLI
execute Execute a payload against the Litmus application
ls List all runs
run Open a specific Litmus run
analytics Manage Litmus analytics (deploy or destroy)
proxy Manage Litmus proxy (deploy, list, destroy, destroy-all)
Options:
--project <project-id>: Specify the project ID (overrides default)
--region <region>: Specify the region (defaults to 'us-central1')
--quiet Suppress verbose output
Examples
Deploy Litmus:
bashlitmus deploy
Deploy to a specific project and region:
bashlitmus deploy --project my-project-id --region us-east1
Destroy the Litmus deployment:
bashlitmus destroy
Get deployment status:
bashlitmus status
Display CLI version:
bashlitmus version
Execute a payload:
bashlitmus execute "Hello, world!"
List all runs:
bashlitmus ls
Open a specific run:
bashlitmus run <runID>
Deploy Litmus Analytics:
bashlitmus analytics deploy
Destroy the Litmus Analytics deployment:
bashlitmus analytics destroy
Deploy Litmus Proxy:
bashlitmus proxy deploy
This will prompt the user to select from a list of available regions and platforms. Alternatively, the upstream URL can be specified:
bashlitmus proxy deploy --upstreamURL <your_upstream_url>
- Replace
<your_upstream_url>
with the desired upstream endpoint (e.g.,europe-west1-aiplatform.googleapis.com
).
- Replace
List all deployed Litmus Proxies:
bashlitmus proxy list
Destroy a Litmus Proxy deployment:
bashlitmus proxy destroy <service_name>
- Replace
<service_name>
with the name of the deployed proxy (e.g.,us-central1-aiplatform-litmus-abcd
).
- Replace
Destroy all Litmus Proxy deployments:
bashlitmus proxy destroy-all
Configuration
- The CLI uses your default gcloud project configuration.
- Use the
--project
flag to specify a different project.