Metadata-Version: 2.4
Name: reinogent
Version: 0.1.1
Summary: Official Python SDK & CLI for discovering, downloading, and running AI Models, MCP Servers, and Agents from ReinoGent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: transformers
Requires-Dist: torch>=2.1.0; extra == "transformers"
Requires-Dist: transformers>=4.41.0; extra == "transformers"
Requires-Dist: safetensors>=0.4.0; extra == "transformers"
Requires-Dist: accelerate>=0.30.0; extra == "transformers"
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=3.0.0; extra == "embeddings"
Provides-Extra: mcp
Requires-Dist: mcp>=1.0.0; extra == "mcp"
Provides-Extra: agent
Requires-Dist: fastapi>=0.115.0; extra == "agent"
Requires-Dist: uvicorn[standard]>=0.32.0; extra == "agent"
Requires-Dist: httpx>=0.27.0; extra == "agent"
Provides-Extra: all
Requires-Dist: torch>=2.1.0; extra == "all"
Requires-Dist: transformers>=4.41.0; extra == "all"
Requires-Dist: safetensors>=0.4.0; extra == "all"
Requires-Dist: accelerate>=0.30.0; extra == "all"
Requires-Dist: sentence-transformers>=3.0.0; extra == "all"
Requires-Dist: mcp>=1.0.0; extra == "all"
Requires-Dist: fastapi>=0.115.0; extra == "all"
Requires-Dist: uvicorn[standard]>=0.32.0; extra == "all"
Requires-Dist: httpx>=0.27.0; extra == "all"

# `reinogent` — Official Python SDK & CLI

Lightweight Python SDK and `reino` CLI for discovering, downloading, installing dependencies for, and running **AI Models**, **MCP Servers**, and **Agents** from ReinoGent.

## Installation

```bash
# Core SDK + CLI (zero mandatory dependencies)
pip install -e ./cli

# Or install with optional runtime dependency extras:
pip install -e "./cli[transformers]"   # torch, transformers, safetensors, accelerate
pip install -e "./cli[embeddings]"     # sentence-transformers
pip install -e "./cli[mcp]"            # mcp Python SDK
pip install -e "./cli[agent]"          # fastapi, uvicorn, httpx (for building agents)
pip install -e "./cli[all]"            # all runtime extras
```

*(Once published to PyPI: `pip install reinogent` / `pip install "reinogent[transformers]"`.)*

## CLI Quick Start

```bash
# Works out of the box against ReinoGent (optional: point at localhost for local dev)
# reino config set-api http://localhost:8000/api

# Browse & inspect dependencies
reino list models --african --task text-generation
reino deps model bge-small-en-v1-5
reino deps mcp github-mcp-server

# Pull resources (generates `reino.json` + `reino_run.py` bundle) & install deps
reino pull model bge-small-en-v1-5 --install-deps
reino pull mcp github-mcp-server --config
reino pull mcp github-mcp-server --install-deps
reino pull agent <agent-id> --install-deps

# Run any packaged ReinoGent bundle (`model`, `mcp`, or `agent`)
reino run ./bge-small-en-v1-5 --prompt "Hello ReinoGent"
reino run ./github-mcp-server

# Scaffold a new SDK-native ReinoGent AgentApp project
reino init "Swahili Support Bot" --model bge-small-en-v1-5 --mcp github-mcp-server
```

## Build an Agent in 10 Lines (`reinogent.AgentApp`)

```python
import reinogent

app = reinogent.AgentApp(
    name="Swahili Support Bot",
    model="bge-small-en-v1-5",
    mcp_tools=["github-mcp-server"],
)

@app.on_message
async def handle(ctx: reinogent.AgentContext):
    return f"Received: {ctx.input}"

if __name__ == "__main__":
    app.serve(port=8001)  # Exposes POST /invoke (HMAC verified), GET /health, GET /reino-manifest
```

## Python SDK Quick Start

```python
import reinogent

# 1. Load a ReinoGent model directly (auto-resolves Transformers / Sentence-Transformers)
model = reinogent.load_model("bge-small-en-v1-5")

# 2. Download raw model weights/files from upstream CDN
local_dir = reinogent.download_model("bge-small-en-v1-5", dest_dir="./weights")

# 3. Fetch ready-to-use MCP client configuration
mcp_cfg = reinogent.get_mcp_config("github-mcp-server")

# 4. Run a hosted ReinoGent agent
result = reinogent.run_agent("agt_12345", "Summarize Q4 metrics", token="<your-jwt>")

# 5. Verify ReinoGent webhook HMAC-SHA256 signatures inside your FastAPI/Flask agent
is_valid = reinogent.verify_signature(body, x_reino_signature, x_reino_timestamp, SECRET_KEY)
```

## Publishing to PyPI

```bash
pip install build twine
cd cli
python -m build
twine upload dist/*
```
