Metadata-Version: 2.4
Name: alveare
Version: 0.1.0
Summary: Python SDK for the Alveare Private SLM Inference-as-a-Service platform
Project-URL: Homepage, https://alveare.ai
Project-URL: Documentation, https://docs.alveare.ai
Author-email: Alveare <sdk@alveare.ai>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx<1.0.0,>=0.24.0
Description-Content-Type: text/markdown

# Alveare Python SDK

Python client for the [Alveare](https://alveare.ai) Private SLM Inference-as-a-Service platform.

## Installation

```bash
pip install alveare
```

## Quick start

```python
from alveare import Alveare

client = Alveare(api_key="alv_live_...")

# Native inference
result = client.infer(
    specialist="summarise",
    prompt="Summarise this quarterly report...",
    max_tokens=256,
)
print(result.text)

# OpenAI-compatible chat completions
completion = client.chat.completions.create(
    model="alveare-summarise",
    messages=[{"role": "user", "content": "Summarise this..."}],
    max_tokens=256,
)
print(completion.choices[0].message.content)
```

## Async usage

```python
import asyncio
from alveare import AsyncAlveare

async def main():
    async with AsyncAlveare(api_key="alv_live_...") as client:
        result = await client.infer(specialist="summarise", prompt="...")
        print(result.text)

asyncio.run(main())
```

## Configuration

| Parameter    | Environment variable   | Default                      |
|------------- |----------------------- |------------------------------|
| `api_key`    | `ALVEARE_API_KEY`     | *required*                   |
| `base_url`   | `ALVEARE_BASE_URL`    | `https://api.alveare.ai`   |
| `timeout`    | --                     | `60.0`                       |
| `max_retries`| --                     | `3`                          |

## Error handling

```python
from alveare import Alveare, AuthenticationError, RateLimitError, APIError

client = Alveare(api_key="alv_live_...")

try:
    result = client.infer(specialist="summarise", prompt="...")
except AuthenticationError:
    print("Check your API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except APIError as e:
    print(f"API error {e.status_code}: {e.message}")
```

## Requirements

- Python 3.9+
- [httpx](https://www.python-httpx.org/) (installed automatically)

## License

MIT
