Metadata-Version: 2.5
Name: agi-diy
Version: 0.1.0
Summary: api.agi.diy client: lease a VLA policy, run it over the LeRobot remote-inference protocol.
Project-URL: Homepage, https://api.agi.diy
Project-URL: Source, https://github.com/cagataycali/api-agi-diy
Author: agi.diy
License-Expression: Apache-2.0
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Provides-Extra: lerobot
Requires-Dist: lerobot[remote]>=0.6; extra == 'lerobot'
Requires-Dist: numpy; extra == 'lerobot'
Description-Content-Type: text/markdown

# agi-diy

Python client for [api.agi.diy](https://api.agi.diy). Lease a VLA policy, run it over the LeRobot
remote-inference protocol (zenoh). One call = one token per action in the chunk.

```
pip install "agi-diy[lerobot]"
agi login
agi run act/so101 --probe
```

```python
import agi

with agi.Policy("act/so101") as session:
    actions = session.predict(
        {"observation.state": state, "observation.images.front": frame},
        task="pick up the cube",
    )  # np.ndarray [n_action_steps, dof]
```

The key comes from `AGI_API_KEY` or `~/.agi/credentials` (`AGI_API_KEY=agi_sk_live_…`).

## Surface

```python
agi.Policy("act/so101")          # POST /v1/sessions → lease; raises agi.NoSlots / agi.InsufficientCredits / agi.AuthError
session.endpoint                 # "ws/zenoh.api.agi.diy:80"
session.deployment               # "d_…"
session.url                      # "zenoh+ws://zenoh.api.agi.diy:80/d_…"
session.connect()                # admitted lerobot.remote_inference.RemoteClient
session.predict(obs, task="…")   # one chunk, np.ndarray
session.policy()                 # strands-robots policy: arm.run(session.policy(), seconds=30)
session.rollout_args()           # flags for lerobot-rollout
session.close()                  # DELETE /v1/sessions/:id (also a context manager)
agi.models(); agi.me(); agi.usage(); agi.sessions(); agi.health()
```

CLI: `agi login` · `agi models` · `agi session act/so101` · `agi run act/so101 --probe` ·
`agi rollout act/so101 -- --robot.type=so101_follower …` · `agi usage`.

`connect()`, `predict()` and `rollout` need `pip install "agi-diy[lerobot]"`. The REST part has no dependencies.

Errors subclass `agi.Error` with `.error`, `.status`, `.retry_after_s`.
