Metadata-Version: 2.4
Name: computeseal
Version: 1.0.0
Summary: Official Python SDK for ComputeSeal, the cryptographic verification layer for AI completions.
Author-email: ComputeSeal Team <team@computeseal.com>
Project-URL: Homepage, https://github.com/computeseal/computeseal-python-sdk
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# computeseal

The official Python SDK for **ComputeSeal**, the cryptographic verification layer for AI completions.

Wrap your AI completions with tamper-proof proof receipts, verifying latency, token usage, cost parameters, and gateway node signatures. Optionally anchor hashes to the Solana blockchain for public auditing.

## Installation

You can install the SDK directly via pip:

```bash
pip install computeseal
```

## Quickstart

Initialize the client and send verifiable inference completions:

```python
import json
import os
from computeseal import ComputeSeal

# Initialize the client
seal = ComputeSeal(
    api_key=os.environ.get("COMPUTESEAL_API_KEY")
)

# Run a verifiable completion query
result = seal.chat(
    model="openrouter/llama-3.1-70b",
    messages=[
        {"role": "user", "content": "Explain zero-knowledge rollups simply."}
    ],
    receipt=True,       # Request cryptographic receipt
    anchor="solana"     # Write transaction memo to Solana ledger
)

# Print output response text
print(result.output)

# Print proof ledger details
print(json.dumps(result.receipt, indent=2))
```

## Sandboxed Local Testing (No Server Needed)

If the SDK detects an API Key starting with `cs_test_`, the key `mock_key`, or if the environment variable `COMPUTESEAL_MOCK=true` is set, it will automatically fallback to high-fidelity offline local proof-proving simulation mode. This enables immediate integration tests in local dev sandboxes without requiring active backend endpoints.

## Config Parameters

| Parameter | Type | Description |
|---|---|---|
| `api_key` | `str` | Your ComputeSeal Gateway API Key (defaults to `COMPUTESEAL_API_KEY` env var). |
| `base_url` | `str` | The API Gateway URL endpoint (defaults to `https://computeseal.com/api` or `COMPUTESEAL_BASE_URL` env var). |

## Chat Options

| Option | Type | Default | Description |
|---|---|---|---|
| `model` | `str` | Required | Model routing path (e.g., `openai/gpt-4o-mini`, `groq/llama-3.1-8b-instant`). |
| `messages` | `list` | Required | Messages list mapping role (`user`, `assistant`, `system`) and content strings. |
| `receipt` | `bool` | `True` | Generate cryptographic compute proof receipt block. |
| `anchor` | `str` | `"solana"` | Ledger network options (`"solana"`, `"none"`, `"off-chain"`). |
| `temperature` | `float` | `None` | Gateway routing model temperature. |
| `max_tokens` | `int` | `None` | Max tokens limit for response completion. |
| `stream` | `bool` | `None` | Enable streaming completions. |

## License

MIT License.
