Metadata-Version: 2.4
Name: supascale-ai
Version: 0.1.0
Summary: Official Python client for Supascale deployment inference (POST /api/v1/{deployment_id}/chat)
Project-URL: Homepage, https://github.com/supascale/supascale
Author: Supascale
License: Apache-2.0
Requires-Python: >=3.9
Requires-Dist: requests>=2.28.0
Description-Content-Type: text/markdown

# supascale-ai (Python)

Minimal client for **deployment chat** — the same HTTP call as the dashboard **Try it live** button.

## Install

From this monorepo:

```bash
pip install ./supascale-sdk/python
```

When published: `pip install supascale-ai`

The PyPI distribution name is `supascale-ai`; the Python import module is still `supascale`.

## Usage

```python
from supascale import Supascale

# Defaults: SUPASCALE_API_KEY, SUPASCALE_DEPLOYMENT_ID, optional SUPASCALE_API_BASE
client = Supascale()

print(client.chat("What are some fun things to do in New York?"))
```

Or pass credentials explicitly:

```python
client = Supascale(
    api_key="YOUR_DEPLOYMENT_API_KEY",
    deployment_id="YOUR_DEPLOYMENT_ID",
    base_url="https://api.supascale.com",
)
```

## Environment variables

| Variable | Purpose |
|----------|---------|
| `SUPASCALE_API_KEY` | Deployment API key (Bearer token) |
| `SUPASCALE_DEPLOYMENT_ID` | Deployment UUID |
| `SUPASCALE_API_BASE` | API origin (default `https://api.supascale.com`) |

## API

- `Supascale.chat(message, *, deployment_id=..., messages=..., timeout=...)` → `str`  
  Sends `message` plus `messages` (defaults to one user turn) to `POST /api/v1/{id}/chat` and returns the `response` field.

## Publishing to PyPI

Homebrew and many Linux Pythons are **PEP 668** “externally managed”: you cannot `pip install build twine` into the system interpreter. Use a **venv** (or `pipx install twine` and run `pipx run build` / upload from another tool).

From `supascale-sdk/python`:

```bash
python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install --upgrade pip build twine
python -m build             # creates dist/*.whl and dist/*.tar.gz
python -m twine upload dist/*
```

Set PyPI credentials when prompted (username `__token__`, password your API token), or:

```bash
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-xxxxxxxx   # do not commit

python -m twine upload dist/*
```

If **zsh** says `no matches found: dist/*`, it usually means `dist/` is empty because `python -m build` never ran (fix the venv / install steps first). After a successful build, you can upload with Bash so the glob works: `bash -c 'python -m twine upload dist/*'`.
