Metadata-Version: 2.4
Name: reinogent
Version: 0.2.0
Summary: Official Python SDK, ADK (Agent Development Kit) & CLI for building, 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, ADK & CLI

Lightweight Python **SDK**, **ADK (Agent Development Kit)**, and `reino` **CLI** for discovering, downloading, building, and running **AI Models**, **MCP Servers**, and **Autonomous Agents** locally or on ReinoGent.

## Installation

```bash
pip install reinogent

# Optional runtime extras:
pip install "reinogent[transformers]"   # torch, transformers, safetensors, accelerate
pip install "reinogent[embeddings]"     # sentence-transformers
pip install "reinogent[mcp]"            # mcp Python SDK
pip install "reinogent[agent]"          # fastapi, uvicorn, httpx (for hosting AgentApp)
pip install "reinogent[all]"            # all runtime extras
```

## ReinoGent ADK (Build & Run Local Agents + Live MCP Tools)

```python
from reinogent.adk import Agent, LocalAgentRunner, SequentialWorkflow, tool

@tool
def add(a: int, b: int) -> int:
    """Add two integers."""
    return a + b

# 1. Build a local agent with your own Ollama / LM Studio / Gemini model + live local MCP tools
with Agent(
    name="DevHelper",
    model="ollama/qwen2.5:7b",             # or local/model, openai/gpt-4o-mini, gemini/gemini-2.5-flash
    instructions="You are a sharp developer assistant.",
    tools=[add],
    mcp_servers=["github-mcp-server"],     # auto-fetches stdio config from ReinoGent & connects live!
) as agent:
    print(agent.ask("Check open issues in my repo and add 2 + 2"))

# 2. Or run ANY ReinoGent marketplace agent locally on your own local model:
with LocalAgentRunner.from_reinogent(
    agent_id="<agent-id>",
    model="ollama/llama3.2:3b",
    mcp_servers=["github-mcp-server"],
) as local_agent:
    print(local_agent.ask("Summarize my latest tasks"))
```

### Run Local Agents from the Terminal (`reino chat`)

```bash
# Run a ReinoGent agent locally with Ollama + local MCP tools
reino chat <agent-id> --model ollama/qwen2.5:7b --mcp github-mcp-server

# Or chat standalone with a persistent session
reino chat --model ollama/llama3.2:3b --session my-dev-session
```

## 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/*
```
