# @infersec/conduit

Conduit agent for connecting local LLMs to the Infersec cloud.

## Usage

```bash
npx @infersec/conduit inference start --engine <type> --key <api-key> --source <source-id>
```

### Commands

| Command           | Description               |
| ----------------- | ------------------------- |
| `inference start` | Start the inference agent |

### Flags

| Flag            | Required | Default                        | Notes                                                                                  |
| --------------- | -------- | ------------------------------ | -------------------------------------------------------------------------------------- |
| `--engine`      | Yes      | -                              | Engine type (matches `ENGINE`).                                                        |
| `--engine-port` | No       | `8000`                         | Engine port (matches `ENGINE_PORT`).                                                   |
| `--key`         | Yes      | -                              | API key (matches `API_KEY`).                                                           |
| `--port`        | No       | `9505`                         | Port to listen on (matches `PORT`).                                                    |
| `--root`        | No       | `$HOME/.cache/infersec/iagent` | Root directory (matches `ROOT_DIRECTORY`).                                             |
| `--source`      | Yes      | -                              | Inference source ID (matches `SOURCE`).                                                |
| `--api-url`     | No       | `https://api.infersec.ai`      | API base URL (matches `API_URL`).                                                      |
| `--start-mode`  | No       | `auto`                         | Startup mode (matches `START_MODE`): `auto` starts engine, `idle` leaves conduit idle. |

### Examples

| Scenario           | Command                                                                                                                      |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| Required only      | `npx @infersec/conduit inference start --engine vllm --key <api-key> --source <source-id>`                                   |
| Custom root/port   | `npx @infersec/conduit inference start --engine vllm --key <api-key> --source <source-id> --root /data/infersec --port 9506` |
| Custom engine/port | `npx @infersec/conduit inference start --engine vllm --key <api-key> --source <source-id> --port 9506 --engine-port 8989`    |

## Environment variables

| Variable         | Required | Default                        | Notes                                     |
| ---------------- | -------- | ------------------------------ | ----------------------------------------- |
| `ENGINE`         | Yes      | -                              | Engine type (matches `--engine`).         |
| `ENGINE_PORT`    | No       | `8000`                         | Engine port (matches `--engine-port`).    |
| `API_KEY`        | Yes      | -                              | API key (matches `--key`).                |
| `SOURCE`         | Yes      | -                              | Inference source ID (matches `--source`). |
| `API_URL`        | No       | `https://api.infersec.ai`      | API base URL (matches `--api-url`).       |
| `PORT`           | No       | `9505`                         | Port to listen on (matches `--port`).     |
| `ROOT_DIRECTORY` | No       | `$HOME/.cache/infersec/iagent` | Root directory (matches `--root`).        |
| `START_MODE`     | No       | `auto`                         | Startup mode (matches `--start-mode`).    |

CLI flags override environment variables when both are provided.
