Metadata-Version: 2.4
Name: implicant
Version: 0.2.0
Summary: Python client SDK for the Implicant FHE inference platform
Author: Implicant
License: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: implicant-fhe<0.3,>=0.2.1
Requires-Dist: numpy>=1.26
Requires-Dist: pydantic>=2.6
Requires-Dist: typer>=0.12
Provides-Extra: app
Requires-Dist: keyring>=24; extra == 'app'
Requires-Dist: pyside6>=6.6; extra == 'app'
Provides-Extra: dev
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest-qt>=4; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

# Implicant SDK

Python **client** for the Implicant FHE inference platform. Encrypts one row
locally under BGV, sends the ciphertext to the platform for homomorphic
evaluation, and decrypts the result. The server never sees plaintext; the
secret key never leaves the process.

The classifier head runs **server-side under FHE** (Variant B): the platform
returns one ciphertext with the class scores packed contiguously, which the
client decrypts (unsigned) and decodes with `decode_class_scores` before
threshold/argmax. `W` / `b` never reach the client.

Pure Python — all crypto comes from [`implicant-fhe`](https://github.com/implicant/implicant-fhe)
(`helut.client`). Contracts: [`docs/architecture.md`](docs/architecture.md)
and `platform/docs/FHE_INTERFACE_SPEC.md`.

## Install (developers)

`implicant-fhe` (the `helut` crypto wheel) is not on a public index — resolve it
from the bundled `./wheels/`. Wheels ship for **cp310–cp313** (macOS-arm64 +
manylinux-x86_64) only; Python 3.14 has no wheel, so use a 3.10–3.13 interpreter.

```bash
python3.13 -m venv .venv313
.venv313/bin/pip install -e ".[app,dev]" --find-links wheels/
.venv313/bin/pytest tests/ -v      # 79 pass in ~3.5 min — the real smoke test
```

## Desktop app (end users)

Non-technical users install a double-click app instead of using Python:

- **macOS (Apple chip):** open the `.dmg` and drag Implicant to Applications.
- **Linux (Intel/AMD chip):** run the `.AppImage`.

Other platforms are not supported yet; the app says so on launch. Building the
installers is documented in `docs/INSTALL_SMOKE_TEST.md`.

## Use

```python
from implicant import ImplicantClient
from implicant.transport import HttpxTransport

client = ImplicantClient(
    HttpxTransport(base_url="https://api.implicant.example", api_key="imp_..."),
    key_cache_dir="~/.implicant/keys",
)
result = client.predict(
    "breast-cancer",
    {"mean_radius": 14.2, "mean_texture": 20.1},
    class_names=("benign", "malignant"),
)
print(result.prediction.label)
```

```bash
implicant predict --model breast-cancer --input row.json
```

## License

Apache-2.0.
