> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensormesh.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# tm infer doctor

> Inspect serverless inference readiness for the next request.

## What This Checks

`tm infer doctor` is a local readiness check for the next inference request. It helps you confirm that the CLI has the inputs it needs, but it does not send a live inference request.

Use [`tm infer chat`](/cli/reference/infer/chat) for an end-to-end inference check, and use [`tm auth whoami`](/cli/reference/auth/whoami) if you also need to confirm the current Control Plane bearer token.

## Usage

```sh theme={null}
tm infer doctor [OPTIONS]
```

## Examples

### Inspect serverless readiness for a direct request that will provide `--model` explicitly.

```sh theme={null}
tm infer doctor
```

### Inspect the effective serverless target after applying explicit request overrides.

```sh theme={null}
tm infer doctor --model YOUR_SERVERLESS_MODEL_NAME --base-url https://serverless.tensormesh.ai
```

### Use shell-friendly exit codes when direct serverless prerequisites are missing.

```sh theme={null}
tm infer doctor --exit-status
```

## Details

Inspect inference readiness for the next request.

## Options

| Name            | Type                 | Required | Default        | Details                                                           |
| --------------- | -------------------- | -------- | -------------- | ----------------------------------------------------------------- |
| `--surface`     | `choice[serverless]` | no       | `"serverless"` | Inference surface to inspect.                                     |
| `--model`       | `text`               | no       |                | Model name to inspect for the next request.                       |
| `--api-key`     | `text`               | no       |                | Inference API key to inspect.                                     |
| `--base-url`    | `text`               | no       |                | Override the base URL for the selected surface.                   |
| `--exit-status` | `boolean`            | no       | `false`        | Exit non-zero when checks report a not-ready state. Boolean flag. |

## Inherited Global Options

| Name                  | Type           | Required | Default                              | Details                                                                                                                      |          |    |          |                                                                   |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V`     | `boolean`      | no       | `false`                              | Show the version and exit. Boolean flag.                                                                                     |          |    |          |                                                                   |
| `--config`            | `path`         | no       | `"~/.config/tensormesh/config.toml"` | Path to config TOML file                                                                                                     |          |    |          |                                                                   |
| `--output`            | \`choice\[text | json     | yaml                                 | raw                                                                                                                          | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet`             | `boolean`      | no       | `false`                              | Suppress non-essential output. Boolean flag.                                                                                 |          |    |          |                                                                   |
| `--debug`             | `boolean`      | no       | `false`                              | Print debug logs to stderr (secrets redacted). Boolean flag.                                                                 |          |    |          |                                                                   |
| `--ca-bundle`         | `path`         | no       |                                      | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE).                                             |          |    |          |                                                                   |
| `--timeout`           | `float`        | no       |                                      | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override).                          |          |    |          |                                                                   |
| `--max-retries`       | `integer`      | no       |                                      | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). |          |    |          |                                                                   |
| `--controlplane-base` | `text`         | no       |                                      | Override the Control Plane base URL.                                                                                         |          |    |          |                                                                   |

## Caveats

* Reports local readiness only. Use `tm auth whoami` to live-validate Control Plane auth and `tm infer chat` for an end-to-end inference check.
* `tm infer doctor` accepts the same local targeting overrides as `tm infer chat` for `--model`, `--api-key`, and `--base-url`.
* Checks the shared inference API key (`gateway_api_key`) and selected host, but does not live-validate the upstream endpoint.
* Use `tm billing pricing serverless list` to discover published serverless model names when you have Control Plane access for the same Tensormesh environment. `tm infer doctor` can check whether `--model` is present, but it does not enumerate them itself.

## Related Commands

* [`tm init`](/cli/reference/init)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm doctor`](/cli/reference/doctor)

## Parent Command

* [`tm infer`](/cli/reference/infer)
