Metadata-Version: 2.4
Name: chapman-sip
Version: 0.1.0
Summary: A CLI tool to run steerable models on the Chapman cluster with SSH port forwarding
Author-email: Developer <developer@example.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: paramiko>=3.0.0
Requires-Dist: click>=8.0.0
Requires-Dist: rich>=12.0.0

# Chapman-Sip CLI

A pip-installable Python command-line utility to connect to the Chapman cluster (`dgx0.chapman.edu`), pull the `steerable-model-runner` repository, find an open port, launch the model server, and tunnel the port back to your local machine.

## Features

- **Automated Host Setup**: Checks if the remote repository is cloned at `~/.steerable-models` on the cluster, cloning or pulling changes automatically.
- **Dynamic Port Hunting**: Generates a random port and verifies it is not currently bound on the cluster before initiating.
- **SSH Port Forwarding**: Automatically forwards the selected remote port to `localhost:[PORT]` locally.
- **Interactive Log Streaming**: Streams stderr and stdout from the model serving script in real-time.
- **Safe Shutdown**: Automatically cleans up the remote process, closes the port-forwarding server, and closes SSH channels on Ctrl+C.

## Installation

Install in editable mode for development or directly from the source directory:

```bash
pip install -e .
```

## Usage

Simply run:

```bash
sip
```

You will be prompted for:
- SSH username
- SSH password
- Hugging Face API token (for model download)
- Hugging Face repository name (e.g., the model repository to run)

Once connected, the utility will output the endpoint URL, e.g.:
```
https://localhost:[PORT]/v1/
```
Keep the CLI running while you query the endpoint. Press `Ctrl+C` to terminate the model server and close the tunnel.
