Metadata-Version: 2.4
Name: cydeai-client
Version: 0.1.5
Summary: CLI client for Cysic decentralized AI providers
Author: Cysic-Curry
License-Expression: LicenseRef-Proprietary
Keywords: cysic,cydeai,vllm,gpu,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: websockets>=12
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"

# cydeai-client Wheel Release Usage Notes

Replace `0.1.5` with the released version.

## Install

```bash
python3 -m venv ~/cydeai-client-env
. ~/cydeai-client-env/bin/activate
python -m pip install -U pip
python -m pip install cydeai-client==0.1.5
cydeai --help
```

## Configure

Create `~/.cydeai/config.json`:

```bash
mkdir -p ~/.cydeai
cat > ~/.cydeai/config.json <<EOF
{
  "server_url": "https://<server-host>/<base-path>",
  "api_key": "<provider_api_key>",
  "worker_name": "<worker-display-name>",
  "model_name": "<served-model-name-from-vllm>",
  "model_port": 8000,
  "vllm_health_interval_sec": 30,
  "vllm_health_timeout_sec": 5,
  "vllm_health_failure_threshold": 2
}
EOF
chmod 600 ~/.cydeai/config.json
```

The client reads values in this order:

```text
CLI args > environment variables > config file > defaults
```

## Check Local vLLM

`cydeai check` sends a tiny OpenAI-compatible chat request to local vLLM.

```bash
cydeai check
```

Expected success:

```text
[INFO][2026-07-09 10:00:00] vLLM normal
```

If it fails, confirm that vLLM is running and that `model_name` matches the
served model name from:

```bash
curl -sS http://127.0.0.1:8000/v1/models | python3 -m json.tool
```

## Dry Run

```bash
cydeai connect --dry-run
```

Dry run prints the derived WebSocket URL, masked `PROVIDER_SIGN` header,
register payload, and local vLLM check result. It does not connect to the
server and does not print the raw API key.

## One-Shot Register Test

```bash
cydeai connect --exit-after-register
```

This validates WebSocket handshake and `register_ok`, then exits.

## Start Worker

```bash
cydeai connect
```

Keep this process running. Logs are printed to the terminal and appended to:

```text
~/.cydeai/cydeai.log
```

Output format:

```text
[INFO][2026-07-09 10:00:00] connect attempt 1: wss://...
[INFO][2026-07-09 10:00:00] registered: attempt=1 worker_id=w-... status=available
```

After registration, the client checks local `GET /v1/models` every 30 seconds
by default. After two consecutive failures, it closes the current gateway
connection, keeps the process alive, and reconnects after vLLM recovers.
Failures include host, port, URL, request body, response body, status code,
response time, and reason in the log.

## Release Notes Checklist

- package name: `cydeai-client`
- CLI command: `cydeai`
- version: `0.1.5`
- install command: `python -m pip install cydeai-client==0.1.5`
- required Python version: Python 3.11+
- vLLM must already be running locally
- config path: `~/.cydeai/config.json`

