Metadata-Version: 2.4
Name: roboto-sai-sdk
Version: 0.7.0
Summary: Roboto SAI python SDK
Author-email: "Roboto SAI, LLC" <roberto@roboto-sai.com>
License-Expression: LicenseRef-RVM-ECOL-1.0
Project-URL: Homepage, https://github.com/Roboto-SAI-LLC/roboto-sai-sdk
Project-URL: Repository, https://github.com/Roboto-SAI-LLC/roboto-sai-sdk
Project-URL: Issues, https://github.com/Roboto-SAI-LLC/roboto-sai-sdk/issues
Keywords: roboto,sai,sdk,ai,python,api
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.141.1
Requires-Dist: uvicorn>=0.53.0
Requires-Dist: uvloop>=0.22.1; sys_platform != "win32"
Requires-Dist: httptools>=0.8.0
Requires-Dist: pydantic[email]>=2.13.5
Requires-Dist: pydantic-settings>=2.15.0
Requires-Dist: python-multipart>=0.0.32
Requires-Dist: python-dotenv>=1.2.3
Requires-Dist: websockets>=12.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: requests>=2.34.2
Requires-Dist: aiohttp>=3.14.3
Requires-Dist: urllib3>=2.8.0
Requires-Dist: sqlalchemy>=2.1.0; python_version >= "3.11"
Requires-Dist: sqlalchemy<2.1,>=2.0.54; python_version < "3.11"
Requires-Dist: aiosqlite>=0.22.1
Requires-Dist: redis>=8.1.0
Requires-Dist: aioredis>=2.0.1
Requires-Dist: celery>=5.6.3
Requires-Dist: kombu>=5.6.2
Requires-Dist: cryptography>=50.0.1
Requires-Dist: PyJWT>=2.15.0
Requires-Dist: bcrypt>=5.0.0
Requires-Dist: bleach>=6.4.0
Requires-Dist: itsdangerous>=2.2.0
Requires-Dist: defusedxml>=0.7.1
Requires-Dist: mistune>=3.3.4
Requires-Dist: pygments>=2.18.0
Requires-Dist: pillow>=12.3.0
Requires-Dist: psutil>=7.2.2
Requires-Dist: structlog>=26.1.0
Requires-Dist: slowapi>=0.1.10
Requires-Dist: prometheus-client>=0.26.0
Requires-Dist: opentelemetry-distro>=0.65b0
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.65b0
Requires-Dist: mcp==2.2.0
Requires-Dist: supabase==2.31.0
Requires-Dist: boto3>=1.43.102
Requires-Dist: numpy<3
Requires-Dist: transformers>=5.17.0
Requires-Dist: sentence-transformers<6,>=5.7.0
Requires-Dist: accelerate>=1.15.0
Requires-Dist: onnxruntime>=1.30.0; python_version >= "3.11"
Requires-Dist: onnxruntime<1.24,>=1.23.2; python_version < "3.11"
Requires-Dist: chromadb>=1.5.9
Requires-Dist: networkx>=3.6.1; python_version >= "3.11"
Requires-Dist: networkx<3.5,>=3.4.2; python_version < "3.11"
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: langchain-community>=0.4.2
Requires-Dist: matplotlib>=3.11.2; python_version >= "3.11"
Requires-Dist: matplotlib<3.11,>=3.10.9; python_version < "3.11"
Requires-Dist: torch==2.14.1
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-mock>=3.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: setuptools>=70; extra == "dev"
Requires-Dist: tomli>=2.0; python_version < "3.11" and extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Provides-Extra: xai
Requires-Dist: xai-sdk>=1.6.1; extra == "xai"
Dynamic: license-file

# roboto-sai-sdk

