Metadata-Version: 2.4
Name: rleaas
Version: 1.0.1
Summary: Release SDK — RL Environments as a Service by Centific
Project-URL: Repository, https://github.com/CentificProduct/rleaas
Keywords: agent,reinforcement-learning,rl,rleaas,training
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.11.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# rleaas — Release SDK

Python SDK for the **Release (RLEaaS)** platform by Centific — RL Environments as a Service.

## Installation

```bash
pip install rleaas
```

## API Key

| Setup | API key needed? | How to get it |
|---|---|---|
| **Local dev server** (`http://localhost:8000`) | No | Run the AgentWork-Simulator locally — no auth required |
| **Hosted / production** | Yes | Log in to the Release dashboard → **Settings → API Keys** → create a key |

Set the key as an environment variable so you never hardcode it:

```bash
export RLEAAS_API_KEY="rleaas_sk_your_key_here"
```

The SDK reads it automatically:

```python
import rleaas

client = rleaas.Client()                          # reads RLEAAS_API_KEY from env
# or
client = rleaas.Client(api_key="rleaas_sk_...")   # pass explicitly
```

### Local development (no key required)

```python
import rleaas

client = rleaas.Client(base_url="http://localhost:8000")
print(client.ping())
# {'message': 'RL Environment & Agent API', 'version': '1.0.0', ...}
```

## Sub-clients

| Attribute | Purpose |
|---|---|
| `client.Environment` | Create and manage simulation environments |
| `client.Tools` | Register and configure agent tools |
| `client.Agent` | Register and export trained agents |
| `client.Verifier` | Define scoring verifiers (rule-based, LLM judge, composite) |
| `client.Scenario` | Create and browse training scenarios |
| `client.ScenarioSuite` | Organize scenarios into training/evaluation suites |
| `client.TrainingJob` | Launch and monitor GRPO/PPO/DQN/A2C training runs |
| `client.Evaluation` | Run evaluations and retrieve rollouts |
| `client.Metrics` | Query KPIs and training metrics |
| `client.AuditLog` | Access audit logs and governance configuration |

## Example

```python
import rleaas

client = rleaas.Client()   # reads RLEAAS_API_KEY from environment

# Create environment
env = client.Environment.create(name="FinSim-Prod-v1", vertical="FinSim")
env.wait_until_ready()

# Create verifier
rule_v = client.Verifier.create(
    name="AML Compliance Check",
    verifier_type="rule_based",
    environment="FinSim-Prod-v1",
    config={
        "conditions": ["'run_aml_check' in trajectory.tool_calls"],
        "condition_logic": "AND",
        "reward_on_pass": 1.0,
        "reward_on_fail": 0.0,
    },
)

# Train
job = client.TrainingJob.run(
    environment_name="FinSim-Prod-v1",
    algorithm="GRPO",
    config={"episodes": 10000, "max_steps_per_episode": 20},
    verifier_ids=[rule_v.id],
)
job.wait_until_complete()
best = job.get_best_checkpoint()

# Evaluate
eval_job = client.Evaluation.run(
    agent_checkpoint_id=best["id"],
    scenario_suite_id="suite_eval_01",
    verifier_ids=[rule_v.id],
)
report = eval_job.wait_until_complete()
print(report["overall_score"])
```

## Async support

```python
async with rleaas.AsyncClient() as client:
    status = await client.ping()
```

## License

MIT
