Skip to main content
Start with the path that matches what you already know. If tm is not already on your PATH, install the CLI first with Installation. The commands below assume tm is on your PATH. If you are running from this repo checkout without activating a shell that already exposes tm, use ./.venv/bin/tm.

Path 1: Fastest Serverless Request

Choose this when you already have both:
  • an inference API key
  • a valid serverless model name for your target host
You do not need Control Plane login for this path:
tm version
tm infer chat \
  --surface serverless \
  --api-key YOUR_INFERENCE_API_KEY \
  --model YOUR_SERVERLESS_MODEL_NAME \
  --json '[{"role":"user","content":"Say hello."}]'
If you do not already know the model name to use, start with tm billing pricing serverless list. That discovery command requires tm auth login for the same Tensormesh environment.

Path 2: Standard On-Demand Setup

Choose this when you want the most guided CLI flow and are okay using the synced On-Demand configuration:
tm version
tm auth login
tm init --sync
tm auth status
tm config show --sources
tm infer doctor
tm auth whoami
tm init --sync syncs the available managed gateway settings in the active config.toml state root. When TM_CONFIG_HOME is unset, that file is ~/.config/tensormesh/config.toml. If a served On-Demand deployment already exists, that includes the served gateway model name used for the default request flow. If no served model exists yet, gateway_model_id stays unset while the API key and user id can still sync. When you are targeting a different Control Plane host, run the same explicit --controlplane-base on tm init --sync once so the active config.toml persists that host for later @latest and other Control Plane-assisted flows. For automation or CI, add --exit-status to readiness checks so they fail the shell when required prerequisites are still missing:
tm infer doctor --exit-status
tm auth status --exit-status

Understand The Readiness Commands

Use the readiness commands like this:
  • tm auth status: local Control Plane and gateway credential presence
  • tm infer doctor: local readiness for the next inference request
  • tm doctor: broader local config and credential diagnosis across CLI setup
  • tm auth whoami: live Control Plane auth check
tm auth status, tm infer doctor, and tm doctor are local checks. They do not prove that a live API call will succeed. After the local checks look good, use tm auth whoami as the explicit live validation step for your current Control Plane login.

First Working On-Demand Request

After tm init shows that On-Demand inference credentials are ready, send a request like this:
tm infer chat --json '[{"role":"user","content":"Say hello."}]'
If you want the CLI to resolve the latest served model through the Control Plane first:
tm auth login
tm init --sync
tm infer chat --model @latest --json '[{"role":"user","content":"Say hello."}]'
You still need valid inference credentials even when using @latest, so keep the normal tm init --sync step in the flow.

What tm init Helps You Check

  • whether the current config file exists
  • whether Control Plane login is ready
  • whether [managed] in the active config.toml has synced gateway settings
  • whether inference API key, user id, and model name are present
  • whether --model @latest can be resolved yet
  • the exact next commands to finish setup