Python SDK for the [Roboto SAI](https://roboto-sai.com) platform — the canonical client and source of truth for public model names, runtime profiles, and the frozen runtime contract.

## Install

```bash
pip install roboto-sai-sdk
```

Requires Python 3.10+.

### What `pip install roboto-sai-sdk` pulls in (0.7.0+)

Since 0.7.0 the core install is the full roboto-sai.com backend runtime **including its heavy ML
stack and PyTorch**, so the site needs nothing but `pip install roboto-sai-sdk` — there are no
`[site]`/`[server]` extras. That is 48 direct requirements and ~190–210 installed distributions.
Measured site-packages on Linux x86_64:

| Install path | site-packages |
| --- | --- |
| CPU torch first (below), then `pip install roboto-sai-sdk` | **~2.0 GB** |
| plain `pip install roboto-sai-sdk` from PyPI (resolves the **CUDA** torch build + `nvidia-*` wheels) | **~6.4 GB** |

**CPU-only install** (servers and CI without a GPU) — install torch from the PyTorch CPU index
first; pip then treats `torch==2.14.1` as satisfied and skips the CUDA build:

```bash
pip install torch==2.14.1 --index-url https://download.pytorch.org/whl/cpu
pip install roboto-sai-sdk
```

> **Warning:** a Render 512 MB Starter instance previously ran out of memory (OOM-killed) with this
> heavy stack installed. Use a larger instance, or keep heavy imports lazy.

- **Web/ASGI:** fastapi, uvicorn, uvloop (not on Windows), httptools, pydantic[email],
  pydantic-settings, python-multipart, python-dotenv, websockets
- **HTTP:** httpx (the only one the SDK code itself imports), requests, aiohttp, urllib3
- **Storage/queues:** sqlalchemy, aiosqlite, redis, aioredis, celery, kombu
- **Security/content:** cryptography, PyJWT, bcrypt, bleach, itsdangerous, defusedxml, mistune,
  pygments, pillow
- **Ops:** psutil, structlog, slowapi, prometheus-client, opentelemetry-distro,
  opentelemetry-instrumentation-fastapi
- **Integrations (exact pins):** `mcp==2.2.0`, `supabase==2.31.0`, plus boto3
- **ML:** `torch==2.14.1`, numpy (<3), transformers, sentence-transformers, accelerate, onnxruntime,
  chromadb, networkx, rank-bm25, langchain-community, matplotlib

On Python 3.10, sqlalchemy, onnxruntime, networkx and matplotlib resolve to their newest
3.10-capable lines (the site's floors need 3.11+). Not included: `xai-sdk` (opt in with
`pip install "roboto-sai-sdk[xai]"`). The machine-readable list is
`roboto_sai_sdk/contracts/dependency_contract.json`. Need only the lightweight client? Pin
`roboto-sai-sdk<0.7`.

## Quick Start

```python
from roboto_sai_sdk import RobotoSAI

client = RobotoSAI()  # uses SAI_ACCESS_TOKEN from env
result = client.send_message("Review this repository and propose the next refactor.")

print(result["model"])      # "roboto-sai"
print(result["subtitle"])   # "Core runtime"
print(result["text"])       # assistant reply
```

Stream mode:

```python
from roboto_sai_sdk import RobotoSAI, extract_text_delta

client = RobotoSAI(model="roboto-sai")
for event in client.stream("List five things to test in a new SDK release."):
    print(extract_text_delta(event), end="", flush=True)
```

## Personal Memory

Retrieve the authenticated user's memories (Supabase-backed) with the same token:

```python
from roboto_sai_sdk import RobotoSAI

client = RobotoSAI()
for mem in client.list_memories(limit=10):
    print(mem["category"], "—", mem["content"])

hits = client.search_memories("what did I say about the launch?", limit=5)
```

## Public Model Surface

The SDK exposes four canonical models:

| Model | Mode | Use |
| --- | --- | --- |
| `roboto-sai` | single-agent | Core general intelligence |
| `roboto-sai-code-x` | single-agent | Code generation, debugging, architecture |
| `roboto-sai-cortex` | multi-agent | Deep orchestration with research capabilities |
| `roboto-sai-rovox` | single-agent (audio) | Voice/audio I/O — separate realtime path |

Use only canonical `roboto-sai-*` names. Legacy aliases (e.g. `roboto-sai-lightning`, `-heavy`, `-flex`) were removed in `0.2.0`.

## Inspect Runtime Profiles

```python
from roboto_sai_sdk import (
    DEFAULT_PUBLIC_MODEL,
    PUBLIC_MODEL_NAMES,
    get_runtime_profile,
)

print(DEFAULT_PUBLIC_MODEL)             # "roboto-sai"
print(sorted(PUBLIC_MODEL_NAMES))       # all 4 names
print(get_runtime_profile("roboto-sai"))
```

## Authentication

The Roboto SAI API authenticates with a Supabase JWT. The SDK resolves it in this order:

1. Explicit `access_token=...` argument
2. `SAI_ACCESS_TOKEN` environment variable

Get a token by logging in (e.g. `roboto-sai auth login` in the CLI). Set
`SAI_API_BASE_URL` to override the default base URL (`https://api.roboto-sai.com`).

## Public API

The stable surface is **`roboto_sai_sdk.__all__`** (17 names; client, memory, keys, and MCP are lazy-loaded on first access):

`RobotoSAI`, `SendMessageResult`, `StreamEvent`, `extract_text_delta`, `Memory`, `DEFAULT_PUBLIC_MODEL`, `PUBLIC_MODEL_NAMES`, `RuntimeProfile`, `get_runtime_profile`, `normalize_public_model`, `get_mcp_config`, `get_public_runtime_contract`, `CONTRACT_VERSION`, `CONTRACT_LAST_UPDATED`, `SAI_ACCESS_TOKEN`, `resolve_access_token`, `hash_key`

```python
import roboto_sai_sdk

assert roboto_sai_sdk.__all__ == [
    "RobotoSAI",
    "SendMessageResult",
    "StreamEvent",
    "extract_text_delta",
    "Memory",
    "DEFAULT_PUBLIC_MODEL",
    "PUBLIC_MODEL_NAMES",
    "RuntimeProfile",
    "get_runtime_profile",
    "normalize_public_model",
    "get_mcp_config",
    "get_public_runtime_contract",
    "CONTRACT_VERSION",
    "CONTRACT_LAST_UPDATED",
    "SAI_ACCESS_TOKEN",
    "resolve_access_token",
    "hash_key",
]
```

Voice/audio (`roboto-sai-rovox`) requires the realtime integration — `send_message` and `stream` raise `NotImplementedError` for that model. A future `RobotoSAIVoice` client will land in a separate release.

## Repository

Source code, examples, and full release notes: <https://github.com/Roboto-SAI-LLC/roboto-sai-sdk>

## License

Proprietary. See LICENSE in the repository.
